3
$\begingroup$

How can I use the vectors of words in a sentence to get the vector of that sentence . I have used strategies like - Averaging the individual word vectors or a tf-idf weighted combination of the words . While these hacks work , there are obvious problems with these . Wanted to know what would be some other way to do this

$\endgroup$
3
$\begingroup$

In this paper a state of the art method (unsupervised smoothed inverse frequency) is described, you can find an implementation of this method here.

$\endgroup$
1
$\begingroup$

There is doc2vec algorithm which is modification of word2vec - by the same authors, paper: https://arxiv.org/pdf/1405.4053v2.pdf

And it's implemented e.g. in gensim https://radimrehurek.com/gensim/models/doc2vec.html

$\endgroup$
1
$\begingroup$

The methods mentioned in other answers work well only for large sentences as they do not preserve sentence structure. The state of the art model for learning compositionality of entire sentence using word vectors is a Recursive Neural Network. This also preserves the order of the word and can hence be used for shorter sentences also. You can see more about them in the original paper or a lecture on the same. For a tensorflow implementation of Recursive Neural Networks look here.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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