From 343b8fa2dc7d1350a410677c38fd2f100e749551 Mon Sep 17 00:00:00 2001 From: Wei Kang Date: Thu, 19 Jun 2025 12:27:15 +0800 Subject: [PATCH] Using non strict match in context graph for contextual words (#1952) --- .../ASR/pruned_transducer_stateless2/beam_search.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/egs/librispeech/ASR/pruned_transducer_stateless2/beam_search.py b/egs/librispeech/ASR/pruned_transducer_stateless2/beam_search.py index 66c84b2a9..f1d16749c 100644 --- a/egs/librispeech/ASR/pruned_transducer_stateless2/beam_search.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless2/beam_search.py @@ -1347,7 +1347,10 @@ def modified_beam_search( ( context_score, new_context_state, - ) = context_graph.forward_one_step(hyp.context_state, new_token) + _, + ) = context_graph.forward_one_step( + hyp.context_state, new_token, strict_mode=False + ) new_log_prob = topk_log_probs[k] + context_score @@ -2853,7 +2856,10 @@ def modified_beam_search_LODR( ( context_score, new_context_state, - ) = context_graph.forward_one_step(hyp.context_state, new_token) + _, + ) = context_graph.forward_one_step( + hyp.context_state, new_token, strict_mode=False + ) ys.append(new_token) state_cost = hyp.state_cost.forward_one_step(new_token)