From 132132f52a660f74dac552b432776d82aa1f5dab Mon Sep 17 00:00:00 2001 From: "LIyong.Guo" Date: Tue, 2 Aug 2022 22:28:12 +0800 Subject: [PATCH] liear_fst_with_self_loops (#512) --- icefall/decode.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/icefall/decode.py b/icefall/decode.py index e596876f4..3b64481c7 100644 --- a/icefall/decode.py +++ b/icefall/decode.py @@ -330,12 +330,14 @@ class Nbest(object): # We use a word fsa to intersect with k2.invert(lattice) word_fsa = k2.invert(self.fsa) + word_fsa.scores.zero_() if hasattr(lattice, "aux_labels"): # delete token IDs as it is not needed del word_fsa.aux_labels + word_fsa_with_epsilon_loops = k2.linear_fsa_with_self_loops(word_fsa) + else: + word_fsa_with_epsilon_loops = k2.linear_fst_with_self_loops(word_fsa) - word_fsa.scores.zero_() - word_fsa_with_epsilon_loops = k2.linear_fsa_with_self_loops(word_fsa) path_to_utt_map = self.shape.row_ids(1)