Fix an error.

Nbest.fsa should always have token IDs as labels and
word IDs as aux_labels.
This commit is contained in:
Fangjun Kuang 2021-09-13 20:55:26 +08:00
parent 9ddf23636e
commit 968e4a6609

View File

@ -202,7 +202,8 @@ class Nbest(object):
path_lattice, use_double_scores=use_double_scores
)
one_best = k2.remove_epsilon(one_best)
one_best = k2.invert(one_best)
# Now one_best has token IDs as labels and word IDs as aux_labels
return Nbest(fsa=one_best, shape=self.shape)