moses-smt / mosesdecoder

Moses, the machine translation system
http://www.statmt.org/moses
GNU Lesser General Public License v2.1
1.58k stars 777 forks source link

mosesserver -xml-input exclusive #73

Closed lsgrep closed 10 years ago

lsgrep commented 10 years ago

Hi , I am running a mosesserver with a -xml-input flag. I tried various options but it is not working for me.

Translation took 0 seconds
Output: 我
Input: ئىسمىڭ نىمە
Translating: <s> ئىسمىڭ نىمە </s>  ||| [0,0]=X (1) [0,1]=X (1) [0,2]=X (1) [0,3]=X (1) [1,1]=X (1) [1,2]=X (1) [1,3]=X (1) [2,2]=X (1) [2,3]=X (1) [3,3]=X (1)

  0   1   2   3
  1   2  20   0
    2  50   0
     32   0
        1
Translation took 0 seconds
Output: 叫 什么 。
Input: <np translation="哈哈">مەن</np>
[2]    443 segmentation fault (core dumped)  ./mosesserver -xml-input exclusive -f

I deployed moses on a docker container.

#!/usr/bin/env python
# -*- coding: utf-8 -*-

# python port of client.perl

import xmlrpclib
import datetime
import sys

url = "http://172.17.0.3:8080/RPC2"
proxy = xmlrpclib.ServerProxy(url)

text = "ئىسمىڭ نىمە"
if len(sys.argv) > 1:
#    print "source is:", sys.argv[1]
    text=sys.argv[1]

params = {"text":text, "align":"true", "report-all-factors":"true"}

result = proxy.translate(params)
print result['text'].encode('utf-8')
if 'align' in result:
    print "Phrase alignments:"
    aligns = result['align']
    for align in aligns:
        print "%s,%s,%s" %(align['tgt-start'], align['src-start'], align['src-end'])

Here is my command to invoke translation.

./client.py   '我 要 去  <np translation="ئوردا" >学校</np>'

This is giving me a segmentation fault.

I started mosesserver as following command. And it works fine without xml tags. ./mosesserver -xml-input exclusive -f moses.ini

I could not find enough information on moses website.Could you tell me which part could possibly went wrong?

Many thanks.

hieuhoang commented 10 years ago

You should send your questions to the Moses mailing list. There's more people on there. Don't forget to subscribe to it before posting. You can subscribe here http://mailman.mit.edu/mailman/listinfo/moses-support

lsgrep commented 10 years ago

thanks

echo '我 要 去 <xjunlphaha translation="ئوردا">学校</xjunlphaha>' |  /work/mosesdecoder/bin/moses -xml-input exclusive -f /tmp/shared/moses-training/chuy_0826-03:04/model/moses.ini