Hi, Prior to moses server, I used to use netcat too. If your problem is indeed netcat dying before receiving the reply, you can add the -q parameter followed by the number of seconds you want to hold netcat (5-6 seconds should be enough even for long sentences).
However, moses server is far more convenient as indicated by Barry. Regards, Panos Kanavos > From: [email protected] > To: [email protected] > Date: Fri, 10 Dec 2010 12:31:10 +0000 > Subject: Re: [Moses-support] Moses server > > Hi Mehmet > > The daemon.pl is not writing the translation to its output, what you see > there > is just debug messages. The translation is being sent to your client, but > (presumably) the nc command shuts down before the reply is received. > > You need to use (or write) a client which is able to do sending and > receiving. > telnet might do the job here. If you want to write your own, have a look at > RemoteProcess.pm in the web directory. > > An alternative is to use the moses server, which will scale better, and > because it uses xmlrpc you can write a client in almost any programming > language, without having to worry about socket programming. > See: > http://www.statmt.org/moses/?n=Moses.AdvancedFeatures#ntoc20 > > best regards > Barry > > On Friday 10 Dec 2010 12:02:07 Mehmet Tatlıcıoğlu wrote: > > Hi, > > I am working on decoding an input received through a port, and I'd like to > > produce the output and send it to the port. I've followed the instructions > > on the page http://www.statmt.org/moses/?n=Moses.WebTranslation, and I > > managed to setup the server. When I run daemon.pl for a specific port, it > > starts to listen that port appropriately. As it is mentioned on the web > > page, I can send input strings by the command echo "Hello world" | nc > > <hostname> <port>. When I send an input by using this command in an other > > terminal window (still with the same PC), it produces the output, but the > > output is printed on the daemon.pl's window, not to the window where I sent > > input. To clarify the situation, here is my daemon.pl window and i/o > > window: > > > > Console where daemon.pl is running: > > > meh...@mehmet-desktop:~/mosesdecoder/web$ ./bin/daemon.pl localhost 7070 > > > > Defined parameters (per moses.ini or switch): > > > > config: > > > /home/mehmet/projeler/tr-en/trunk/trainings/06-12-2010-0028/tuning/moses. > > >ini > > > > distortion-file: 0-0 wbe-msd-bidirectional-fe-allff 6 > > > > > /home/mehmet/projeler/tr-en/trunk/trainings/06-12-2010-0028/model/binary/ > > >reordering-table.wbe-msd-bidirectional-fe > > > > distortion-limit: 6 > > > > input-factors: 0 > > > > lmodel-file: 1 0 5 /home/mehmet/projeler/tr-en/trunk/lm/tr/ > > > > > tr.qblm.mm > > > > mapping: 0 T 0 > > > > report-segmentation: > > > > ttable-file: 1 0 0 5 > > > > > /home/mehmet/projeler/tr-en/trunk/trainings/06-12-2010-0028/model/binary/ > > >phrase-table > > > > ttable-limit: 20 > > > > weight-d: 0.0297437 0.021298 0.0295493 0.0704284 0.0715931 0.107471 > > > > > 0.0650318 > > > > weight-l: 0.08927 > > > > weight-t: 0.0586011 0.0385914 0.0689658 0.0358147 -0.0226796 > > > > weight-w: -0.290962 > > > > Loading lexical distortion models...have 1 models > > > > Creating lexical reordering... > > > > weights: 0.021 0.030 0.070 0.072 0.107 0.065 > > > > binary file loaded, default OFF_T: -1 > > > > Start loading LanguageModel /home/mehmet/projeler/tr-en/trunk/lm/tr/ > > > > > tr.qblm.mm : [1.000] seconds > > > > In LanguageModelIRST::Load: nGramOrder = 5 > > > > Loading LM file (no MAP) > > > > Qblmt > > > > loadbin() > > > > reading 256 centers > > > > reading 256 centers > > > > reading 256 centers > > > > reading 256 centers > > > > reading 256 centers > > > > mapping 759317 1-grams > > > > mapping 13427632 2-grams > > > > mapping 5488911 3-grams > > > > mapping 4341113 4-grams > > > > mapping 3094047 5-grams > > > > done > > > > OOV code is 759316 > > > > IRST: m_unknownId=759316 > > > > Finished loading LanguageModels : [4.000] seconds > > > > Start loading PhraseTable > > > > > /home/mehmet/projeler/tr-en/trunk/trainings/06-12-2010-0028/model/binary/ > > >phrase-table > > > > > > : [4.000] seconds > > > > filePath: > > > /home/mehmet/projeler/tr-en/trunk/trainings/06-12-2010-0028/model/binary/ > > >phrase-table > > > > Finished loading phrase tables : [4.000] seconds > > > > IO from STDOUT/STDIN > > > > Created input-output object : [4.000] seconds > > > > Translating: hello world > > > > > reading bin ttable > > > > size of OFF_T 8 > > > > binary phrasefile loaded, default OFF_T: -1 > > > > Collecting options took 0.520 seconds > > > > Search took 0.520 seconds > > > > BEST TRANSLATION: merhaba dünya [11] [total=-2.355] <<0.000, -2.000, > > 0.000, > > > > > -1.545, 0.000, 0.000, -0.368, 0.000, 0.000, -27.502, -1.892, -2.774, > > > -0.843, -2.831, 2.000>> > > > > reset caches > > > > Translation took 0.690 seconds > > > > Finished translating > > > > The I/O window: > > > meh...@mehmet-desktop:~$ echo "hello world" | nc localhost 7070 > > > > meh...@mehmet-desktop:~$ > > > > So, the output is produced, but still, I cannot get the produced output > > where I sent the input. How can I make it send output to where it came > > from? > > > > On the other hand, how can I allow the users sharing the same network to > > send input and receive translations through the port 7070, given that I > > have an IP address of 10.0.0.1 in this network? > > > > -- > > Mehmet Tatlıcıoğlu > > Cell Phone: +90 532 201 85 64 > > > > > _______________________________________________ > Moses-support mailing list > [email protected] > http://mailman.mit.edu/mailman/listinfo/moses-support
_______________________________________________ Moses-support mailing list [email protected] http://mailman.mit.edu/mailman/listinfo/moses-support
