HMM parameters for a given sentence appear to be initialized in the
following function:

HMMNetwork *hmm::makeHMMNetwork(const Vector<WordIndex>& es,const
Vector<WordIndex>&fs,bool doInit)const

My best guess is to try to focus on line 214:
          net->e[j](i1,i2)          = al[i2real];
In particular, I would set this to 0 if i2real < i1 (or perhaps i2real
< i1real ?). That may be all you need to do.

-Chris

On Mon, Aug 27, 2012 at 5:38 PM, Dario Ernst <[email protected]> wrote:
> Hi Chris,
>
> On 08/24/2012 04:50 PM, Chris Dyer wrote:
>> Although forcing monotone alignments sounds like a fairly large
>> change, you can use the "parameter" trick in this case because of how
>> Giza's HMM estimation works. It alternates between estimating a prior
>> distribution over transitions ("jumps") and posterior distributions
>> when the sentence pair is observed. Because of how Bayes rule works,
>> if your prior assigns 0 probability to some event (in this case, a
>> reverse alignment), the posterior distribution will also be 0. For
>> this reason, if you initialize carefully, you'll be fine.
>
> thanks for your verbose tips! After browsing the code a few more days,
> trying to get help from local SMT-ers and some general black despair i
> must admit that i didn't understand what you meant. While what you say
> certainly sounds good in theory i haven't even been able to find the
> correct piece of code in GIZA that seems to do what you refer to. So I'm
> now not only at a loss on how to proceed, but totally lost with my problem.
>
> While i know this is totally bold and way too demanding, may i ask how
> good your GIZA++ code understand is, and how long it would take you to
> find the rough place of code where these assignments happen and point me
> to them? So, well, if that time would be really really short, and you
> currently had enough (time) at hand, could i sincerely ask you to help
> me with this a tiny little bit? I'm by no means asking you to "hey,
> patch me GIZA here", but only a small, a little more precise pointer.
>
> While I'm very happy to get so nice and capable support and help here on
> the list I'm at the same time really really sorry that i can't seem to
> follow some (read: much) of the conversation and keep up to the level of
> knowledge here. Long things short: i feel so dumb right now and I'm
> terribly sorry for it. I don't even feel like i should continue bugging you.
>
> Thank you a lot! Really, thanks :P. Regards
> - Dario
> _______________________________________________
> 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