【发布时间】:2016-02-21 22:06:33
【问题描述】:
给定:
以及以下内容:
对于:
q(runs | the, dog) = 0.5
这不应该是1吗?
q(runs | the, dog) : xi=runs , xi-2=the , xi-1=dog
概率是(wi 已经换成了 xi):
因此:
count(the dog runs) / count(the dog) = 1 / 1 = 1
但在上面的示例中,该值为 0.5 。 0.5是怎么得出的?
基于http://files.asimihsan.com/courses/nlp-coursera-2013/notes/nlp.html#markov-processes-part-1
【问题讨论】:
-
回答您的第一个问题:不,不应该。 P (runs| the, dog) + P(STOP| the, dog) 应该总和为 1,因为两者具有相同的上下文“狗”。要回答您的第二个问题,您根据哪些训练数据计算计数(狗跑)?
-
@user3639557 "回答你的第一个问题:不,不应该。鉴于两者都有相同的上下文“狗”“当我问到 P (runs| the, dog) = 0.5 当我到达值 1 时,不确定你在这里回答什么问题?训练数据为 V={the,dog,runs} U {STOP} U {*}
-
V={the,dog,runs, STOP, *} 不是训练数据。这是词汇集。您尚未提供训练数据。
-
@user3639557 现在由于您的最后评论,我明白了我的错误。我没有训练集。要得到 0.5,正如我最初问的那样,训练集大约是:x1 = {the , dog, runs} , x2 = {the .狗,走路}
-
如果您打算从事这些工作,最好观看 Michael Collins 在 coursera 上的讲座。他深入介绍了 ngram 语言建模(以及其他一些 nlp 主题),并且很容易关注他:coursera.org/course/nlangp