Spaces:
Paused
Paused
Working version
Browse files- test_parascore.py +4 -4
test_parascore.py
CHANGED
@@ -119,16 +119,16 @@ class test_parascore(evaluate.Metric):
|
|
119 |
elif div < thresh:
|
120 |
ss = -1 + ((thresh + 1) / thresh) * div
|
121 |
diversity.append(ss)
|
122 |
-
return diversity
|
123 |
|
124 |
def _compute(self, predictions, references, lang='en'):
|
125 |
"""Returns the scores"""
|
126 |
|
127 |
score = self.score.compute(predictions=predictions, references=references, lang=lang)
|
128 |
-
bert_score = round(score['f1']
|
129 |
diversity = self._diverse(predictions, references, lang)
|
130 |
|
131 |
-
score =
|
132 |
return {
|
133 |
-
"
|
134 |
}
|
|
|
119 |
elif div < thresh:
|
120 |
ss = -1 + ((thresh + 1) / thresh) * div
|
121 |
diversity.append(ss)
|
122 |
+
return diversity
|
123 |
|
124 |
def _compute(self, predictions, references, lang='en'):
|
125 |
"""Returns the scores"""
|
126 |
|
127 |
score = self.score.compute(predictions=predictions, references=references, lang=lang)
|
128 |
+
bert_score = [round(v, 2) for v in score['f1']]
|
129 |
diversity = self._diverse(predictions, references, lang)
|
130 |
|
131 |
+
score = [s + 0.05 * d for s, d in zip(bert_score, diversity)]
|
132 |
return {
|
133 |
+
"score": score,
|
134 |
}
|