Thanks, I wrote a Python XMLRPC Server which basically parses the n-best-file. It's also not API based since I realized, that I don't need to build the whole decoder pipeline.
Unfortunately, to reconstruct the XML tags via alignment information isn't trivial. I had a look at web/translate.cgi but I thought I could do it in a nice, and more simple way. I will keep trying. Thanks Achim, I will have a look maybe I can get an idea since XLIFF is an XML extension. Regards, Andreas On Wed, Mar 2, 2011 at 3:44 PM, Achim Ruopp <[email protected]> wrote: > Hi Andreas, > As for your goal to reinsert markup with the alignment information: we are > working on this in the M4Loc project http://code.google.com/p/m4loc/, based > on the standard XLIFF file format (i.e. it is not API based, but can > probably be adapted). We should have a Beta version out next week (fingers > crossed). > > If you are looking at HTML specifically you can also check out the code in > the Moses web interface (code in folder /web in the Moses source). > > Achim > > -----Original Message----- > From: [email protected] [mailto:[email protected]] > On Behalf Of Barry Haddow > Sent: Wednesday, March 02, 2011 6:31 AM > To: [email protected] > Cc: Andreas Kull > Subject: Re: [Moses-support] XMLRPC-C real alignment for tag reconstruction > > Hi Andreas > > The code for writing the word alignment is in IOWrapper.cpp, the function > OutputAlignment(). The OutputCollectors are simply used to make sure the > output is written in the correct order when using multiple threads. > > The moses server already has an option for returning the phrase alignment. > If > you look at mosesserver.cpp, in Translator::execute(), you can see how it > deals with the align flag. > > To get the word alignment from the moses server, it should just be a matter > of > accessing the alignments as in OutputAlignment(), and writing them into the > xmlrpc return object, using a suitable data structure, > > best regards - Barry > > On Tuesday 01 March 2011 10:31, Andreas Kull wrote: >> Hi, >> >> I want to modify mosesserver.cpp so that it sends the phrase and word >> alignment information, i.e.: >> >> 8 ||| this is a test ||| d: 0 -0.0427415 0 0 -0.0140452 0 0 lm: >> -22.709 w: -4 tm: -3.52722 -6.8957 -1.49922 -3.4347 1.99979 ||| >> -10.0429 ||| 0-2=0-2 3=3 ||| 0-0 1-1 2-2 3-3 >> >> >> 0-2=0-2 3=3 ||| 0-0 1-1 2-2 3-3 >> >> Unfortunately, I'm a bit lost in code. Could you give me a hint which >> class/function I need to call to retrieve this information? Is it even >> possible? >> >> I looked at moses/src/main.cpp and it seems that this information is >> stored in an OutputCollector, correct? Which function is used to write >> the two last segments (phrase/word alignment)? >> >> My goal is to reinsert inline XML tags with the alignment information, > e.g. >> >> User input: <b> this is </b> a test => Internal datastructure: <b> : >> 0-1 => Moses input: this is a test => User output: <b> das ist </b> >> ein test >> >> >> Regards, >> Andreas >> >> _______________________________________________ >> Moses-support mailing list >> [email protected] >> http://mailman.mit.edu/mailman/listinfo/moses-support > > -- > 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 > > _______________________________________________ Moses-support mailing list [email protected] http://mailman.mit.edu/mailman/listinfo/moses-support
