首页 > 解决方案 > 有人能解释一下句子开头的单词的概率是如何计算的吗?

问题描述

在此处输入图像描述

大家好,我正在尝试计算“我想要中国菜”这句话的概率,我成功了,但这只是因为 P(I|) 已经在桌子底下注明了自己。我似乎无法理解 0.25 是如何计算的。有人可以将我推向正确的方向吗?谢谢!

标签: nlpn-gram

解决方案


Normally, you would have a dummy character for the beginning and end of a sentence, and you use that bigram to calculate the probability. I notice they are using <s>, as shown in the formula under the tables.

In the table itself this is omitted, so you cannot get it from there alone.

The sentence end is marked with </s>, so the probability that food is the final word in a sentence is 0.68 — though in a typical sentence that would be a full stop.


推荐阅读