Send Moses-support mailing list submissions to
moses-support@mit.edu
To subscribe or unsubscribe via the World Wide Web, visit
http://mailman.mit.edu/mailman/listinfo/moses-support
or, via email, send a message with subject or body 'help' to
moses-support-request@mit.edu
You can reach the person managing the list at
moses-support-owner@mit.edu
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Moses-support digest..."
Today's Topics:
1. Re: Adding feature to moses (Hieu Hoang)
----------------------------------------------------------------------
Message: 1
Date: Wed, 25 Nov 2015 14:42:47 +0000
From: Hieu Hoang <hieuhoang@gmail.com>
Subject: Re: [Moses-support] Adding feature to moses
To: haouarid@iro.umontreal.ca, moses-support <moses-support@mit.edu>
Message-ID: <5655C8E7.3060704@gmail.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
On 25/11/2015 14:27, haouarid@iro.umontreal.ca wrote:
> Hi,
>
> I trained a word by word translation model having this format:
>
> targetWord | sourceWord | translationProbability
There may be something similar in Moses already that you can look at to
see how it's implemented
moses/FF/WordTranslationFeature.*
>
> My goal is to add this translation table to Moses as a new feature because
> I want to search for target words and their translation probability given
> a source sentence words and I want also to tune this model.
>
> So, I added a new feature class and in the EvaluateWithSourceContext
> method, I have the (TargetPhrase &targetPhrase) argument which I think
> give me access to the source sentence and the target sentence.
>
> In order to get access to the words, I tried one draft code like in the
> following:
>
> for(size_t targetIndex = 0; targetIndex < targetPhrase.GetSize();
> targetIndex++ )
> {
> const Word& targetWord = targetPhrase.GetWord( targetIndex );
> cerr<< targetWord.GetString(0)<<endl;
> }
>
> The method GetString is defined in the class Word like this
> StringPiece GetString (FactorType factorType) const
> So it should return the String representation of a Word given a FactorType
> as argument. In this code, I specified 0 as argument. But actually, I
> don't understand what I have to give as argument because my translation
> model is not using any factorType. If I understand well, FactorType is
> used when we use factors like part of speech tags and this is not the
> case of the translation model I'm using.
That should work. If you don't have any factors, you'll be using factor 0.
>
> My question is can I read the string source and target words without using
> Factors? If not, how can I do that, given that my translation model is
> just using surface form of words.
a (const Factor*) is just the unique vocab id for moses.
>
>
> I hope I'm clear. If not, don't hesitate to tell me that.
> I thank you,
> Dorra
>
>
>> I'm not sure what you're trying to do. Can you give an example.
>>
>>
>> On 24/11/2015 22:46, haouarid@iro.umontreal.ca wrote:
>>> Hi,
>>>
>>> I would like to add a word by word translation model to moses as a new
>>> feature. I didn't understand how it is possible to have access to the
>>> source and target words. As it is explained in the documentation,
>>> StringPiece is accessible by Factor class which is accessible by Word
>>> class which is accessible by TargetPhrase which is given as argument in
>>> the evaluation method like . I don't use
>>> factors
>>> with my translation model, I just use surface form of words.
>>> How is it possible to read the string source and target words without
>>> using Factors?
>>>
>>> Thank you,
>>> Dorra
>>> _______________________________________________
>>> Moses-support mailing list
>>> Moses-support@mit.edu
>>> http://mailman.mit.edu/mailman/listinfo/moses-support
>>>
>> --
>> Hieu Hoang
>> http://www.hoang.co.uk/hieu
>>
>
--
Hieu Hoang
http://www.hoang.co.uk/hieu
------------------------------
_______________________________________________
Moses-support mailing list
Moses-support@mit.edu
http://mailman.mit.edu/mailman/listinfo/moses-support
End of Moses-support Digest, Vol 109, Issue 63
**********************************************
Subscribe to:
Post Comments (Atom)
0 Response to "Moses-support Digest, Vol 109, Issue 63"
Post a Comment