Hi Liang,
Here's a hack to avoid changing Moses code:
First, append a unique identifier to every word in your source file.
E.g., a source file with two lines like the following:

this is sentence 1 .
sentence 2

would become:

this~~1 is~~2 sentence~~3 1~~4 .~~5
sentence~~6 2~~7

Then when generating your sentence-specific phrase tables for these
sentences, use the same IDs in the source words in those phrase table
entries.  Then concatenate all the sentence-specific phrase tables together
and train as usual.

The problem with this is that the concatenated phrase tables become really
large, but you can filter the phrase tables a bit.  This is what we did in
here <http://ttic.uchicago.edu/~kgimpel/papers/gimpel+smith.smt08.pdf> (Sec.
5), which made things possible to run and didn't seem to affect the
results.

Kevin

On Sun, Dec 13, 2015 at 2:41 AM, 姚亮 <[email protected]> wrote:

> Dear support-Team,
>         I wanted to add a new feature into moses decoder which relies on
> source contexts of the sentence to be translated.
>         my idea are as follows:
>         1,  for each test/dev sentence, a phrase table of all potential 
> phrases
> that can be used during decoding is extracted from the aligned training
> set.
>         2,  the translation score of phrase pairs in the source contexts
> are computed and then added into the phrase table as a new feature.
>         therefore , in my setting, for each sentence , i got an phrase
> table. but i don't know how to tuning on this situation.
>         i know maybe i can add a new Feature Function as the moses
> tutorial says, but it diffcult for me to implement the code.
>         could you give my some advices?
>
> Thanks
> Liang
>
>
>
>
> _______________________________________________
> 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

Reply via email to