Hi, take a look at the WIPO branch of Moses. We have something very similar, but thread-safe. You can specify weights and other moses parameters by using <specOpt switches="-lm 0.5 -tm 2 -v 2"> anywhere in a sentence. The weights specified in one sentence do not affect the translation of another sentence.
Best, Marcin On 05.04.2012 17:54, Prashant Mathur wrote: > Hi all, > > We are trying to update feature weights dynamically during decoding. We > are doing this by adding additional lines of input, delimited with a > special token to tell Moses to update weights. > > For example, > ---- > First sentence. > @CMD@ weight-l=0.5 > Change the LM weight for this sentence. > ---- > While debugging our new code, we noticed that several lines of the input > were read before being translated. > > For instance, this is the input file: > sentence0 > @CMD@ weight-l=0.5 > sentence1 > @CMD@ weight-l=0.3 > sentence2 > > Whenever a @CMD@ line is read, we execute the corresponding command to > change the weights. So we would expect all three sentences to be > translated with different weights. > Instead what happens is that all the commands are executed before > translating *any* sentence, so that all sentences are translated with > the last modified weights (i.e weight-l=0.3) > > This happens when the inputfile is given as an argument (to -i) and also > when it is read from the stdin. > Only if we type the lines to the console one by one do we get the > expected result. > > Is there any way to force Moses to read and process each line at a time? > -- dr inż. Marcin Junczys-Dowmunt Uniwersytet im. Adama Mickiewicza Wydział Matematyki i Informatyki ul. Umultowska 87 61-614 Poznań _______________________________________________ Moses-support mailing list [email protected] http://mailman.mit.edu/mailman/listinfo/moses-support
