[SRILM User List] ngram -loglinear-mix problem

Andreas Stolcke stolcke at speech.sri.com
Wed Aug 4 22:42:48 PDT 2010


wei chen wrote:
> Hi,all,
> I was trying to implement LM interpolation using -log-linear-mix:
>              ngram   -lm lm1 -lambda 0.5 -loglinear-mix -mix-lm 
> lm2 -write-lm gen.lm
> however, some errors occured "write() method not implemented", which 
> can not generate interpolated LM. I do not know why,
Unlike with linear mixtures, it is not supported to directly create a 
single merged LM that implements the mixture.
You can  perform the mixture dynamically, computing probabilities on the 
fly, e.g., with ngram -ppl .

There is a roundabout way to achieve what you want.
1) do a linear mixture and dump out the merged LM (the purpose is to 
generate an LM that has the union of the ngrams of the input LMs).
       ngram -lm lm1 -mix-lm lm2 -write-lm MIXLM
2) "rescore" the LM by recomputing the probabilities according to the 
log-linear mixture
      ngram -rescore-ngram MIXLM -lm lm1 -lambda 0.5 
-loglinear-mix -mix-lm lm2 -write-lm gen.lm
This step can take a LONG time, since the normalization of the loglinear 
has to perform for every ngram context in the LM.

Andreas

> Thanks a lot.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> SRILM-User site list
> SRILM-User at speech.sri.com
> http://www.speech.sri.com/mailman/listinfo/srilm-user



More information about the SRILM-User mailing list