What does a weighted word embedding mean?

蓝咒 提交于 2019-12-03 00:08:14

Averaging (possibly weighted) of word embeddings makes sense, though depending on the main algorithm and the training data this sentence representation may not be the best. The intuition is the following:

  • You might want to handle sentences of different length, hence the averaging (better than plain sum).
  • Some words in a sentence are usually much more valuable than others. TF-IDF is the simplest measure of the word value. Note that the scale of the result doesn't change.

See also this paper by Kenter et al. There is a nice post that performs the comparison of these two approaches in different algorithms, and concludes that none is significantly better than the other: some algorithms favor simple averaging, some algorithms perform better with TF-IDF weighting.

In this article or this one, we use weighted sums, idf weighting and Part-of-speech weighting and a mixed method which use both. The mixed method is the best and help us to be first in the SemEval 2017 similarity task for english-spanish and for arabic-arabic (actually we were officially second for arabic because we did not send the mixed method for some reasons).

It is very easy to implement and to use, you have formula in the article but in a nutshell, the vector of a sentence is simply V = sum_i^k=1 Posweight(w_i) * IDFWeight(w_i) * V_i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!