让我们假设我们有一个文件
total_words = 50(例如 -> is,the,now,is,am,here,now) total_unique_words = 40(例如 -> is,the,am,here,now)
我们如何Linear Interpolation/ Laplace Smoothening应用trigram
例如
('he') 计数为 12 ('he', 'is') 计数为 8 ('he','is','here') 计数为 4
('is','here') 计数为 6
('is') 计数为 18 ('here') 计数为 5
我认为这与值的计数有关。我有公式,lambda * P(x_i | x_i-1)但不知道如何在这里实现。有人可以给我一个 如何实现插值的实用示例吗
当我第一次学习时,请在案例中做出任何必要的假设