Hieu,

What happened to moses/LM/Factory.cpp? It's not there anymore.

Lane


On Fri, Mar 11, 2016 at 10:22 AM, Lane Schwartz <dowob...@gmail.com> wrote:

> You'll also need to tell the moses.ini file that you want a BackwardLM.
>
> For example, see the code at revision
> 8459a86137f7d15834009557a62c4278479da088 in moses/LM/Factory.cpp:
>
> +  case BackwardLM:
>> +    return ConstructBackwardLM(languageModelFile, factorTypes[0],
>> lmImplementation == LazyKen);
>> +    break;
>
>
> If that code has been removed, it will need to be re-added.
>
>
> On Fri, Mar 11, 2016 at 10:16 AM, Lane Schwartz <dowob...@gmail.com>
> wrote:
>
>> I see ngrams in the backward.arpa file that look like this:
>>
>> -1.263617       we </s>
>>> -1.263617       we when
>>> -0.6615573      when </s>
>>
>>
>> -1.48317        <s> . rights
>>
>> -1.48317        <s> . works
>>
>>
>> Based on that, and on my recollection, I think you just have to reverse
>> the order of the words in each sentence, and then just run that modified
>> corpus through your LM trainer.
>>
>>
>>
>> On Fri, Mar 11, 2016 at 10:12 AM, Lane Schwartz <dowob...@gmail.com>
>> wrote:
>>
>>> I'm the one who wrote that code. I don't remember off hand exactly what
>>> was necessary, but I believe that I left notes in the git commit log.
>>> Somewhere in my archives I think I have the actual scripts that I used, but
>>> I don't have those easily accessible right now. I'll try to find them.
>>>
>>> In the meantime, the best way to figure it out is to run git log within
>>> the moses repo, and search for all mentioned of the word "backward". That
>>> will show you my commits. I did create unit tests for the backward LM, so I
>>> would advise looking at the unit tests.
>>>
>>> I have checked in a trained backward LM. I believe it's a backward
>>> trigram model trained on the text of the GNU GPL license file.
>>>
>>> That file is in the moses repo at moses/LM/backward.arpa. There is a
>>> corresponding unit test at moses/LM/BackwardTest.cpp that tests the
>>> correctness of the code when querying moses/LM/backward.arpa for certain
>>> specific n-grams.
>>>
>>> I suspect that looking at those two files should be sufficient to answer
>>> your questions. If it's not, let me know and I can spend some time digging
>>> through my old archived files.
>>>
>>>
>>>
>>> On Thu, Mar 10, 2016 at 3:33 PM, Michael Denkowski <
>>> michael.j.denkow...@gmail.com> wrote:
>>>
>>>> Hi Moses LM enthusiasts,
>>>>
>>>> This may be a silly question.  If I want to use the BackwardLanguageModel
>>>> feature, what (if anything) should I do to let KenLM know that it's a
>>>> backward model?
>>>>
>>>> If I just reverse the words in each sentence and run
>>>> lmplz/build_binary, will Moses do the right thing with the model?  Do I
>>>> need to do anything special with <s> and </s>?
>>>>
>>>> Best,
>>>> Michael
>>>>
>>>> _______________________________________________
>>>> Moses-support mailing list
>>>> Moses-support@mit.edu
>>>> http://mailman.mit.edu/mailman/listinfo/moses-support
>>>>
>>>>
>>>
>>>
>>> --
>>> When a place gets crowded enough to require ID's, social collapse is not
>>> far away.  It is time to go elsewhere.  The best thing about space travel
>>> is that it made it possible to go elsewhere.
>>>                 -- R.A. Heinlein, "Time Enough For Love"
>>>
>>
>>
>>
>> --
>> When a place gets crowded enough to require ID's, social collapse is not
>> far away.  It is time to go elsewhere.  The best thing about space travel
>> is that it made it possible to go elsewhere.
>>                 -- R.A. Heinlein, "Time Enough For Love"
>>
>
>
>
> --
> When a place gets crowded enough to require ID's, social collapse is not
> far away.  It is time to go elsewhere.  The best thing about space travel
> is that it made it possible to go elsewhere.
>                 -- R.A. Heinlein, "Time Enough For Love"
>



-- 
When a place gets crowded enough to require ID's, social collapse is not
far away.  It is time to go elsewhere.  The best thing about space travel
is that it made it possible to go elsewhere.
                -- R.A. Heinlein, "Time Enough For Love"
_______________________________________________
Moses-support mailing list
Moses-support@mit.edu
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to