Hi Lane and all, 

For our use case at eBay, we added a PhraseDictionaryCache for each sentence. 
It allows you to add phrase pairs with defined number of scores for each 
sentence. 

Input with 3 features will look like this:
<seg id=“1”> <dlt type="cbtm" cbtm="das ||| the ||| 1.0 0.5 0.6 |||| ist ||| is 
||| 1 1 1 |||| ein kleines haus ||| a cute place ||| 0.5 0.9 0.7"> das ist ein 
kleines haus </seg>
With mosesserver you need the segment IDs otherwise not; its because server 
puts all the segment ID to 0. 
Its thread safe at segment level. But, if you input two segments with same ID 
there might be an issue.

In moses config, you just have to add this line:
'''
[feature]
PhraseDictionaryCache name=CBPT0 table-limit=20 num-features=3 input-factor=0 
output-factor=0

[weight]
CBPT0= 0.3 0.3 0.3
'''

It also work with multiple factors (haven’t tested this for all possible corner 
cases), see the regression test here:
https://github.com/ebay-hlt/moses-regression-tests/tree/master/tests/phrase.cache-multi-factor
 
<https://github.com/ebay-hlt/moses-regression-tests/tree/master/tests/phrase.cache-multi-factor>

Code is available here: https://github.com/ebay-hlt/mosesdecoder/ 
<https://github.com/ebay-hlt/mosesdecoder/>

Let me know if you have any issues. 

Cheers,
—Prashant

On Mon, Nov 7, 2016 at 6:10 PM, Lane Schwartz <[email protected] 
<mailto:[email protected]>> wrote:
Hi,

I'm interested in extending Moses to enable per-sentence LMs and TMs. Given the 
current moses architecture (esp. StaticData), how feasible would it be to add 
new LMs and TMs that only exist for one sentence translation?

Thanks,
Lane


_______________________________________________
Moses-support mailing list
[email protected] <mailto:[email protected]>
http://mailman.mit.edu/mailman/listinfo/moses-support 
<http://mailman.mit.edu/mailman/listinfo/moses-support>


_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to