word2vec

How to check if a key exists in a word2vec trained model or not

How to check if a key exists in a word2vec trained model or not Question: I have trained a word2vec model using a corpus of documents with Gensim. Once the model is training, I am writing the following piece of code to get the raw feature vector of a word say “view”. myModel[“view”] However, I …

Total answers: 8

Convert word2vec bin file to text

Convert word2vec bin file to text Question: From the word2vec site I can download GoogleNews-vectors-negative300.bin.gz. The .bin file (about 3.4GB) is a binary format not useful to me. Tomas Mikolov assures us that “It should be fairly straightforward to convert the binary format to text format (though that will take more disk space). Check the …

Total answers: 10

How to calculate the sentence similarity using word2vec model of gensim with python

How to calculate the sentence similarity using word2vec model of gensim with python Question: According to the Gensim Word2Vec, I can use the word2vec model in gensim package to calculate the similarity between 2 words. e.g. trained_model.similarity(‘woman’, ‘man’) 0.73723527 However, the word2vec model fails to predict the sentence similarity. I find out the LSI model …

Total answers: 14