Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

default config for JointTextTask #211

Closed

Conversation

Titousensei
Copy link
Contributor

Summary:
because fblearner is confused about types List[Union], we can't
give a default value to those Config parameters and we leave them empty.
That's a problem for gen_default_config, which relies on instanciating
components with default values. So those configs, like JointTextTask, can't
be used with gen_default_config.

This diff introduces a generic solution for Tasks like this (not for all
components, coming soon) by allowing each task to provide an optional
function "example_config" that returns a Config object with default values
suitable for gen_default_config. This default values for List[Union] should
be a list of each possible class of the union, to give a complete example
that users can edit at their convenience.

We solve the case of JointTextTask as an example. Other tasks will be solved
in following diffs.

Differential Revision: D13441705

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 16, 2019
Titousensei added a commit to Titousensei/pytext that referenced this pull request Jan 17, 2019
Summary:
Pull Request resolved: facebookresearch#211

because fblearner is confused about types List[Union], we can't
give a default value to those Config parameters and we leave them empty.
That's a problem for gen_default_config, which relies on instanciating
components with default values. So those configs, like JointTextTask, can't
be used with gen_default_config.

This diff introduces a generic solution for Tasks like this (not for all
components, coming soon) by allowing each task to provide an optional
function "example_config" that returns a Config object with default values
suitable for gen_default_config. This default values for List[Union] should
be a list of each possible class of the union, to give a complete example
that users can edit at their convenience.

We solve the case of JointTextTask as an example. Other tasks will be solved
in following diffs.

Differential Revision: D13441705

fbshipit-source-id: 3474985df195f69034109328b4c305502ddbdfe3
Titousensei added a commit to Titousensei/pytext that referenced this pull request Jan 17, 2019
Summary:
Pull Request resolved: facebookresearch#211

because fblearner is confused about types List[Union], we can't
give a default value to those Config parameters and we leave them empty.
That's a problem for gen_default_config, which relies on instanciating
components with default values. So those configs, like JointTextTask, can't
be used with gen_default_config.

This diff introduces a generic solution for Tasks like this (not for all
components, coming soon) by allowing each task to provide an optional
function "example_config" that returns a Config object with default values
suitable for gen_default_config. This default values for List[Union] should
be a list of each possible class of the union, to give a complete example
that users can edit at their convenience.

We solve the case of JointTextTask as an example. Other tasks will be solved
in following diffs.

Differential Revision: D13441705

fbshipit-source-id: bfa04de79d9dc2c491f740699c9e56c55e6b7fbc
Summary:
Pull Request resolved: facebookresearch#211

because fblearner is confused about types List[Union], we can't
give a default value to those Config parameters and we leave them empty.
That's a problem for gen_default_config, which relies on instanciating
components with default values. So those configs, like JointTextTask, can't
be used with gen_default_config.

This diff introduces a generic solution for Tasks like this (not for all
components, coming soon) by allowing each task to provide an optional
function "example_config" that returns a Config object with default values
suitable for gen_default_config. This default values for List[Union] should
be a list of each possible class of the union, to give a complete example
that users can edit at their convenience.

We solve the case of JointTextTask as an example. Other tasks will be solved
in following diffs.

Reviewed By: m3rlin45

Differential Revision: D13441705

fbshipit-source-id: d4d6a30341cff9b2e87db0342808c6933a37ad9c
@Titousensei Titousensei deleted the export-D13441705 branch April 17, 2019 19:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants