nlp - 有人能解释一下句子开头的单词的概率是如何计算的吗?
问题描述
大家好,我正在尝试计算“我想要中国菜”这句话的概率,我成功了,但这只是因为 P(I|) 已经在桌子底下注明了自己。我似乎无法理解 0.25 是如何计算的。有人可以将我推向正确的方向吗?谢谢!
解决方案
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.
推荐阅读
- datetime - Pyspark 通过列表理解从日期时间获取时间属性
- javascript - 如何从此 JSON 创建图表?
- python-3.x - 绘制 Seaborn 情节并添加图例
- python-2.7 - 添加将字典附加到另一个 multiprocessing.managers.DictProxy 中的列表
- c# - VSIX ErrorListProvider 任务列表为空
- snowflake-cloud-data-platform - 有没有办法找出雪花查询正在访问的表?
- node.js - AWS Lambda 函数不会从 Cognito PostConfirmation 事件触发,但它在测试中有效
- c - 如何从连接的二进制文件中分割出一个二进制文件
- javascript - GET XMLHttpRequest 在就绪状态 4 和状态 0 处停止
- c++ - 使用-xipo -xO4构建时发生c ++崩溃