未验证 提交 ca8fa90b 编写于 作者: S smallv0221 提交者: GitHub

fix bleu bug (#5065)

上级 dce498ce
......@@ -248,7 +248,7 @@ class BLEUForDuReader(BLEU):
ref_ngram = []
for ref_id, r in enumerate(yn_ref):
ref_ngram.append(get_ngram(ref_list[ref_id], n_size, label=r))
match_size, cand_size = self.get_match_size(cand_ngram, ref_ngram)
match_size, cand_size = get_match_size(cand_ngram, ref_ngram)
self.match_ngram[n_size] += self.alpha * match_size
self.candi_ngram[n_size] += self.alpha * match_size
......@@ -258,6 +258,6 @@ class BLEUForDuReader(BLEU):
ref_ngram = []
for reff_id, r in enumerate(entity_ref):
ref_ngram.append(get_ngram(r, n_size, label='ENTITY'))
match_size, cand_size = self.get_match_size(cand_ngram, ref_ngram)
match_size, cand_size = get_match_size(cand_ngram, ref_ngram)
self.match_ngram[n_size] += self.beta * match_size
self.candi_ngram[n_size] += self.beta * match_size
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册