-1

I created training data using word2vec.

I used 'wv.similarity' to find the cosine similarity between word1 and word2.

I want to find the cosine similarity between all words(like a correlation table) in a list, but I don't know how.

[word1, word2, word3, word4, ........]

Please help me!

1 Answers1

1

Each word has some id. Use a double for loop over the ids. And calculate the cos-similarity.

table[id1][id2]=cos-sim(word1,word2)
Sven Eberth
  • 3,057
  • 12
  • 24
  • 29
Routerdieb
  • 39
  • 5