Simon,
I'm assuming a "two way" translation system involves two translation models - one forward translation model (EN-ES) and one reverse translation model (ES-EN). Barry's reference (below) points to a support list posting that using mosesserver with the --xml-input flag limits mosesserver to only one translation model. So, if you do not use the --xml-input flag, you should be able to use mosesserver with two translation models. If you need to use the --xml-input flag in a server environment with more than one translation model, you'll have to wrap your own server. I don't know the syntax for configuring two translation models on one server or addressing the different translation models on one server from the xmlrpc client. Tom -------- Original Message -------- Subject: Re: [Moses-support] can't find moses translation result from java app Date: Mon, 16 Jan 2012 09:46:25 +0000 From: Barry Haddow To: [email protected] Cc: Tom Hoar > > I also believe here was a report a while back that the --xml-input flag > with mosesserver has some limits. Is this still true? > I think this is what Tom is referring too. http://permalink.gmane.org/gmane.comp.nlp.moses.user/4801 So mosesserver is ok with xml-input (properly escaped) but only if you use a single translation system in the server, cheers - Barry -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ Moses-support mailing list [email protected] http://mailman.mit.edu/mailman/listinfo/moses-support On Tue, 17 Jan 2012 06:09:46 -0800 (PST), Simon h s wrote: Thank you very much Marwen, Tom & Barry! This has been a great help. :) Few more questions though, I'm planning to make two ways translation system, and after reading this http://www.statmt.org/moses/?n=Moses.AdvancedFeatures#ntoc21 [1] I believe it can be done by changing the configuration in the moses.ini and send the system parameter in the xml-rpc, right? But what is the syntax to do it? I'm actually feeling bad wasting your time answering my trivial question. Is there any documentation regarding how to use the moses server that I can use? Thanks -- Simon H S ------------------------- FROM: Tom Hoar TO: Marwen AZOUZI ; Moses support ; Simon h s SENT: Monday, 16 January 2012, 7:50 SUBJECT: Re: [Moses-support] can't find moses translation result from java app Excellent Marwen. Thank you. Simon, be aware that your xmlrpc client is responsible for pre-processing the text before sending to mosesserver via xmlrpc, and for post-processing (detokenize/recase) the results. Also, depending on the nature of your text, you may need change your pre-and post-processing routines. For example, you'll need to escape xml-style placeables before sending them via xmlrpc. In these cases, you'll also need to re-train your translation model with a corpus prepared in the same manner. I also believe here was a report a while back that the --xml-input flag with mosesserver has some limits. Is this still true? Tom On Sun, 15 Jan 2012 22:18:56 +0100, Marwen AZOUZI wrote: > Hi Simon, > > Here's a Java sample client > > https://github.com/moses-smt/mosesdecoder/blob/master/contrib/server/SampleClient.java [3] > > Marwen. > > Le 15/01/2012 21:28, Barry Haddow a écrit : >> Hi Simon >> >> The moses server actually uses xmlrpc, which should be simpler. You can use >> (eg) the apache xmlrpc library. The translation operation is called >> 'translate' and the text is sent and returned in a parameter named 'text'. >> >> cheers - Barry >> >> On Sunday 15 Jan 2012 05:51:15 Simon h s wrote: >>> Dear Barry, >>> >>> I'm interested in the approach. I've looked at the perl example and it >>> seems like it uses soap? Is there any wsdl file that comes with it? >>> >>> Thanks, >>> >>> -- >>> Simon H S >>> >>> >>> >>> ________________________________ >>> From: Barry Haddow >>> To: [email protected] [5]; Simon h s >>> Sent: Thursday, 12 January 2012, 21:20 >>> Subject: Re: [Moses-support] can't find moses translation result from java >>> app >>> >>> Hi Simon >>> >>> You could use the mose server. I've used this with a Java client >>> >>> http://www.statmt.org/moses/?n=Moses.AdvancedFeatures#ntoc20 [7] >>> >>> cheers - Barry >>> >>> On Thursday 12 January 2012 13:42:36 Simon h s wrote: >>>> Thank you for your reply, >>>> >>>> This explains why the code worked with grep command but not with >>>> moses. But is there any workaround that still uses moses command >>>> line? To be honest, I have very minimal experience with c and no >>>> experience at all using JNI. So if there are other alternatives I >>>> would be very grateful. :) >>>> >>>> Thank you very much >>>> >>>> >>>> -- >>>> Simon H S >>>> >>>> >>>> >>>> ________________________________ >>>> From: Hieu Hoang >>>> To: [email protected] [9] >>>> Sent: Thursday, 12 January 2012, 10:44 >>>> Subject: Re: [Moses-support] can't find moses translation result from >>>> java app >>>> >>>> >>>> are you calling the moses command line program? the output >>>> Created input-output object : >>>> means it's waiting for an input sentence, you won't get any >>>> translation from the decoder until then. >>>> >>>> another approach is to use the moses library directly, rather than >>>> the command line version. You have to write c-based wrapper for the >>>> c++-based library, then call them via JNI. >>>> >>>> this was done in the iphone app >>>> >>>> >>>> >>>> https://github.com/moses-smt/mosesdecoder/blob/hieu_iphone/Classes/CFunct [10] >>>> i ons.cpp >>>> >>>> On 11/01/2012 04:53, Simon wrote: >>>> Dear all, >>>> >>>>> I'm trying to call moses from inside java application, but after >>>> running the Runtime.exec, I can't retrieve the translation result >>>> using getInputStream method or the getErrorStream. >>>> >>>>> I'm pretty certain that the moses has produced some translation, >>>> because in the error stream I can read something like: >>>>> ... >>>>> ERR>Finished loading phrase tables : [0.000] seconds >>>>> ERR>IO from STDOUT/STDIN >>>>> ERR>Created input-output object : [0.000] seconds >>>>> ... >>>>> >>>>> but as I said before, I can't find the translation result when >>>> running the moses from inside the Java application. Running it >>>> directly from shell works fine. >>>> >>>>> Can anyone help? the code I'm using and the full result of error >>>> stream is in this pastebin: >>>>> http://pastebin.com/Z7Y3NsTU [11] >>>>> >>>>> Thanks in advance, >>>>> >>>>> -- >>>>> Simon H S >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>> Moses-support mailing list [email protected] [12] >>>> http://mailman.mit.edu/mailman/listinfo/moses-support [13] >>>> _______________________________________________ >>>> Moses-support mailing list >>>> [email protected] [14] >>>> http://mailman.mit.edu/mailman/listinfo/moses-support [15] >>> -- >>> Barry Haddow >>> University of Edinburgh >>> +44 (0) 131 651 3173 >>> >> _______________________________________________ >> Moses-support mailing list >> [email protected] [16] >> http://mailman.mit.edu/mailman/listinfo/moses-support [17] > > _______________________________________________ > Moses-support mailing list > [email protected] [18] > http://mailman.mit.edu/mailman/listinfo/moses-support [19] Links: ------ [1] http://www.statmt.org/moses/?n=Moses.AdvancedFeatures#ntoc21 [2] mailto:[email protected] [3] https://github.com/moses-smt/mosesdecoder/blob/master/contrib/server/SampleClient.java [4] mailto:[email protected] [5] mailto:[email protected] [6] mailto:[email protected] [7] http://www.statmt.org/moses/?n=Moses.AdvancedFeatures#ntoc20 [8] mailto:[email protected] [9] mailto:[email protected] [10] https://github.com/moses-smt/mosesdecoder/blob/hieu_iphone/Classes/CFunct [11] http://pastebin.com/Z7Y3NsTU [12] mailto:[email protected] [13] http://mailman.mit.edu/mailman/listinfo/moses-support [14] mailto:[email protected] [15] http://mailman.mit.edu/mailman/listinfo/moses-support [16] mailto:[email protected] [17] http://mailman.mit.edu/mailman/listinfo/moses-support [18] mailto:[email protected] [19] http://mailman.mit.edu/mailman/listinfo/moses-support
_______________________________________________ Moses-support mailing list [email protected] http://mailman.mit.edu/mailman/listinfo/moses-support
