Search SRILM-USER Archives

Match: Format: Sort by:
Search:

Patch for ngram.cc

From: Andreas Stolcke <stolcke at ADDRESS HIDDEN>
Date: Thu, 04 Oct 2001 12:39:09 PDT

Dear All,

a rather embarassing bug in ngram causes it to mess up the mixture
weight for the second mixture model (-mix-lm) when three or more
models are interpolated.  This problem exists in all versions of SRILM
prior to 1.2 (which won't be released for a while), so please apply the
patch below if this bug affects you.

--Andreas

*** /tmp/T0EFaaMN Thu Oct  4 12:32:01 2001
--- ngram.cc Wed Oct  3 19:51:14 2001
***************
*** 463,470 ****
       mixLambda2/totalLambda);
   }
  
   mixLM = makeMixLM(mixFile, *vocab, classVocab, order, mixLM,
!     1.0 - totalLambda - mixLambda);
  
   useLM = new BayesMix(*vocab, *useLM, *mixLM, bayesLength,
       mixLambda, bayesScale);
--- 463,472 ----
       mixLambda2/totalLambda);
   }
  
+ double mixLambda1 = 1.0 - totalLambda - mixLambda;
+
   mixLM = makeMixLM(mixFile, *vocab, classVocab, order, mixLM,
!     mixLambda1/(mixLambda1 + totalLambda));
  
   useLM = new BayesMix(*vocab, *useLM, *mixLM, bayesLength,
       mixLambda, bayesScale);

Click here to go to the SRILM home page.