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
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
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.