3

I know that word2vec in gensim can compute similarity between words. But now I want to compute word similarity using TF-IDF or LSA with gensim. How to do it?

note: Computing document similarity using LSA with gensim is easy: http://radimrehurek.com/gensim/wiki.html

hankaixyz
  • 96
  • 1
  • 5

1 Answers1

1

TF-IDF is a weighting scheme so it's not an alternative to LSA.

Imagine your problem as a matrix of "m" terms by "n" documents. Each entry Aij of your matrix represents the weight of term "i" in document "j". This is where you use TF-IDF. To know what to put in each cell of the matrix.

Then if it suits your application you can reduce the dimensions of the matrix using LSA.

I hope this clears a little the issue.

backtrack
  • 7,996
  • 5
  • 52
  • 99