How to get vector for a sentence from the word2vec of tokens in sentence

后端 未结 9 1889
鱼传尺愫
鱼传尺愫 2020-12-02 04:18

I have generated the vectors for a list of tokens from a large document using word2vec. Given a sentence, is it possible to get the vector of the sentence from the vector of

9条回答
  •  我在风中等你
    2020-12-02 04:33

    There are differet methods to get the sentence vectors :

    1. Doc2Vec : you can train your dataset using Doc2Vec and then use the sentence vectors.
    2. Average of Word2Vec vectors : You can just take the average of all the word vectors in a sentence. This average vector will represent your sentence vector.
    3. Average of Word2Vec vectors with TF-IDF : this is one of the best approach which I will recommend. Just take the word vectors and multiply it with their TF-IDF scores. Just take the average and it will represent your sentence vector.

提交回复
热议问题