typo
Browse files- unigram.py +2 -2
unigram.py
CHANGED
@@ -78,7 +78,7 @@ class unigram(evaluate.Metric):
|
|
78 |
)
|
79 |
|
80 |
|
81 |
-
def _prec_recall_f1_score(pred_items, gold_items):
|
82 |
"""
|
83 |
Compute precision, recall and f1 given a set of gold and prediction items.
|
84 |
:param pred_items: iterable of predicted values
|
@@ -97,7 +97,7 @@ 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 =
|
101 |
return {
|
102 |
"precision": score[0],
|
103 |
"recall": score[1],
|
|
|
78 |
)
|
79 |
|
80 |
|
81 |
+
def _prec_recall_f1_score(self, pred_items, gold_items):
|
82 |
"""
|
83 |
Compute precision, recall and f1 given a set of gold and prediction items.
|
84 |
:param pred_items: iterable of predicted values
|
|
|
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(i,j)
|
101 |
return {
|
102 |
"precision": score[0],
|
103 |
"recall": score[1],
|