I am using the following python code to generate similarity matrix of word vectors (My vocabulary size is 77).
similarity_matrix = []
index = gensim.similarities.MatrixSimilarity(gensim.matutils.Dense2Corpus(model.wv.syn0))
for sims in index:
similarity_matrix.append(sims)
similarity_array = np.array(similarity_matrix)
The dimensionality of the similarity_array is 300 X 300. However as I understand the dimensionality should be 77 x 77 (as my vocabulary size is 77).
i.e.,
word1, word2, ......, word77
word1 0.2, 0.8, ..., 0.9
word2 0.1, 0.2, ...., 1.0
... ...., ....., ....., ....
word77 0.9, 0.8, ..., 0.1
Please let me know what is wrong in my code.
Moreover, I want to know what is the order of the vocabulary (word1, word2, ..., word77) used to calculate this similarity matrix? Can I obtain this order from model.wv.index2word?
Please help me!