enable sclite_mode for swbd scoring (#1239)

This commit is contained in:
zr_jin 2023-09-09 21:25:26 +08:00 committed by GitHub
parent 49a4b67288
commit 3199058194
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -15,7 +15,7 @@ graphviz==0.19.1
git+https://github.com/lhotse-speech/lhotse
kaldilm==1.11
kaldialign==0.2
kaldialign==0.7.1
sentencepiece==0.1.96
tensorboard==2.8.0
typeguard==2.13.3