That's an excellent question, Chris. I would recommend making a
second copy of mert-moses.pl and editing the following lines
my $additional_triples = {
# if the more lambda parameters for the weights are needed
# (due to additional tables) use the following values for them
"d" => [ [ 1.0, 0.0, 2.0 ], # lexicalized reordering model
[ 1.0, 0.0, 2.0 ],
[ 1.0, 0.0, 2.0 ],
[ 1.0, 0.0, 2.0 ],
[ 1.0, 0.0, 2.0 ],
[ 1.0, 0.0, 2.0 ],
[ 1.0, 0.0, 2.0 ] ],
"lm" => [ [ 1.0, 0.0, 2.0 ] ], # language model
"g" => [ [ 1.0, 0.0, 2.0 ], # generation model
[ 1.0, 0.0, 2.0 ] ],
"tm" => [ [ 0.3, 0.0, 0.5 ], # translation model
[ 0.2, 0.0, 0.5 ],
[ 0.3, 0.0, 0.5 ],
[ 0.2, 0.0, 0.5 ],
[ 0.0,-1.0, 1.0 ] ], # ... last weight is phrase penalty
};
So that they instead say
my $additional_triples = {
# if more lambda parameters for the weights are needed
# (due to additional tables) use the following values for them
"d" => [ [ 1.0, 0.0, 2.0 ], # lexicalized reordering model
[ 1.0, 0.0, 2.0 ],
[ 1.0, 0.0, 2.0 ],
[ 1.0, 0.0, 2.0 ],
[ 1.0, 0.0, 2.0 ],
[ 1.0, 0.0, 2.0 ],
[ 1.0, 0.0, 2.0 ] ],
"lm" => [ [ 1.0, 0.0, 2.0 ] ], # language model
"g" => [ [ 1.0, 0.0, 2.0 ], # generation model
[ 1.0, 0.0, 2.0 ] ],
"tm" => [ [ 0.3, 0.0, 0.5 ], # translation model
[ 0.2, 0.0, 0.5 ],
[ 0.3, 0.0, 0.5 ],
[ 0.3, 0.0, 0.5 ],
[ 0.2, 0.0, 0.5 ],
[ 0.0,-1.0, 1.0 ] ], # ... last weight is phrase penalty
};
That seems to work for the phrase table.
Note that doing a similar process for the re-ordering table causes
moses to crash, since each of the re-ordering probs correspond to a
particular orientation of phrases, so you can't just add feature
functions willy-nilly.
--Chris
On Sep 3, 2008, at 6:12 PM, Chris Callison-Burch wrote:
> Hi guys,
>
> I'm trying to add another weight to the phrase table. I get a message
> in MERT training that says "Your model tm needs 6 weights but we
> define the default ranges for only 5 weights. Cannot use the default,
> you must supply lambdas by hand." Can anyone tell me how to do so?
>
> Thanks a million.
>
> --Chris
> _______________________________________________
> 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