MCPcopy Index your code
hub / github.com/modelscope/FunASR / compute_cer

Function compute_cer

benchmark_vllm.py:51–60  ·  view source on GitHub ↗
(refs, hyps)

Source from the content-addressed store, hash-verified

49
50
51def compute_cer(refs, hyps):
52 total_ref = 0
53 total_errs = 0
54 for ref, hyp in zip(refs, hyps):
55 r = list(normalize_zh(ref))
56 h = list(normalize_zh(hyp))
57 total_ref += len(r)
58 ali = kaldialign.align(r, h, '*')
59 total_errs += sum(1 for a, b in ali if a != b)
60 return total_errs / total_ref * 100 if total_ref > 0 else 0
61
62
63def vad_segment(files, device="cuda:0"):

Callers 1

benchmark_vllm.pyFile · 0.85

Calls 1

normalize_zhFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…