首页 > 试题广场 >

N-gram是一种简单有效的统计语言模型,通常n采用1-3之

[单选题]
N-gram是一种简单有效的统计语言模型,通常n采用1-3之间的值,它们分别称为unigram、bigram和trigram。现有给定训练语料合计三个文档如下:
D1: John read Moby Dick
D2: Mary read a different book,
D3: She read a book by Cher
利用bigram求出句子“John read a book”的概率大约是(      )
  • 1
  • 0.06
  • 0.09
  • 0.0008
2-gram公式
P(s1,s2,s3...) = P(s1)*P(s2|s1)*P(s3|s2).....

解:
john在文章开头的概率:P(john) = 1/3
P(read | John) = 1
P(a|read) = 2/3
P(book|a) = 1/2
P(尾巴|book) = 1/2, book出现两次,其中一次是在句子结尾处
P("John read a book") = 1/3 * 1 * 2/3 * 1/2 * 1/2 = 1/18 ≈ 0.06,故选择B
发表于 2019-08-30 18:44:26 回复(2)
unigram,bigram,trigram,是自然语言处理(NLP)中的问题。父词条:n-gram.
unigram: 单个word
bigram: 双word
trigram:3 word
比如:
西安交通大学:
unigram 形式为:西/安/交/通/大/学
bigram形式为: 西安/安交/交通/通大/大学
trigram形式为:西安交/安交通/交通大/通大学
(来源百度百科)
发表于 2019-08-15 16:45:17 回复(0)
发表于 2019-08-15 17:08:05 回复(4)
bigram的语言模型:P(w1w2w3...wn)=P(w1)P(w2|w1)P(w3|w2)...P(wn|wn-1)
                                 P(wn|wn-1)=count(wn,wn-1)/count(wn-1)

发表于 2018-12-26 13:41:32 回复(0)
我咋没懂题目的意思呢
发表于 2020-08-16 17:08:46 回复(0)
<p>词袋模型的极大似然估计</p>
发表于 2020-06-10 15:42:39 回复(0)
book作为结尾的概率是1/2
发表于 2020-05-05 23:18:31 回复(0)