赞
踩
Word representation: a process that transform the symbols to the machine understandable meanings
Compute word similarity
计算词相似度
• WR(Star) ≃ WR(Sun)
• WR(Motel) ≃ WR(Hotel)
Infer word relation
推断词之间的语义关系
• WR(China) − WR(Beijing) ≃ WR(Japan) - WR(Tokyo)
• WR(Man) ≃ WR(King) − WR(Queen) + WR(Woman)
• WR(Swimming) ≃ WR(Walking) − WR(Walk) + WR(Swim
过去怎么表示一个词的词义呢?
By Using set of related words, such as synonyms and hypernyms to represent a word
譬如说我们想表示GOOD这个词
Synonyms of “Good” in WordNet:
(n)good,goodness
(n)commodity,trade_good,good
(s)full,good
(s)adept,expert,good,practiced,proficient,skillful
(s)estimable,good,honorable,respectable
但这种方法存在问题
对于计算机来说, 更好的办法仍然是将一个词表示为一个唯一的符号(向量)
每个词对应的向量都是独一无二的
但这种方法存在问题
核心思想是用词的上下文来表示这个词
e.g. Use context words to represent stars
在Represent Word by Context 的基础上, 仍然对 n 个词的文本创建一个 n 维向量 ,
并且对其他词与词 A 同时出现的次数进行计数( Co-Occurrence Counts ), 写入A的向量中
这样我们能得到一个稠密向量, 对稠密向量之间进行相似度计算是可行的
但这种方法存在问题
运用分布式表达的方法Distributed Representation
尝试用一个低维的空间就将文本全集装载, 然后在这个低维空间中进行相似度运算
语言模型的两个任务
由此引出一个问题 : 如何计算概率?
引入一个假设
Assumption: the probability of an upcoming word is only determined by all its previous words
以此就能将句子的概率拆解为条件概率
e.g.
即对于语言模型来说
一个句子的联合概率 = 每个词相对于整体的条件概率再取积
Collect statistics about how frequent different ngrams are, and use these to predict next word.
例如 , 对于 4-gram, 统计三个词too late to 之后接不同的词的概率
但这种方法存在问题
最简单的例子, 如果以整个互联网的文本去统计, 而每次仅统计两三个词连在一起的概率, 最终统计结果会相当稀疏
e.g.
• The cat is walking in the bedroom
• A dog was running in a room
3-gram 也无法认识到 cat 和 dog 的相似度, walking 和 running 的相似度
A neural language model is a language model based on neural networks to learn distributed representadons of words
求Wt在Context下的条件概率, 可以利用前几个词( 这里取3 )的向量, 拼成一个高维的上下文向量, 再经过非线性转换tanh , 就可以预测下一个词.
整个的匹配过程是通过 神经网络 , 在可调的过程中完成的.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。