mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-09-10 09:34:39 +00:00
enable sclite_mode
for swbd scoring
This commit is contained in:
parent
fc2df07841
commit
ecbc026061
@ -493,6 +493,7 @@ def write_error_stats(
|
|||||||
test_set_name: str,
|
test_set_name: str,
|
||||||
results: List[Tuple[str, str]],
|
results: List[Tuple[str, str]],
|
||||||
enable_log: bool = True,
|
enable_log: bool = True,
|
||||||
|
sclite_mode: bool = False,
|
||||||
) -> float:
|
) -> float:
|
||||||
"""Write statistics based on predicted results and reference transcripts.
|
"""Write statistics based on predicted results and reference transcripts.
|
||||||
|
|
||||||
@ -538,7 +539,7 @@ def write_error_stats(
|
|||||||
num_corr = 0
|
num_corr = 0
|
||||||
ERR = "*"
|
ERR = "*"
|
||||||
for cut_id, ref, hyp in results:
|
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:
|
for ref_word, hyp_word in ali:
|
||||||
if ref_word == ERR:
|
if ref_word == ERR:
|
||||||
ins[hyp_word] += 1
|
ins[hyp_word] += 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user