I have check the previous post link but it doesn't seems to work for my case:-
I have pre trained word2vec model:
import gensim
model = Word2Vec.load('w2v_model')
Now I have a pandas dataframe with keywords:
keyword
corruption
people
budget
cambodia
.......
......
All I want to add the vectors for each keyword in its corresponding columns but
when I use model['cambodia']
it throw me error as KeyError: "word 'cambodia' not in vocabulary"
so I have update the keyword as:
model.train(['cambodia'])
But this won't work out for me, when I use
model['cambodia']
it still giving an error as KeyError: "word 'cambodia' not in vocabulary"
. How to update new words into word2vec vocabulary so i can get its vectors? Expected output will be:-
keyword V1 V2 V3 V4 V5 V6
corruption 0.07397 0.290874 -0.170812 0.085428 -0.148551 0.38846
people ..............................................................
budget ...........................................................