Elad commited on
Commit
ba92bd5
1 Parent(s): 38b143b

fix exact_match and f1

Browse files
Files changed (2) hide show
  1. metrics/exact_match.py +1 -1
  2. metrics/f1.py +1 -1
metrics/exact_match.py CHANGED
@@ -37,4 +37,4 @@ def compute_exact_match(predictions, references):
37
  exact_match = 0
38
  for prediction, ground_truths in zip(predictions, references):
39
  exact_match += metric_max_over_ground_truths(exact_match_score, prediction, ground_truths)
40
- return 100.0 * exact_match / len(predictions)
 
37
  exact_match = 0
38
  for prediction, ground_truths in zip(predictions, references):
39
  exact_match += metric_max_over_ground_truths(exact_match_score, prediction, ground_truths)
40
+ return {"exact_match": 100.0 * exact_match / len(predictions)}
metrics/f1.py CHANGED
@@ -53,4 +53,4 @@ def compute_f1(predictions, references):
53
  f1 = 0
54
  for prediction, ground_truths in zip(predictions, references):
55
  f1 += metric_max_over_ground_truths(f1_score, prediction, ground_truths)
56
- return 100.0 * f1 / len(predictions)
 
53
  f1 = 0
54
  for prediction, ground_truths in zip(predictions, references):
55
  f1 += metric_max_over_ground_truths(f1_score, prediction, ground_truths)
56
+ return {"f1": 100.0 * f1 / len(predictions)}