Support getting word IDs for CTC HLG decoding. (#978)

This commit is contained in:
Fangjun Kuang
2024-06-06 14:22:39 +08:00
committed by GitHub
parent 69347ffc8f
commit 1a43d1e37f
13 changed files with 60 additions and 13 deletions

View File

@@ -108,6 +108,9 @@ static OfflineCtcDecoderResult DecodeOne(kaldi_decoder::FasterDecoder *decoder,
// -1 here since the input labels are incremented during graph
// construction
r.tokens.push_back(arc.ilabel - 1);
if (arc.olabel != 0) {
r.words.push_back(arc.olabel);
}
r.timestamps.push_back(t);
prev = arc.ilabel;