nlp - WordVectors How to concatenate word vectors to form sentence vector -
i have learned in essays (tomas mikolov...) better way of forming vector sentence concatenate word-vector.
but due clumsy in mathematics, still not sure details.
for example,
supposing dimension of word vector m, sentence has n words.
what correct result of concatenating operation?
is row vector of 1 x m*n ? or matrix of m x n ?
please advise
thanks
there @ least 3 common ways combine embedding vectors; (a) summing, (b) summing & averaging or (c) concatenating. in case, concatenating, give 1 x m*a
vector, a
number of sentences. in other cases, vector length stays same. see gensim.models.doc2vec.doc2vec
, dm_concat
, dm_mean
- allows use of 3 options [1,2].
[1] http://radimrehurek.com/gensim/models/doc2vec.html#gensim.models.doc2vec.labeledlinesentence
[2] https://github.com/piskvorky/gensim/blob/develop/gensim/models/doc2vec.py
Comments
Post a Comment