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

[MRG] fix for loading old word2vec models #1179

Merged
merged 2 commits into from
Mar 3, 2017

Conversation

jayantj
Copy link
Contributor

@jayantj jayantj commented Mar 3, 2017

Fixes loading Word2Vec models from previous versions.

While loading pre-keyedvector word2vec models, the attributes which belonged to the Word2Vec instance before the change and to the KeyedVector instance after the change, need to be set manually after unpickling the model. These were not being set correctly for models which saved the numpy data in separate files from the model file.
There was a unittest to verify this behaviour explicitly, but the existing model in the test data seems to contain a KeyedVector instance already.

I've updated the test data with a model without a keyedvector instance, and the code for loading models to handle this behaviour correctly.

Fixes #1173 (tested by loading the model linked in the issue and performing a lookup for "bon")

@tmylk tmylk merged commit a458658 into piskvorky:develop Mar 3, 2017
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.

2 participants