1

我正在尝试使用 SRILM 构建语言模型。我有一个短语列表,我使用以下方法创建模型:

./ngram-count -text corpus.txt -order 3 -ukndiscount -interpolate -unk -lm corpus.lm

在此之后,我尝试制作一些示例来查看不同短语的概率,结果发现对数概率为-0.9

问题是训练中有一些词的对数概率较低。例如,有 5 个“abatanuono”,其对数概率为-4.8

我认为这很奇怪,因为一个短语<s> <unk> </s><s> abatantuono </s>在训练集中更有可能出现 3-gram <s> abatantuono </s>

这可以在这里看到:

 % ./ngram -lm corpus.lm -ppl ../../../corpus.txt.test -debug 2 -unk
 reading 52147 1-grams
 reading 316818 2-grams
 reading 91463 3-grams
 abatantuono
     p( abatantuono | <s> )     = [2gram] 1.6643e-05 [ -4.77877 ]
     p( </s> | abatantuono ...)     = [3gram] 0.717486 [ -0.144186 ]
 1 sentences, 1 words, 0 OOVs
 0 zeroprobs, logprob= -4.92296 ppl= 289.386 ppl1= 83744.3

 abatantonno
     p( <unk> | <s> )   = [1gram] 0.00700236 [ -2.15476 ]
     p( </s> | <unk> ...)   = [1gram] 0.112416 [ -0.949172 ]
 1 sentences, 1 words, 0 OOVs
 0 zeroprobs, logprob= -3.10393 ppl= 35.6422 ppl1= 1270.36

 file ../../../corpus.txt.test: 2 sentences, 2 words, 0 OOVs
 0 zeroprobs, logprob= -8.02688 ppl= 101.56 ppl1= 10314.3

你认为问题可能是什么?

谢谢

4

1 回答 1

4

这是 SRILM 的一个标记问题(参见 Kenneth Heafield 的论文- 第 30 页的脚注和他关于 SRILM 的网站注释)。与训练数据中看到的稀有词相比,将质量分配给未知词的方式可以为它们分配更高的概率。你可以看看 KenLM 包,它只实现了修改后的 Kneser-Ney(通常比 Kneser-Ney 平滑执行得更好),但是以防止这种情况发生的方式对未知词进行大量分配。

于 2016-04-02T03:40:13.397 回答