Sentence Representation句子表示

1.one-hot编码

Greedy NLP Learning Notes(三)单词表示one-hot与tf-idf
基于boolean的单词表示

Greedy NLP Learning Notes(三)单词表示one-hot与tf-idf
基于boolean的句子表示

Greedy NLP Learning Notes(三)单词表示one-hot与tf-idf
基于count的句子表示

2.Sentence Similarity句子的相似性

欧氏距离

Greedy NLP Learning Notes(三)单词表示one-hot与tf-idf
欧式距离

欧式距离的缺点:

  • 没有考虑方向
  • 每一维的贡献是相同的

余弦相似度

Greedy NLP Learning Notes(三)单词表示one-hot与tf-idf
余弦相似度

3.count-based representation的缺点

Greedy NLP Learning Notes(三)单词表示one-hot与tf-idf
image.png

Greedy NLP Learning Notes(三)单词表示one-hot与tf-idf
并不是出现越多,就越重要

4.one-hot编码可以衡量单词之间的语义吗?

one-hot编码下欧式距离与余弦距离均无法衡量单词之间的语义


Greedy NLP Learning Notes(三)单词表示one-hot与tf-idf
评估单词之间的语义

另外,当词典过大时,one-hot编码导致词向量过于稀疏,计算时产生维度灾难。

5.tf-idf编码

Greedy NLP Learning Notes(三)单词表示one-hot与tf-idf
tf-idf公式

tf-idf核心思想
一个词在词典中出现越多,并且在众多文档中出现越少则越重要(在本文档中具有独特性)。
Greedy NLP Learning Notes(三)单词表示one-hot与tf-idf
tf-idf示例

相关文章: