一个实例彻底理解Transformer模型中的BLEU值评价指标

案例

模型预测或测试验证集的句子:

the cat sat on the mat

标准文章中的句子:

 the cat is on the mat

当是BLEU2的情况时(句子在连续相邻2位置取出进行BLEU值计算),以上句子连续的各个bleu的值如下:对 candidate中的5个词,{the cat,cat sat,sat on,on the,the mat} ,查找是否在reference中,发现有3个词在reference中,所以占比就是0.6

其他的也类似,不太理解可以参考文章链接
在这里插入图片描述

transformer:https://proceedings.neurips.cc/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf

参考

https://jalammar.github.io/illustrated-transformer/
https://zhuanlan.zhihu.com/p/223048748
https://www.jianshu.com/p/bb7935f5c717
https://en.wikipedia.org/wiki/Attention_(machine_learning)
https://huggingface.co/docs/transformers/index
https://www.jianshu.com/p/a880dc0990c8

猜你喜欢

转载自blog.csdn.net/weixin_41194129/article/details/126701417