[ THUNLP-MT (2/10) ] BLEU: a Method for Automatic Evaluation of Machine Translation | NIST

本文讨论BLEU评价指标的主要原理。原论文由IBM发表于ACL’02,是老生常谈的一篇论文了。BLEU指标如今经常在机器翻译任务的评价中使用。 (被引用 8924 次。)此外,本文还讨论BLEU的变种,NIST评价指标。

BLEU 原论文传送门
BLEU: a Method for Automatic Evaluation of Machine Translation
NIST 原论文传送门
Automatic Evaluation of Machine Translation Quality Using N-gram Co-Occurrence Statistics


一个好的译文评分方法

应该同时具有敏感性和一致性两方面特性
》 敏感性
能够区分相似系统之间的好坏

》一致性
不会因为不同的测试文本和参考译文而影响对系统性能的评价

BLEU 主要原理

全名为:bilingual evaluation understudy,中文译为:双语互译质量评估辅助工具

》原理 : 机器翻译结果越接近专业人工翻译的结果,则越好。因此,考虑同现单元的计分。

(1) BLEU = BP ∗ e x p ( ∑ n = 1 N w n ∗ log  p n ) # 累加 log  p n , 等 于  log  ∏ n = 1 N p n , #  会 造 成 某 项 n − g r a m 为 零 , 整 个 BLEU 为 零 。 \begin{aligned} \text{BLEU} &= \text{BP}*exp(\sum_{n=1}^{N} w_n* \text{log } p_n) \tag1 \\ & \text{\# 累加 log } p_n ,等于\text{ log } \prod_{n=1}^{N} p_n , \\ & \text{\# }会造成某项n-gram为零,整个\text{BLEU} 为零。 \end{aligned} BLEU=BPexp(n=1Nwnlog pn)累加 log pn, log n=1NpnngramBLEU(1)

