-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unify translation config #39
Conversation
Some opts were recently renamed, requiring changes to config-config. HPO also requires some fixes.
- There is no longer a separate translation config with different structure. - When translating, a task must be specified. It can either be one of the supervised tasks used during training, or a zero-shot task added later. - Translation accepts arbitrary arguments, ignoring invalid arguments silently. This allows using the training config, even though many of the arguments have no function during translation.
There is currently no way to automatically generate zero-shot configs. Currently it must be done by hand: copypasting and editing a supervised task definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
IIUC, we still need to manually provide --src
, --tgt
, --src_lang
and --tgt_lang
to the translation script?
Ideally I'd want the default translation behavior to be some sort of loop over all tasks in the config. In the long run, we might want to think about supporting a path_test_{src,tgt}
so as to allow only a subset of tasks to be tested.
Good enough for now, let's add this multi-test feature for a later rc2.
encoder_id=encoder_id, | ||
decoder_id=decoder_id, | ||
corpus_id=corpus_id, | ||
weight=1.0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the long run, it would be good to have some tool for type checking
# tgt_subword_model = opts.in_config[0].get('tgt_subword_model', None) | ||
# use_src_lang_token = cc_opts.get('use_src_lang_token', False) | ||
|
||
# TODO: create zero-shot tasks using the same template as for the supervised tasks, except that: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be discussed. There's a potential risk for confusion by having two very similar types of tasks that need to be configured in slightly different ways.
I think we might want either of the following to:
- explicitly mark some tasks as test-only (i.e., zeroshot),
- halt and catch fire in partially / improperly defined tasks (any defined
path_src
should require device assignment and explode mid-air otherwise).
We might want a big fat DEBUG message about which tasks are defined for which steps (train/val/test), e.g. a tab-spaced table with split as columns and tasks as rows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if we generate the zero-shots already in the training config (i.e. before training), then we need to clearly mark the test-only tasks and add validation to prevent accidental mistakes.
However, I see this more as an extra transformation to run on a training config to add the zero-shot tasks, so that you can then easily use it as a translation config. You shouldn't need to decide before training whether you want a particular zero-shot or not.
The translation script needs: You can give
Yes, this would be nice. It would require that Also, there should be a way to list the tasks that you want to include (and/or omit).
I don't really like this approach, as it would mean that you need to specifiy the translation input in the config, and there can be only one. Also, it makes it extremely cumbersome to use the model for, you know, actually translating something. Although for non-batch mode translation (the actual real deal), we would need to repair/reimplement the translation server. |
Ding dong, the translation config is dead.
the supervised tasks used during training, or a zero-shot task added
later.
silently. This allows using the training config, even though many of
the arguments have no function during translation.
Currently it must be done by hand: copypasting and editing a supervised
task definition.