Hi,<br><br>I was seeing weird behavior in lattice-tool, mixing in an external LM to a lattice for nbest decoding.<br><br>Tracking things down, I found that if I zeroed out the external LM scores as they were added into the lattice during expansion, the resulting hyp scores were always zero, that is the scores from the lattice were discarded. I observed this for both HTK and PFSG lattices.
<br><br>Attached is a patch (to version 1.5.1) which I believe fixes the problem. What I found is that, as old transitions were replaced during expansion (Lattice::expandAddTransition() in LatticeExpand.cc), the old weights were discarded. This caused the problem because theinitial transitions loaded from the lattice files were replaced during expansion.
<br><br>Cheers,<br><br>tm<br><br><br>P.S. I also made some changes to functionality, let me know if anyone is interested in them: (1) allowing scaling of the external LM as it's used to reweight the lattice and (2) outputing (weighted) acoustic and LM scores to the nbest list as they were actually evaluated during decoding; currently only the original scores from the lattice are output for HTK lattices and zeros are output for PFSG lattices, because they don't fill the internal HTK structures used for score output.