Spaces:
Sleeping
Sleeping
Ian Borrego Obrador
commited on
Commit
·
1b5f36c
1
Parent(s):
a63673d
small tokenizer mod for bleu
Browse files- generation_evaluator.py +8 -3
generation_evaluator.py
CHANGED
@@ -174,9 +174,14 @@ class GenerationEvaluator(evaluate.Metric):
|
|
174 |
)
|
175 |
|
176 |
# Compute BLEU
|
177 |
-
|
178 |
-
|
179 |
-
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
# Compute Exact Match
|
182 |
exact_match_results = self.exact_match_scorer.compute(
|
|
|
174 |
)
|
175 |
|
176 |
# Compute BLEU
|
177 |
+
if tokenizer is None:
|
178 |
+
bleu_results = self.bleu_scorer.compute(
|
179 |
+
predictions=predictions, references=references
|
180 |
+
)
|
181 |
+
else:
|
182 |
+
bleu_results = self.bleu_scorer.compute(
|
183 |
+
predictions=predictions, references=references, tokenizer=tokenizer
|
184 |
+
)
|
185 |
|
186 |
# Compute Exact Match
|
187 |
exact_match_results = self.exact_match_scorer.compute(
|