I am using gensim word2vec package in python with the following code:
model = Word2Vec(window = 10, sg = 1, hs = 0,
negative = 10, # for negative sampling
alpha=0.03, min_alpha=0.0007,
seed = 14)
model.build_vocab(purchases_train, progress_per=200)
model.train(purchases_train, total_examples = model.corpus_count,
epochs=10, report_delay=1)
model.init_sims(replace=True)
X = model[model.wv.vocab]
And an error occurs: AttributeError: The vocab attribute was removed from KeyedVector in Gensim 4.0.0.
How should I modify the code X = model[model.wv.vocab] to make it eligible for Gensim 4.0.0.?