Reputation: 39
I am trying to implement word2vec within nlpaug library and the following code :
aug = naw.WordEmbsAug(
model_type='word2vec', model_path='GoogleNews-vectors-negative300.bin',
action="insert")
gives me error of :
Word2VecKeyedVectors' object has no attribute 'index_to_key'
How can i fix such an issue ?
Upvotes: 2
Views: 6338
Reputation: 31
I was running into this with gensim version 3.6, an upgrade to version 4.2 solved the problem.
Upvotes: 1
Reputation: 91
This is probably related to the version of gensim you use. You can print the version with:
import gensim
print(gensim.__version__)
Upvotes: 3