diff --git a/PaddleNLP/paddlenlp/metrics/bleu.py b/PaddleNLP/paddlenlp/metrics/bleu.py index 21cce4b98df03bb666bd8da4d99f2838b34bb654..0cf261ce6a56a72474aa91491e27f687d8509e7e 100644 --- a/PaddleNLP/paddlenlp/metrics/bleu.py +++ b/PaddleNLP/paddlenlp/metrics/bleu.py @@ -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