Skip to content
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

[WIP] Add target features #2315

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anderleich
Copy link
Contributor

ATTENTION! I'm opening a new PR to add target features only.
The previous PR was #2289. Closed

This PR intends to add target features support to OpenNMT-py. Target features are appended to the textual data. It uses the special character as a feature separator, as in the previous versions of the OpenNMT framework.

 I│1│3 love│0│1 eating│0│1 pizza│0│1

Target features can be used along source features. A YAML configuration file would look like this:

data:
    train:
        path_src: src_with_features.txt  #  I│1│3 love│0│1 eating│0│1 pizza│0│1
        path_tgt: tgt_with_features.txt  #  Me│1 gusta│0 comer│0 pizza│0
        transforms: [onmt_tokenize, inferfeats, filtertoolong]
    valid:
        path_src: src_with_features.txt
        path_tgt: tgt_with_features.txt
        transforms: [onmt_tokenize, inferfeats]

save_data: ./data
n_sample: -1

# # Vocab opts
src_vocab: data.vocab.src
tgt_vocab: data.vocab.tgt
n_src_feats: 2
n_tgt_feats: 1
src_feats_defaults: "0│1"
tgt_feats_defaults: "1"
feat_merge: "sum"

@vince62s for the moment I've just copied all the necessary changes from #2289.

@yash-srivastava19
Copy link

Is this PR still WIP? Any update when this will be done? Or if you need any help in this PR? I might be of some use?

@vince62s
Copy link
Member

not sure where @anderleich left this on hold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants