指標
MER: Mixed Error Rate
衡量整個中英混語句子的錯誤率,越低越好
reference mixed sequence R_m
hypothesis mixed sequence H_m
Levenshtein edit distance D(R_m, H_m)
\([
MER = \frac{D(R_m, H_m)}{\max(|R_m|, |H_m|)}
]\)
Reference: 我想喝latte
[我, 想, 喝, latte]
Hypothesis: 我想喝辣椒
[我, 想, 喝, 辣, 椒]
Distance: 2
latte -> 辣
insert 椒
2/max(4, 5) = 0.4CER: Chinese Character Error Rate
只看中文的部分,英文忽略,越低越好
reference 中文 R_c
hypothesis 中文 H_c
\([ CER = \frac{D(R_c, H_c)}{\max(|R_c|, |H_c|)} ]\)
Reference: 我想喝latte
[我, 想, 喝]
Hypothesis: 我想喝辣椒
[我, 想, 喝, 辣, 椒]
Distance: 2
insert 辣
insert 椒
2/5 = 0.4代表中文插入錯誤
WER: English Word Error Rate
只看英文,中文忽略,越低越好
reference 英文 R_w
hypothesis 英文 H_w
\([ WER = \frac{D(R_w, H_w)}{\max(|R_w|, |H_w|)} ]\)
Reference: 我想喝latte
[latte]
Hypothesis: 我想喝辣椒
[]
Distance: 1
insert latte
1/1 = 1Micro
\([ micro\_MER = \frac{\sum_i D(R_{m,i}, H_{m,i})}{\max(\sum_i |R_{m,i}|, \sum_i |H_{m,i}|)} ]\)
micro MER = 微平均混合錯誤率
micro CER = 微平均中文字錯誤率
micro WER = 微平均英文詞錯誤率
長句權重較大
ref: 我想喝latte
hyp: 我想喝辣椒
mixed ref length: 4
[我, 想, 喝, latte]
mixed hyp length: 5
[我, 想, 喝, 辣, 椒]
Distance: 2
MER = 0.4
ref: 今天我要去school然後買coffee
hyp: 今天我要去school然後買coffee
mixed ref length: 10
[今, 天, 我, 要, 去, school, 然, 後, 買, coffee]
mixed hyp length: 10
[今, 天, 我, 要, 去, school, 然, 後, 買, coffee]
Distance: 0
MER = 0
mirco_MER = 2 + 0 / max(4 + 10, 5 + 10) = 0.1333
EnP: English Precision / EnR: English Recall
EnP 輸出的英文有多少是正確的,EnR ref 的英文有多少被抓到,越高越好。
\([ EnP = \frac{\text{正確對齊的英文詞數}}{\text{hypothesis 裡的英文詞數}} ]\)
\([ EnR = \frac{\text{正確對齊的英文詞數}}{\text{reference 裡的英文詞數}} ]\)
ref: 我想喝 latte
hyp: 我想喝 coffee
Reference English words: [latte]
Hypothesis English words: [coffee]
EnP = 0 / 1 = 0
EnR = 0 / 1 = 0
ref: 我想喝 latte
hyp: 我想喝 latte coffee
Reference English words: [latte]
Hypothesis English words: [latte, coffee]
EnP = 1 / 2 = 0.5
EnR = 1 / 1 = 1
EnR 高, EnP 低 → LLM 幻覺額外英文,沒漏但亂加。
EnR 低, EnP 高 → LLM 保守,常漏掉英文。
Over-correction rate
原本 ASR 是正確的,但被 LLM 改錯,越低越好。
raw_correct_tokens 正確的 token。
over_corrections 原本正確被改錯的 token。
\([ \mathrm{OverCorrectionRate} = \frac{\mathrm{over\_corrections}} {\mathrm{raw\_correct\_tokens}} ]\)
ref: 我想喝 latte
ASR: 我想喝 latte
LLM: 我想喝 coffee
raw_correct_tokens: 4
over_corrections: 1
1/4 = 0.25
Correction precision
LLM 做出的修改,有多少改善,越高越好。
\([ CorrectionPrecision = \frac{\text{improvements}} {\text{modifications}} ]\)
Correction recall
原本就錯的 token 修正好的比例。
\(\text{CorrectionRecall} = \frac{\text{improvements}}{\text{raw\_error\_tokens}}\)
Precision 高, Recall 低 → LLM 修正保守,漏了許多該修的錯誤。
Precision 低, Recall 高 → LLM 修正積極,但傷害原本正確的地方。