0
votes

How do you use the Gensim predict output word function?

model = KeyedVectors.load_word2vec_format('./GoogleNews-vectors-negative300.bin', binary=True)

model.predict_output_word(['Hi', 'how', 'you'], topn=10)

AttributeError: 'Word2VecKeyedVectors' object has no attribute 'predict_output_word'

I tried Word2Vec.load_word2vec_format('./GoogleNews-vectors-negative300.bin', binary=True), which was deprecated as well.

1

1 Answers

3
votes

A file like GoogleNews-vectors-negative300.bin only contains the word vectors, not the complete model used for training. So it is not possible to use predict_output_word in this case. If you would have trained a full model yourself and saved it with model.save(), then the method predict_output_word would be available.