From ecbc0260619ce38fc22dd88fbb524415a3f45c17 Mon Sep 17 00:00:00 2001 From: zr_jin <60612200+JinZr@users.noreply.github.com> Date: Mon, 4 Sep 2023 10:56:22 +0800 Subject: [PATCH] enable `sclite_mode` for swbd scoring --- icefall/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/icefall/utils.py b/icefall/utils.py index b01cd2770..947d79438 100644 --- a/icefall/utils.py +++ b/icefall/utils.py @@ -493,6 +493,7 @@ def write_error_stats( test_set_name: str, results: List[Tuple[str, str]], enable_log: bool = True, + sclite_mode: bool = False, ) -> float: """Write statistics based on predicted results and reference transcripts. @@ -538,7 +539,7 @@ def write_error_stats( num_corr = 0 ERR = "*" for cut_id, ref, hyp in results: - ali = kaldialign.align(ref, hyp, ERR) + ali = kaldialign.align(ref, hyp, ERR, sclite_mode=sclite_mode) for ref_word, hyp_word in ali: if ref_word == ERR: ins[hyp_word] += 1