4
$\begingroup$

I have a file that contains words. I have to calculate cosine similarity of each word with every other words. For that I used the following formula in gensim:

  • model.most_similar([word])
  • model.save('text.txt')

I want to save the result of cosine-similarity of each words with respective to other words in such a way that I can used them further in classification and clustering. But don't know how to retrieve the results which are saved using gensim model ?

$\endgroup$

1 Answer 1

1
$\begingroup$

The question is not really clear.

If the question is how can you save and retrieve the cosine-similarity of each word with every other word, then you can save them in an array and use pickle for saving and loading them again.

Or, If the question is how you can retrieve the gensim model, then the function is gensim.models.word2vec.Word2Vec.load()

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.