I am trying to retrieve the array/vector of a word in my trained word2vec model. In SpaCy this is possible with model.vocab.get_vector("word"), but I can't find a way to do it in word2Vec
From gensim documentation: Initialize a model with e.g.:
from gensim.test.utils import common_texts, get_tmpfile
from gensim.models import Word2Vec
path = get_tmpfile("word2vec.model")
model = Word2Vec(common_texts, size=100, window=5, min_count=1, workers=4)
model.save("word2vec.model")
Now, you can get word vector of for example word
by:
model.wv['word'] # numpy vector of a word (OR: model.word_vec("word"))