Update decode.py

fixed a KeyError occurred during the computation of WER for nbest-oracle
This commit is contained in:
jinzr 2023-06-26 21:12:56 +08:00
parent abbd0d92a7
commit 354e40925b

View File

@ -366,7 +366,7 @@ def decode_one_batch(
ref_texts=supervisions["text"],
word_table=word_table,
nbest_scale=params.nbest_scale,
oov="<UNK>",
oov="<unk>",
)
hyps = get_texts(best_path)
hyps = [[word_table[i] for i in ids] for ids in hyps]