Closed tmmsagheer closed 3 years ago
Hi @tmmsagheer — thank you for your contribution, but I'm afraid this not a bug. This is deliberate.
I cannot change the code or library version in a physical, printed book, so we had to freeze the library versions in time. As specified in the Dockerfile for this repository by gensim==3.4.0
, we have fixed the Gensim library at 3.4.0 in the book and in this repo indefinitely.
In section Run Word2Vec of notebook natural_language_preprocessing.ipynb
model = Word2Vec(sentences=clean_sents, size=64, sg=1, window=10, iter=5, min_count=10, workers=4)
is given, instead it should bemodel = Word2Vec(sentences=clean_sents, vector_size=64, sg=1, window=10, epochs=5, min_count=10, workers=4)
model.wv.vocab
should be replaced withmodel.wv.vectors
model.wv.vocab.keys
should be replaced withmodel.wv.index_to_key
I believe the author used Gensim 3.x and the latest Gensim is 4.x