-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Accesing vector model vocabulary broken in Gensim 3.3 when loading from word2vec format #1882
Comments
@akutuzov thanks for the report! Sorry for this, we did not plan anything to break (but this happens :( ). CC: @manneshiva |
Hi @akutuzov, |
@manneshiva thanks! |
@akutuzov exactly |
…iskvorky#1882 (piskvorky#1884) * adds test for `wv` property * adds `wv` property to KeyedVectors class
If
I use Gensim 3.4.0 both for training and for loading the models. The funny thing is that if the same model is saved in word2vec format and loaded via |
what if i want to update the model loaded with syntax (gensim.models.KeyedVectors.load_word2vec_format) by new sentences model.build_vocab(more_sentences, update=True) |
@akutuzov Sounds like a (nasty) bug to me. Can you replicate this in 3.5.0? @menshikh-iv if the bug is still there, should we re-open this issue? @rachhitgarg see the documentation under https://radimrehurek.com/gensim/models/word2vec.html#usage-examples |
@piskvorky Yes, nothing has changed in 3.5.0 in this respect. The bug is still reproduced: for some weird reason |
Thanks @akutuzov . @menshikh-iv I'm re-opening this ticket, this sounds serious to critical. Do we have a unit test for testing load-after-save? |
@rachhitgarg please stop post this to unrelated issues, I asnwered you #1994 (comment) |
@piskvorky yes, many different, just Ctrl+F |
After upgrading to 3.3.0, it is now impossible to get the model's vocabulary with
model.wv.vocab
method, if the model is loaded from a text or binary word2vec file. However, it works for models saved in the Gensim native format.I suppose it is related to re-designing vector models implementations in #1777. Anyway, it is not good to break compatibility in this way, without even notifying users.
Steps/ to Reproduce
Expected Results
True
orFalse
, as it is in Gensim 3.2Actual Results
Versions
The text was updated successfully, but these errors were encountered: