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

Save nesting_field.vocab.freqs #403

Merged
merged 7 commits into from
Sep 24, 2018
Merged

Save nesting_field.vocab.freqs #403

merged 7 commits into from
Sep 24, 2018

Conversation

nzw0301
Copy link
Contributor

@nzw0301 nzw0301 commented Sep 21, 2018

I guess this PR fixes #372 .

In the currect code, nestedField.vocab.freqs and nestedField.nesting_field.vocab.freqs are empty.

  1. nestedField.vocab.freqs is empty because build_vocab() does not have any argument in this line.
  2. nestedField.nesting_field.vocab.freqs is not empty in build_vocab function, but it becomes empty because the current code assigns nestedField.vocab to nestedField.nesting_field.vocab.

In this PR, nestedField.nesting_field.vocab.freqs is copyed into nestedField.vocab.freqs to access nestedField.nesting_field.vocab.freqs.

Is it expected behavior?

If so, I will add test code to this PR.

@mttk
Copy link
Contributor

mttk commented Sep 22, 2018

I'll have to look into the original error a bit more into detail, hopefully later today. Thanks!

@mttk
Copy link
Contributor

mttk commented Sep 24, 2018

I believe this is the intended behavior as the vocabs of the nested/nesting fields are intended to be shared link.

Feel free to write a test, thanks for the fix!

@nzw0301
Copy link
Contributor Author

nzw0301 commented Sep 24, 2018

Thank you for your review! I added tests to existing test functions.

@mttk mttk merged commit 1644970 into pytorch:master Sep 24, 2018
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.

Try to get the vocab of NestedField but only get '[]'
2 participants