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

Update to gensim 4.0 #6

Open
combedhadgehog opened this issue Jun 5, 2021 · 0 comments
Open

Update to gensim 4.0 #6

combedhadgehog opened this issue Jun 5, 2021 · 0 comments

Comments

@combedhadgehog
Copy link

Some adoptations are needed to run under new version of gensim:
1)
from word2vec.Word2Vec.load_word2vec_format
to KeyedVectors.load_word2vec_format
2)
from model.vocab and model.vocab.keys()
to model.index_to_key
3)
from model.vocab[w].index
to model.key_to_index[w]
4)
from model.syn0 = np.delete(model.syn0, indices_to_delete, axis=0)
to model.index_to_key = np.delete(model.index_to_key, indices_to_delete, axis=0)
model.vectors = np.delete(model.vectors, indices_to_delete, axis=0)
5)
from word2vec.Word2Vec.load_word2vec_format
to KeyedVectors.load_word2vec_format

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

No branches or pull requests

1 participant