1、样本类别不均衡问题
(1)统计每个token的频数
(2)采用数据增强策略、数据合成方法 缓解 样本类别不均衡问题
(3) focal loss 缓解 长尾数据分布
2、评价指标
Eval: BLEU-4 91.51 - EM 78.00 - Edit 94.42 - perplexity -1.16
BLEU-4 92.80 - EM 90.00 - Edit 95.41 - perplexity -1.19
BLEU-4 92.80
https://zhuanlan.zhihu.com/p/223048748
https://zhuanlan.zhihu.com/p/449091199
https://zhuanlan.zhihu.com/p/381123453
机器翻译评价指标 — BLEU算法 - 微笑sun - 博客园
BLEU指标是NLP中机器翻译中常用的评价指标,是基于精确率来设计的,BLEU-4就是基于4-gram来设计的,常见的还有BLEU-1、BLEU-2、BLEU-3,数字越大,对模型的评价越苛刻。
例如: string1为 123456789、string2为 123556799,BLEU-4=0
EM 90.00
上代码,精准匹配,评价的是整条的准确率,即:如果预测序列和标签序列完全相同,则为True,否则为False.
def exact_match_score(references, hypotheses):
"""Computes exact match scores.
Args:
references: list of list of tokens (one ref)
hypotheses: list of list of tokens (one hypothesis)
Returns:
exact_match: (float) 1 is perfect
"""
exact_match = 0
for ref, hypo in zip(references, hypotheses):
if np.array_equal(ref, hypo):
exact_match += 1
return exact_match / float(max(len(hypotheses), 1))
Edit 95.41
perplexity -1.19