作者:游泳 | 来源:互联网 | 2023-09-14 20:38
Iwasworkingwithmosesserver0.91andeverythingworksfinebutnowthereisversion1.0andnothi
I was working with mosesserver 0.91 and everything works fine but now there is version 1.0 and nothing is same as before.
我使用的是mosesserver 0.91,一切正常,但现在有1.0版本,没有任何东西和以前一样。
Here is my situation:
这是我的情况:
I want to have multi language translation from arabic to english and from english to arabic. All data and configuration file I have works with 0.91 version of mosesserver. Here is my config file:
我想要从阿拉伯语翻译成英语,从英语翻译成阿拉伯语。我拥有的所有数据和配置文件都适用于0.91版本的mosesserver。这是我的配置文件:
-------------------------------------------------
#########################
### MOSES CONFIG FILE ###
#########################
# D - decoding path, R - reordering model, L - language model
[translation-systems]
ar-en D 0 R 0 L 0
en-ar D 1 R 1 L 1
# input factors
[input-factors]
0
# mapping steps
[mapping]
0 T 0
1 T 1
# translation tables: table type (hierarchical(0), textual (0), binary (1)), source-factors, target-factors, number of scores, file
# OLD FORMAT is still handled for back-compatibility
# OLD FORMAT translation tables: source-factors, target-factors, number of scores, file
# OLD FORMAT a binary table type (1) is assumed
[ttable-file]
1 0 0 5 /mnt/models/ar-en/phrase-table/phrase-table
1 0 0 5 /mnt/models/en-ar/phrase-table/phrase-table
# no generation models, no generation-file section
# language models: type(srilm/irstlm), factors, order, file
[lmodel-file]
1 0 5 /mnt/models/ar-en/language-model/en.qblm.mm
1 0 5 /mnt/models/en-ar/language-model/ar.lm.d1.blm.mm
# limit on how many phrase translations e for each phrase f are loaded
# 0 = all elements loaded
[ttable-limit]
20
# distortion (reordering) files
[distortion-file]
0-0 wbe-msd-bidirectional-fe-allff 6 /mnt/models/ar-en/reordering-table/reordering-table.wbe-msd-bidirectional-fe.gz
0-0 wbe-msd-bidirectional-fe-allff 6 /mnt/models/en-ar/reordering-model/reordering-table.wbe-msd-bidirectional-fe.gz
# distortion (reordering) weight
[weight-d]
0.3
0.3
# lexicalised distortion weights
[weight-lr]
0.3
0.3
0.3
0.3
0.3
0.3
0.3
0.3
0.3
0.3
0.3
0.3
# language model weights
[weight-l]
0.5000
0.5000
# translation model weights
[weight-t]
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
# no generation models, no weight-generation section
# word penalty
[weight-w]
-1
-1
[distortion-limit]
12
---------------------------------------------------------
So please can someone help me and rewrite this config file so it can work in version 1.0. And i need some python sample code of translation. I am using xmlrpc in python and earler I sent http request with:
因此,请有人帮助我重写这个配置文件,以便它能在1.0版本中工作。我需要一些python的翻译示例代码。我正在使用python中的xmlrpc,以及发送http请求的earler:
import xmlrpclib
client = xmlrpclib.ServerProxy('http://localhost:8080')
client.translate({'text': 'some text', 'system': 'en-ar'})
but now seems there is no more 'system' parameter and moses use always default settings.
但是现在似乎没有更多的“系统”参数,而moses总是使用默认设置。
1 个解决方案