ckb commited on
Commit
c0f684d
·
1 Parent(s): e7eae00

more type things?

Browse files
Files changed (1) hide show
  1. unigram.py +3 -3
unigram.py CHANGED
@@ -97,10 +97,10 @@ class unigram(evaluate.Metric):
97
  def _compute(self, predictions, references):
98
  """Returns the scores"""
99
  # TODO: Compute the different scores of the module
100
- score = self._prec_recall_f1_score(predictions, references)
 
101
  return {
102
  "precision": score[0],
103
  "recall": score[1],
104
- "f1": score[2],
105
-
106
  }
 
97
  def _compute(self, predictions, references):
98
  """Returns the scores"""
99
  # TODO: Compute the different scores of the module
100
+ score = sum([self._prec_recall_f1_score(i, j) for i, j in zip(predictions, references)]) / float(len(predictions))
101
+
102
  return {
103
  "precision": score[0],
104
  "recall": score[1],
105
+ "f1": score[2],
 
106
  }