给定句子: John reads a book, 基于2元文法3元文法
二元文法:
(<BOS>, John)
(John, reads)
(reads, a)
(a, book)
(book, <EOS>)
三元文法:
(<BOS>, John, reads)
(John, reads, a)
(reads, a, book)
(a, book, <EOS>)
给定句子:<BOS>
John reads a book <EOS>
, 基于2元文法求概率
进一步展开就是:
给定汉语:他是研究生物的,采用二元文法写概率
给定拼音串:ta shi yan jiu sheng wu de 基于二元文法算 P(Cstring)

…
给定语料库:
{<BOS>
John reads Moby Dick EOS
}
{<BOS>
Mary reads a different book<EOS>
}
{<BOS>
She reads a book by Cher <EOS>
}
求 John reads a book 的概率
Cher reads a book
加一平滑:
- :
- :
- :
- :
- :