提交 4dca825a 编写于 作者: S smallv0221

fix bleu bug

上级 bf483c0f
......@@ -174,7 +174,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
......@@ -184,6 +184,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.
先完成此消息的编辑!
想要评论请 注册