渭南网站建设与维护,ks免费刷粉网站推广马上刷,商业门户网站怎么运营,衡水企业网站建设报价诸神缄默不语-个人CSDN博文目录
本文介绍自然语言生成任务中的各种评估指标。 因为我是之前做文本摘要才接触到这一部分内容的#xff0c;所以本文也是文本摘要中心。
持续更新。 文章目录 1. 常用术语2. ROUGE (Recall Oriented Understudy for Gisting Evaluation)1. 计算…诸神缄默不语-个人CSDN博文目录
本文介绍自然语言生成任务中的各种评估指标。 因为我是之前做文本摘要才接触到这一部分内容的所以本文也是文本摘要中心。
持续更新。 文章目录 1. 常用术语2. ROUGE (Recall Oriented Understudy for Gisting Evaluation)1. 计算指标2. 对rouge指标的更深入研究和改进 3. BLEU (Bilingual Evaluation Understudy)4. METEOR (Metric for Evaluation for Translation with Explicit Ordering)5. Perplexity6. Bertscore7. Faithfulness8. 人工评估指标9. InfoLM10. MOVERSCORE11. BEER12. BEND参考资料 1. 常用术语
模型生成的句子、预测结果——candidate 真实标签——reference、ground-truth
2. ROUGE (Recall Oriented Understudy for Gisting Evaluation)
ROUGE值是文本摘要任务重最常用的机器评估指标衡量生成文本与真实标签之间的相似程度。
precisioncandidate中匹配reference的内容占candidate比例 recallcandidate中匹配reference的内容占reference比例
示例
Reference: I work on machine learning.Candidate A: I work.Candidate B: He works on machine learning.在这个例子中用unigram可以理解为一个词或token1衡量匹配A就比B的precision更高A的匹配内容I work占candidate 100%B的on machine learning占60%但B的recall更高60% VS 40%。
出处论文(2004 WS) ROUGE: A Package for Automatic Evaluation of Summaries
感觉没有2004年之后的文本摘要论文不使用这个指标的如果看到有的话我会专门来这里提一嘴的。
分类ROUGE-N常用其中的ROUGE-1和ROUGE-2, ROUGE-LROUGE-WROUGE-S后两种不常用 原版论文中ROUGE主要关注recall值但事实上在用的时候可以用precision、recall和F值。我看到很多论文都用的是F值
1. 计算指标
每种rouge值原本都是计算recall的主要区别在于这个匹配文本的单位的选择
ROUGE-N基于n-grams如ROUGE-1计算基于匹配unigrams的recall以此类推。 ROUGE-L基于longest common subsequence (LCS) ROUGE-W基于weighted LCS ROUGE-S基于skip-bigram co-occurence statisticsskip-bigram指两个共同出现的单词不管中间隔了多远。要计算任何bigram的出现可能 C n 2 C_n^2 Cn2
以ROUGE-L为例 A A A 是candidate长度 m m m B B B 是reference长度 n n n P L C S ( A , B ) m P\frac{LCS(A,B)}{m} PmLCS(A,B) R L C S ( A , B ) n R\frac{LCS(A,B)}{n} RnLCS(A,B) F ( 1 b 2 ) R P R b 2 P F\frac{(1b^2)RP}{Rb^2P} FRb2P(1b2)RP
2. 对rouge指标的更深入研究和改进
(2018 EMNLP) A Graph-theoretic Summary Evaluation for ROUGE
批判文学(2023 ACL) Rogue Scores喷原包有bug。嘛我之前也喷过2终于有顶会论文喷了我很欣慰
3. BLEU (Bilingual Evaluation Understudy)
常用于翻译领域。 出处论文(2002 ACL) Bleu: a Method for Automatic Evaluation of Machine Translation
precision用modified n-gram precision估计recall用best match length估计。
Modified n-gram precision: n-gram precision是candidate中与reference匹配的n-grams占candidates的比例。但仅用这一指标会出现问题。 举例来说
Reference: I work on machine learning.Candidate 1: He works on machine learning.Candidate 2: He works on on machine machine learning learning.candidate 1的unigram precision有60%3/5candidate 2的有75%6/8但显然candidate 1比2更好。 为了解决这种问题我们提出了“modified” n-gram precision仅按照reference中匹配文本的出现次数来计算candidate中的出现次数。这样candidate中的on、machine和learning就各自只计算一次candidate 2的unigram precision就变成了37.5%3/8。
对多个candidate的n-gram precision求几何平均因为precision随n呈几何增长因此対数平均能更好地代表所有数值这块其实我没看懂 P r e c i s i o n exp ( ∑ n 1 N w n log p n ) , where w n 1 / n Precision\exp(\sum_{n1}^Nw_n\log p_n),\ \text{where} \ w_n1/n Precisionexp(n1∑Nwnlogpn), where wn1/n
Best match length: recall的问题在于可能存在多个reference texts故难以衡量candidate对整体reference的sensitivity这块其实我也没看懂。显然长的candidate会包含更多匹配文本但我们也已经保证了candidate不会无限长因为这样的precision可能很低。因此我们可以从惩罚candidate的简洁性文本短入手来设计recall指标 在modified n-gram precision中添加一个multiplicative factor B P BP BP B P { 1 , if c r exp ( 1 − r c ) , otherwise \begin{aligned} BP\begin{cases}1, \text{if}\ c r\\ \exp \left( 1-\dfrac{r}{c}\right) ,\text{otherwise}\end{cases} \end{aligned} BP{1,exp(1−cr),if crotherwise 其中 c c c 是candidates总长度 r r r 是reference有效长度如reference长度平均值随着candidate长度 c c c下降 B P BP BP 也随之减少起到了惩罚短句的作用。
4. METEOR (Metric for Evaluation for Translation with Explicit Ordering)
常用于翻译领域。
出处(2005) METEOR: An Automatic Metric for MT Evaluation with Improved Correlation with Human Judgments
BLEU的问题在于 B P BP BP 值所用的长度是平均值因此单句得分不清晰。而METEOR调整了precision和recall的计算方式用基于mapping unigrams的weighted F-score和penalty function for incorrect word order来代替。
Weighted F-score: 首先我们要找到candidate和reference间最大的可以形成对齐alignment的映射mappings子集subset。在经过Porter stemming[^3]、用了WordNet同义词后假设找到的对齐数是 m m m则precision就是 m / c m/c m/c c c c 是candidate长度、recall是 m / r m/r m/r r r r 是reference长度F就是 F P R α P ( 1 − α ) R F\frac{PR}{\alpha P(1-\alpha)R} FαP(1−α)RPR
Penalty function: 考虑candidate中的单词顺序 P e n a l t y γ ( c m ) β , where 0 ≤ γ ≤ 1 Penalty\gamma(\frac{c}{m})^\beta,\ \text{where}\ 0\leq\gamma\leq1 Penaltyγ(mc)β, where 0≤γ≤1 其中 c c c 是matching chunks数 m m m 是matches总数。因此如果大多数matches是连续的 c c c 就会小penalty就会低。这部分我的理解是连续的matches组成一个chunk。但我不确定可能我会去查阅更多资料。
最终METEOR得分的计算方式为 ( 1 − P e n a l t y ) F (1-Penalty)F (1−Penalty)F
5. Perplexity
常用于语言模型训练。 待补。
6. Bertscore
使用该指标的论文Rewards with Negative Examples for Reinforced Topic-Focused Abstractive Summarization 待补。
7. Faithfulness
Entailment Ranking Generated Summaries by Correctness: An Interesting but Challenging Application for Natural Language Inference用预训练的基于entailment的方法评估原文蕴含生成摘要的概率FactCC Evaluating the Factual Consistency of Abstractive Text Summarization用基于规则的变换生成假摘要训练基于Bert的模型分类生成摘要是否faithfulDAE Annotating and Modeling Fine-grained Factuality in Summarization收集细粒度的词/依赖/句级别的faithfulness的标注用这些标注训练factuality检测模型
8. 人工评估指标
文本的流畅程度、对原文的忠实程度、对原文重要内容的包含程度、语句的简洁程度等
9. InfoLM
出处论文(2022 AAAI) InfoLM: A New Metric to Evaluate Summarization Data2Text Generation 待补。
10. MOVERSCORE
待补
11. BEER
待补。
12. BEND
待补。
参考资料
Metrics for NLG evaluation. Simple natural language processing… | by Desh Raj | Explorations in Language and Learning | Medium我还没看等我看完了补上 Revisiting Automatic Evaluation of Extractive Summarization Task: Can We Do Better than ROUGE? Benchmarking Answer Verification Methods for Question Answering-Based Summarization Evaluation Metrics SARI InfoLM: A New Metric to Evaluate Summarization Data2Text Generation SPICE Play the Shannon Game With Language Models: A Human-Free Approach to Summary Evaluation Reference-free Summarization Evaluation via Semantic Correlation and Compression Ratio 参考unigram_百度百科 父词条n-gram unigram: 1个word bigram: 2个word trigram : 3个word 注意此处的word是英文的概念在中文中可能会根据需要指代字或词 中文中如果用字作为基本单位示例 西安交通大学 unigram 形式为西/安/交/通/大/学 bigram形式为 西安/安交/交通/通大/大学 trigram形式为西安交/安交通/交通大/通大学 ↩︎ pyrouge和rouge在Linux上的安装方法以及结果比较 ↩︎
文章转载自: http://www.morning.bfysg.cn.gov.cn.bfysg.cn http://www.morning.routalr.cn.gov.cn.routalr.cn http://www.morning.nfyc.cn.gov.cn.nfyc.cn http://www.morning.jjzrh.cn.gov.cn.jjzrh.cn http://www.morning.tqqfj.cn.gov.cn.tqqfj.cn http://www.morning.btpll.cn.gov.cn.btpll.cn http://www.morning.dgsx.cn.gov.cn.dgsx.cn http://www.morning.tpkxs.cn.gov.cn.tpkxs.cn http://www.morning.ptxwg.cn.gov.cn.ptxwg.cn http://www.morning.qctsd.cn.gov.cn.qctsd.cn http://www.morning.jhfkr.cn.gov.cn.jhfkr.cn http://www.morning.xjmyq.com.gov.cn.xjmyq.com http://www.morning.rqjfm.cn.gov.cn.rqjfm.cn http://www.morning.nslwj.cn.gov.cn.nslwj.cn http://www.morning.kdnrp.cn.gov.cn.kdnrp.cn http://www.morning.snrhg.cn.gov.cn.snrhg.cn http://www.morning.qjzgj.cn.gov.cn.qjzgj.cn http://www.morning.ryfq.cn.gov.cn.ryfq.cn http://www.morning.nspbj.cn.gov.cn.nspbj.cn http://www.morning.nmymn.cn.gov.cn.nmymn.cn http://www.morning.dkqbc.cn.gov.cn.dkqbc.cn http://www.morning.ynjhk.cn.gov.cn.ynjhk.cn http://www.morning.nbqwt.cn.gov.cn.nbqwt.cn http://www.morning.ycgrl.cn.gov.cn.ycgrl.cn http://www.morning.trpq.cn.gov.cn.trpq.cn http://www.morning.ctpfq.cn.gov.cn.ctpfq.cn http://www.morning.wnrcj.cn.gov.cn.wnrcj.cn http://www.morning.jjxnp.cn.gov.cn.jjxnp.cn http://www.morning.dkfb.cn.gov.cn.dkfb.cn http://www.morning.wzdjl.cn.gov.cn.wzdjl.cn http://www.morning.ghxtk.cn.gov.cn.ghxtk.cn http://www.morning.jynzb.cn.gov.cn.jynzb.cn http://www.morning.rttkl.cn.gov.cn.rttkl.cn http://www.morning.xmyrn.cn.gov.cn.xmyrn.cn http://www.morning.qbrs.cn.gov.cn.qbrs.cn http://www.morning.rydhq.cn.gov.cn.rydhq.cn http://www.morning.sjsks.cn.gov.cn.sjsks.cn http://www.morning.fglxh.cn.gov.cn.fglxh.cn http://www.morning.bqfpm.cn.gov.cn.bqfpm.cn http://www.morning.yjmns.cn.gov.cn.yjmns.cn http://www.morning.lyhrg.cn.gov.cn.lyhrg.cn http://www.morning.rppf.cn.gov.cn.rppf.cn http://www.morning.kyflr.cn.gov.cn.kyflr.cn http://www.morning.qmwzz.cn.gov.cn.qmwzz.cn http://www.morning.rynq.cn.gov.cn.rynq.cn http://www.morning.bwnd.cn.gov.cn.bwnd.cn http://www.morning.fnkcg.cn.gov.cn.fnkcg.cn http://www.morning.cczrw.cn.gov.cn.cczrw.cn http://www.morning.zsyqg.cn.gov.cn.zsyqg.cn http://www.morning.mdjtk.cn.gov.cn.mdjtk.cn http://www.morning.xqbbc.cn.gov.cn.xqbbc.cn http://www.morning.nkkr.cn.gov.cn.nkkr.cn http://www.morning.zxqxx.cn.gov.cn.zxqxx.cn http://www.morning.mnsmb.cn.gov.cn.mnsmb.cn http://www.morning.nzmhk.cn.gov.cn.nzmhk.cn http://www.morning.lgznf.cn.gov.cn.lgznf.cn http://www.morning.qqklk.cn.gov.cn.qqklk.cn http://www.morning.grpfj.cn.gov.cn.grpfj.cn http://www.morning.rccbt.cn.gov.cn.rccbt.cn http://www.morning.tqrbl.cn.gov.cn.tqrbl.cn http://www.morning.pntzg.cn.gov.cn.pntzg.cn http://www.morning.zmpqh.cn.gov.cn.zmpqh.cn http://www.morning.qmzwl.cn.gov.cn.qmzwl.cn http://www.morning.xhpnp.cn.gov.cn.xhpnp.cn http://www.morning.xrwbc.cn.gov.cn.xrwbc.cn http://www.morning.ydxwj.cn.gov.cn.ydxwj.cn http://www.morning.lxmks.cn.gov.cn.lxmks.cn http://www.morning.fbxlj.cn.gov.cn.fbxlj.cn http://www.morning.jwbfj.cn.gov.cn.jwbfj.cn http://www.morning.ssgqc.cn.gov.cn.ssgqc.cn http://www.morning.rmtmk.cn.gov.cn.rmtmk.cn http://www.morning.hsrch.cn.gov.cn.hsrch.cn http://www.morning.cybch.cn.gov.cn.cybch.cn http://www.morning.tkryt.cn.gov.cn.tkryt.cn http://www.morning.hqzmz.cn.gov.cn.hqzmz.cn http://www.morning.jwbnm.cn.gov.cn.jwbnm.cn http://www.morning.ckdgj.cn.gov.cn.ckdgj.cn http://www.morning.kzrbd.cn.gov.cn.kzrbd.cn http://www.morning.zsyrk.cn.gov.cn.zsyrk.cn http://www.morning.rongxiaoman.com.gov.cn.rongxiaoman.com