Remove duplicated token seq in rescoring.

This commit is contained in:
Fangjun Kuang 2021-11-05 22:19:30 +08:00
parent 810b193dcc
commit 4a9dd1530c

View File

@ -224,6 +224,7 @@ class Nbest(object):
else: else:
word_seq = lattice.aux_labels.index(path) word_seq = lattice.aux_labels.index(path)
word_seq = word_seq.remove_axis(word_seq.num_axes - 2) word_seq = word_seq.remove_axis(word_seq.num_axes - 2)
word_seq = word_seq.remove_values_leq(0)
# Each utterance has `num_paths` paths but some of them transduces # Each utterance has `num_paths` paths but some of them transduces
# to the same word sequence, so we need to remove repeated word # to the same word sequence, so we need to remove repeated word