LM scores from n-gram

310 views
Skip to first unread message

ashwaqa...@gmail.com

unread,
Oct 15, 2017, 9:51:00 AM10/15/17
to kaldi-help
Hello 

I generated N-best list from lattice then extracted  LM score with out the graph cost using: 

logprob= -4.975801


echo "$0: Creating archives with text-form of words, and LM scores without graph scores."

    # Do some small tasks; for these we don't use the queue, it will only slow us down.

  for n in `seq $nj`; do

    utils/int2sym.pl -f 2- $oldlang/words.txt < $adir.$n/words > $adir.$n/words_text || exit 1;

    mkdir -p $adir.$n/temp

    paste $adir.$n/lmwt.nolm $adir.$n/lmwt.withlm | awk '{print $1, ($4-$2);}' > \

      $adir.$n/lmwt.lmonly || exit 1;

the LM cost for one entry in the n-best list is

P2-Utt10-1 11.4572  the logprob for ngram LM is logprob= -4.975801

what does LM score represent? 


thanks



Daniel Povey

unread,
Oct 15, 2017, 2:06:50 PM10/15/17
to kaldi-help
The LM-score is the negative log probability of the whole sentence.
I.e. it's the sum of the negative log-prob of all the words in that
sentence, including the EOS (end of sentence) symbol `</s>`.
> --
> Go to http://kaldi-asr.org/forums.html find out how to join
> ---
> You received this message because you are subscribed to the Google Groups
> "kaldi-help" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kaldi-help+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

ashwaqa...@gmail.com

unread,
Oct 15, 2017, 6:34:47 PM10/15/17
to kaldi-help
Hi Dan - i'm a bit confused as why the LM score is 11.4572 where ngram gives neg-logprob of 4.975801 for all words in the sentence! I want to re-score the N-best list with task specific ngram ( leanier interpolation) in which neg-logprob calculated from that ngram LM, similar to rnnlmrescore.sh 

score = graphscore+(rnnweight*rnnscore)+((1-rnnweight)*lmscore);

Daniel Povey

unread,
Oct 15, 2017, 6:36:38 PM10/15/17
to kaldi-help
Maybe you forgot to include the probability of the EOS symbol.
Reply all
Reply to author
Forward
0 new messages