fix decode.py for conformer_ctc in gigaspeech (#688)

This commit is contained in:
Fangjun Kuang 2022-11-16 19:58:28 +08:00 committed by GitHub
parent c8ce243255
commit aa7bae1ecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -481,9 +481,9 @@ def decode_dataset(
), "It should not decode to empty in the first batch!" ), "It should not decode to empty in the first batch!"
this_batch = [] this_batch = []
hyp_words = [] hyp_words = []
for ref_text in texts: for cut_id, ref_text in zip(cut_ids, texts):
ref_words = ref_text.split() ref_words = ref_text.split()
this_batch.append((ref_words, hyp_words)) this_batch.append((cut_id, ref_words, hyp_words))
for lm_scale in results.keys(): for lm_scale in results.keys():
results[lm_scale].extend(this_batch) results[lm_scale].extend(this_batch)