Moses 里的参数(未完成)

老师要求看看Moses里都有什么参数,调整了参数又会对翻译结果有什么影响,先将找到的参数列出来

首先是权重:

[weight]
WordPenalty0=
LM=
Distortion0=
PhraseDictionaryMemory0=

调整方法是可以通过moses.ini手动调(其实我觉得挺好。。。),或者用命令,在另一篇博文里有(过一段摘过来)

-----------------------------------

为了加速翻译的话可以Tuning for Speed,方法有减少搜索空间(可能会导致不可能寻找到最优翻译解)

为了减少搜索空间,可以减少每个短语的翻译选项,通过限制Translation Table Size   ,命令 -ttable-limit 0\1 </> 已经废弃,无法使用 ,

 % echo 'das ist ein kleines haus' | moses -f phrase-model/moses.ini  -v 

想要使用的话,需要在moses.ini里注明 table-limit = ? 例如:

---------------------------------------------

[feature]
KENLM name=LM factor=0 order=3 num-features=1 path=lm/europarl.srilm.gz
Distortion
WordPenalty
UnknownWordPenalty
PhraseDictionaryMemory input-factor=0 output-factor=0 path=phrase-model/phrase-table num-features=1 table-limit=10

而且感动的是,这个方法是Hieu亲自回复给我的,流下泪水,恨不得投身于机器翻译事业创造价值。

Moses 里的参数(未完成)

--------------------------------------------------------------------------------

也可以减少Hypothesis Stack Size的大小,利用 -s

-s 可以改变Hypothesis Stack Size的大小,默认为1000

最后是-beam-threshold (b): threshold for threshold pruning

可以用 -b 0调节

最后的最后还有一个:

Limit on Distortion (Reordering)

The basic reordering model implemented in the decoder is fairly weak. Reordering cost is measured by the number of words skipped when foreign phrases are picked out of order.

Total reordering cost is computed by D(e,f) = - Σi (d_i) where d for each phrase i is defined as d = abs( last word position of previously translated phrase + 1 - first word position of newly translated phrase ).

This is illustrated by the following graph:

Moses 里的参数(未完成)

This reordering model is suitable for local reorderings: they are discouraged, but may occur with sufficient support from the language model. But large-scale reorderings are often arbitrary and effect translation performance negatively.

By limiting reordering, we can not only speed up the decoder, often translation performance is increased. Reordering can be limited to a maximum number of words skipped (maximum d) with the switch -distortion-limit, or short -dl.

Setting this parameter to 0 means monotone translation (no reordering). If you want to allow unlimited reordering, use the value -1.

上一篇:cocostudio——js 3 final控件事件


下一篇:利用js对象的特性,去掉数组中的重复项