0

In gensim's word2vec python, I want to get the list of cosine similarity for "price".

I read the document of gensim word2vec, but document it describes most_similar and n_similarity function)()

I want the whole list of similarity between price and all others.

gojomo
  • 52,260
  • 14
  • 86
  • 115
NORU
  • 15
  • 4
  • 1
    do you want to find all words that are similar to the word "price" or what do you want? – eugen Sep 17 '19 at 08:04
  • @eugen, yes! find all words that similar to "price", in detail the rank up to 30,000 words. – NORU Sep 17 '19 at 10:19
  • @NORU maybe you want to check out this answer? https://stackoverflow.com/questions/37818426/get-most-similar-words-given-the-vector-of-the-word-not-the-word-itself – lahsuk Sep 17 '19 at 11:02
  • @lahsuk, Thanks lahsuk! it was lazy and silly question. It's ashamed... [similar_by_vector] was what I want to find! Thanks again. – NORU Sep 17 '19 at 11:38

1 Answers1

0

If you call wv.most_similar('price', topn=len(wv)), with a topn argument of the full vocabulary count of your model, you'll get back a ranked list of every word's similarity to 'price'.

If you call with topn=0, you'll get the raw similarities with all model words, unsorted (in the order the words appear inside wv.index2entity).

gojomo
  • 52,260
  • 14
  • 86
  • 115