在我的笔记本电脑(Ubuntu13.04)中成功安装摩西之后,我尝试运行样本模型(Run moses for the first time)。
我wget sample-models.tgz并将其解压缩到该文件夹中。然后运行命令:
~/mosesdecoder/bin/moses -f phrase-model/moses.ini < phrase-model/in > out
它失败并出现以下错误:
[user@my-pc sample-models]$ ~/mosesdecoder/bin/moses -f phrase-model/moses.ini < phrase-model/in > out
Defined parameters (per moses.ini or switch):
config: phrase-model/moses.ini
feature: IRSTLM 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
input-factors: 0
mapping: T 0
n-best-list: nbest.txt 100
weight: WordPenalty0= 0 LM= 1 Distortion0= 1 PhraseDictionaryMemory0= 1
ERROR:Unknown parameter feature
ERROR:Unknown parameter weight
ERROR:No phrase translation table (ttable-file)
这是 phrase-model / moses.ini :
#########################
### MOSES CONFIG FILE ###
#########################
# input factors
[input-factors]
0
# mapping steps, either (T) translation or (G) generation
[mapping]
T 0
[feature]
IRSTLM 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
[weight]
WordPenalty0= 0
LM= 1
Distortion0= 1
PhraseDictionaryMemory0= 1
[n-best-list]
nbest.txt
100
我是 moses 的新手,并且不知道为什么会出现此错误。任何人都可以帮我这个吗?或者告诉我每个args在 moses.ini 中的含义是什么?
答案 0 :(得分:0)
您似乎正在使用最新版本的Moses(v2.1)和Moses v1的配置文件。配置文件(moses.ini)的格式发生了重大变化。您可以使用以下命令转换旧式配置文件:
scripts/training/convert-moses-ini-to-v2.perl < IN > OUT
答案 1 :(得分:0)
实际上我认为你有与Alexandru建议的相反的问题。如果你确实有Moses v2.1,它应该与Moses v1配置文件向后兼容。
因此我认为您必须安装已弃用的Moses 1.0。你必须安装摩西2.1。网站上的sample-models.tgz tarball还包含新格式的配置文件。
从源头安装摩西可能会很痛苦。但是在您的Linux机器上,您应该能够安装以下Debian软件包:http://www.statmt.org/~jie/linux/moses-2.1-1/moses_2.1-1_amd64.deb