Moses 里的参数(未完成)

本文详细介绍了Moses机器翻译系统的参数设置方法及调整建议。包括权重调整、加速翻译的方法如限制短语翻译选项数量和减小假设堆栈大小,以及如何通过限制重排序来提升翻译质量和速度。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

首先是权重:

[weight]
WordPenalty0= 0
LM= 1
Distortion0= 1
PhraseDictionaryMemory0= 1

调整方法是可以通过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 2

想要使用的话,需要在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亲自回复给我的,流下泪水,恨不得投身于机器翻译事业创造价值。

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

也可以减少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:

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.

转载于:https://www.cnblogs.com/hitnoah/p/3935200.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值