Skip to content

[MRG] fix for loading old word2vec models#1179

Merged
tmylk merged 2 commits into
piskvorky:developfrom
jayantj:word2vec_load_bugfix
Mar 3, 2017
Merged

[MRG] fix for loading old word2vec models#1179
tmylk merged 2 commits into
piskvorky:developfrom
jayantj:word2vec_load_bugfix

Conversation

@jayantj
Copy link
Copy Markdown
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