-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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] Support source and target features #2289
Conversation
@anderleich is there anything (at least source features) that we can test so far ? are you still working on this ? |
Hi @vince62s , Yes, I'm still working on this. I haven't had much time for this lately, but I'm on the right path. I've already managed to modify the vocabulary building and training scripts. These both work for source and target features. I need to ensure nothing is broken for other use cases (some debugging to make tests pass). After that the only thing left would be to modify the inference (onmt_translate and the server). |
Hi @vince62s , I've made code changes to make other configurations pass the tests. I still have some issues with the beam search translation and LM generation in the tests. Maybe you can shed some light on this? However, I think we are at a stage where we can begin to disccuss and test the changes I've made so far. Note: I took the changes @francoishernandez made in this PR #1710 as a guide. |
ok, I have made a first pass. I need to clone your repo and test locally on my system. Will try to do it asap. |
I think that having dictionary like examples was the source of many incosistencies with source or target features. Therefore, I've added a new class I could not come up with a reason for keeping the dict like examples, do you? |
I've also made the necessary changes for beam search decoding. It works with my working pipeline, however some tests are failing... I'll keep working on it |
@anderleich I don't mind discussing this new stuff but I really think it is too many changes for a single PR, especially when having done a first review. |
I agree that adding the |
I get it but the issue is that we have plenty of missing unit tests a bit everywhere so we'll never be sure that it does not break things. I really would prefer to do things in at least two steps. |
Do you know a quick method to split the changes in two steps? Quicker than typing everything again... |
You need to
|
Hi @vince62s , This is what I've finally planned on this. I will submit 3 different PRs to keep changes simpler and make reviews easier:
What do you think? |
We can try, let's do step 1. and we'll see how it goes. |
@vince62s I've created a new PR #2308 to restore back source features. All the test are passing. I'm planning to carry out some more checks to ensure everything is working as expected but overall the source features functionality is back. You can start reviewing the code. TODO: I need to update the docs |
ATTENTION! I'm opening a new PR as v3.0 branch has already been merged in
master
The previous PR was #2227. Closed
This PR intends to add target features support to OpenNMT-py v3.0. All the code has been adapted for this new version.
Both source and target features support has been refactored for a more simplified handling of features. The way features are passed to the system has been changed and now features are appended to the actual textual data instead of providing a separate file. This also simplifies the way features are passed during inference and to the server. It uses the special character
│
as a feature separator, as in the previous versions of the OpenNMT framework. For instance:I've also added a way to provide default values for features. This can be really useful when mixing task specific data (with features) with general data which has not been annotated. Additionally, the
filterfeats
transform is no longer required and features are checked in the corpus loading process.A YAML configuration file would look like this:
For now, I've made the necessary changes in the code for vocabulary generation. That is, to make
onmt_build_vocab
work.