(2) BP = { 1 , c &gt; r e ( 1 − r / c ) , c &lt; = r \text{BP}=\left\{ \begin{array}{rcl} 1 &amp; &amp; {,c &gt; r} \\ e^{(1-r/c)} &amp; &amp; {,c &lt;= r} \\ \end{array} \right. \tag2 BP={1e(1r/c),c>r,c<=r(2)

(3) p n = ∑ C ∈ { C a n d i d a t e } ∑ n − g r a m ∈ C C o u n t c l i p ( n − g r a m ) ∑ C ′ ∈ { C a n d i d a t e } ∑ n − g r a m ′ ∈ C ′ C o u n t ( n − g r a m ′ ) # Candidate 表示系统译文,Candidate means translated sentences \begin{aligned} p_n &amp;= \frac{ \sum_{C∈{\{Candidate\}}} \sum_{n-gram∈C} Count_{clip}(n-gram) } { \sum_{C^{&#x27;}∈\{Candidate\}} \sum_{n-gram^{&#x27;}∈C^{&#x27;}} Count(n-gram&#x27;) } \tag3 \\ &amp; \# \text{Candidate 表示系统译文,Candidate means translated sentences} \end{aligned} pn=C{Candidate}ngramCCount(ngram)C{Candidate}ngramCCountclip(ngram)#Candidate 表示系统译文,Candidate means translated sentences(3)

(4) C o u n t c l i p = m i n ( c o u n t , m a x R e f e r e n c e C o u n t ) Count_{clip} = min( count, maxReferenceCount ) \tag4 Countclip=min(count,maxReferenceCount)(4)

(5) log BLEU = log BP + ∑ n = 1 N w n ∗ log p n = m i n ( 1 − r c , 0 ) + ∑ n = 1 N w n ∗ log p n \begin{aligned} \text{log BLEU} &amp;= \text{log BP} + \sum_{n=1}^{N} w_n* \text{log}p_n \\ &amp;= min(1-\frac{r}{c},0) + \sum_{n=1}^{N} w_n* \text{log}p_n \tag5 \end{aligned} log BLEU=log BP+n=1Nwnlogpn=min(1cr,0)+n=1Nwnlogpn(5)

(1) 中, BP \text{BP} BP表示 brevity penalty \text{brevity penalty} brevity penalty,即长度惩罚因子。 p n p_n pn表示整个测试文本的准确度积分(Corpus-based N-gram Precision),一般N=4,且 w n w_n wn=1/N。

(2) 表示的是,某个n-gram组成的集合在所有候选翻译句子中的出现概率,即同现单元的计分方法。其中,c 和 r 分别表示候选译文的长度和参考译文长度。当候选译文长度大于参考译文, BP = 1 \text{BP}=1 BP=1 ,当候选译文长度小于等于参考译文长度, BP &lt; 1 \text{BP}&lt;1 BP<1。即偏向较长的候选译文。

(3) 表示的是累积所有翻译句子修正后的 N-gram 计数,除上测试集中所有句子的 N-gram 计数。 C C C C ′ C^{&#x27;} C都表示系统译文,而分子表示的是系统译文出现在任何参考译文中的个数;分母表示的是系统译文的各个n-gram的计数加和

(4) 表示修正后的 N-gram 计数的计算方式。即是每个单词在所有参考译文中的出现次数的最大值(在下式中用maxReferenceCount表示),以及单词在模型输出译文中的出现次数,两个值中的最小值。

(5) 表示取对数后的 BLEU 评价指标。

举例而言, “猫咪在垫子上。”
系统译文:the the the the the the the.
参考译文1:The cat is on the mat.
参考译文1:There is a cat on the mat.
N = 2 N=2 N=2 (一般N=4)

n = 1 n=1 n=1 时,
未修正的测试文本准确度:
p 1 = ∑ C ∈ { C a n d i d a t e } ∑ 1 − g r a m ∈ C C o u n t ( 1 − g r a m ) ∑ C ′ ∈ { C a n d i d a t e } ∑ 1 − g r a m ′ ∈ C ′ C o u n t ( 1 − g r a m ′ ) = 7 7 = 1 \begin{aligned} p_1 &amp;= \frac{ \sum_{C∈\{Candidate\}} \sum_{1-gram∈C} Count(1-gram) } { \sum_{C^{&#x27;}∈\{Candidate\}} \sum_{1-gram^{&#x27;}∈C^{&#x27;}} Count(1-gram&#x27;) } \\ &amp;= \frac{7}{7} = 1 \end{aligned} p1=C{Candidate}1gramCCount(1gram)C{Candidate}1gramCCount(1gram)=77=1
.
修正的测试文本准确度:(即避免系统译文中n-gram的个数,大于其在某个参考译文中出现的个数)
C o u n t c l i p = m i n ( c o u n t , m a x R e f e r e n c e C o u n t ) = m i n ( 7 , 2 ) = 2 \begin{aligned} Count_{clip} &amp;= min( count, maxReferenceCount ) \\ &amp;= min( 7, 2 ) \\ &amp;= 2 \end{aligned} Countclip=min(count,maxReferenceCount)=min(7,2)=2
.

n = 2 n=2 n=2 时,
未修正的测试文本准确度:
p 2 = 0 6 = 0 \begin{aligned} p_2 &amp;= \frac{ 0 } { 6 } \\ &amp;= 0 \end{aligned} p2=60=0
.
修正的测试文本准确度:(即避免系统译文中n-gram的个数,大于其在某个参考译文中出现的个数
C o u n t c l i p = m i n ( c o u n t , m a x R e f e r e n c e C o u n t ) = m i n ( 6 , 0 ) = 0 \begin{aligned} Count_{clip} &amp;= min( count, maxReferenceCount ) \\ &amp;= min( 6, 0 ) \\ &amp;= 0 \end{aligned} Countclip=min(count,maxReferenceCount)=min(6,0)=0

c = 7 , r = 7 c=7,r=7 c=7r=7(选取长度最接近的参考翻译,若存在多个则取最小的)
.
BP = e ( 1 − r / c ) ( c &lt; = r ) = 1 \begin{aligned} \text{BP} &amp;= e^{(1-r/c)} &amp; &amp; {(c &lt;= r)} \\ &amp;= 1 \end{aligned} BP=e(1r/c)=1c<=r
.
p 2 = 6 0 = 0 # 警告:除以零 \begin{aligned} p_2 &amp;= \frac{6}{0} = 0 \text{\# 警告:除以零} \end{aligned} p2=06=0警告:除以零
.
BLEU = BP ∗ e x p ( ∑ n = 1 2 w n ∗ log p n ) = BP ∗ e x p ( ∑ n = 1 2 1 2 ∗ l o g p n ) = BP ∗ e x p ( 1 2 ∗ l o g ( 2 / 7 ) + 1 2 ∗ l o g ( 0 ) ) # 警告:除以零,解决:在源代码里返回了0 = BP ∗ e x p ( 1 2 ∗ l o g ( 2 / 7 ) ) = e x p ( 1 2 ∗ l o g ( 2 / 7 ) ) = e x p ( 1 2 ) ∗ 2 7 = 0.471 \begin{aligned} \text{BLEU} &amp;= \text{BP}*exp(\sum_{n=1}^{2} w_n* \text{log} p_n) \\ &amp;= \text{BP}*exp(\sum_{n=1}^{2} \frac{1}{2}*log p_n) \\ &amp;= \text{BP}*exp( \frac{1}{2}*log(2/7) + \frac{1}{2}*log(0)) \text{\# 警告:除以零,解决:在源代码里返回了0} \\ &amp;= \text{BP}*exp( \frac{1}{2}*log(2/7)) \\ &amp;= exp( \frac{1}{2}*log(2/7)) = exp(\frac{1}{2}) * \frac{2}{7}=0.471 \end{aligned} BLEU=BPexp(n=12wnlogpn)=BPexp(n=1221logpn)=BPexp(21log(2/7)+21log(0))警告:除以零,解决:在源代码里返回了0=BPexp(21log(2/7))=exp(21log(2/7))=exp(21)72=0.471

NIST

NIST - National Institute of standards and Technology

》同现概率的几何平均 (=对数加权平均) 换成算术平均
对各阶 n-gram 同现单元的得分,取算术平均值。(原来 BLEU 是取加权平均)

》长度惩罚因子变种

Score = ∑ n = 1 N { ∑ 所 有 同 现 的   w 1 . . . w n Info ( w 1 . . . w n ) ∑ 系 统 译 文 中 所 有   w 1 . . . w n ( 1 ) } ⋅ exp ⁡ { β log ⁡ 2 [ m i n ( L s y s L r e f ‾ , 1 ) ] }   \text{Score} = \sum_{n=1}^N \{ \frac {\sum_{所有同现的 \ w_1...w_n} \text{Info}(w_1...w_n) } {\sum_{系统译文中所有\ w_1...w_n } (1) } \} · \exp \{ \beta \log^2 [ min( \frac{L_{sys}}{\overline{L_{ref}}}, 1 ) ] \} \ Score=n=1N{ w1...wn(1) w1...wnInfo(w1...wn)}exp{βlog2[min(LrefLsys,1)]} 

Info ( w 1 . . . w n ) = log ⁡ Num of  o c c u r r e n c e s   o f   w 1 . . . w n − 1 Num of  o c c u r r e n c e s   o f   w 1 . . . w n \text{Info}(w_1...w_n) = \log \frac{\text{Num of } occurrences\ of\ w_1...w_{n-1}}{\text{Num of} \ occurrences\ of\ w_1...w_{n}} Info(w1...wn)=logNum of occurrences of w1...wnNum of occurrences of w1...wn1

To do this we used the F-ratio measure, namely the between-system
score variance divided by within-system score variance.
.
F-ratios 表示的是,不同系统间的得分偏差,除以某一系统本身的得分偏差。
the superior F-ratios of information-weighted counts and the comparable correlations

计算工具 [link] [使用介绍]

BLEU 最近的相关讨论 (2019.0515)

Blend: a Novel Combined MT Metric Based on Direct Assessment - CASICT-DCU submission to WMT17 Metrics Task | Qingsong, WMT’2017

BLEU is Not Suitable for the Evaluation of Text Simplification | EMNLP 2018 (Short papers)

Metric for Automatic Machine Translation Evaluation based on Universal Sentence Representations | NAACL 2018 Student Research Workshop

Metric for Automatic Machine Translation Evaluation based on Universal Sentence Representations | Hiroki, NAACL-HLT’2018

RUSE: Regressor Using Sentence Embeddings for Automatic Machine Translation Evaluation | Hiroki, WMT’2018

BERTScore: Evaluating Text Generation with BERT | Tianyi Zhang, github, 2019

参考资料


修养 修行 涵养

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值