Fix lm fusion (#157)

* share GetHypsRowSplits interface and fix getting Topk not taking logprob

* fix lm score of lm fusion and make padding len same with 'icefall/egs/librispeech/ASR/pruned_transducer_stateless7_streaming/decode.py'
This commit is contained in:
PF Luo
2023-05-15 10:48:45 +08:00
committed by GitHub
parent 959f13eac8
commit 655c619bf3
3 changed files with 5 additions and 3 deletions

View File

@@ -152,7 +152,9 @@ void OnlineTransducerModifiedBeamSearchDecoder::Decode(
} else {
++new_hyp.num_trailing_blanks;
}
new_hyp.log_prob = p_logprob[k] - prev_lm_log_prob;
new_hyp.log_prob =
p_logprob[k] - prev_lm_log_prob; // log_prob only includes the
// score of the transducer
hyps.Add(std::move(new_hyp));
} // for (auto k : topk)
cur.push_back(std::move(hyps));