Martin Dočekal
commited on
Commit
·
aeb0f96
1
Parent(s):
f9431b7
naming change
Browse files- rouge_raw.py +3 -3
rouge_raw.py
CHANGED
@@ -43,7 +43,7 @@ import datasets
|
|
43 |
import evaluate
|
44 |
|
45 |
|
46 |
-
class
|
47 |
"""
|
48 |
This is the original implementation of the ROUGERaw metric.
|
49 |
Compute RougeRAW-1, RougeRAW-2, RougeRAW-L metrics.
|
@@ -196,7 +196,7 @@ Examples:
|
|
196 |
|
197 |
|
198 |
@evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
|
199 |
-
class
|
200 |
def _info(self):
|
201 |
return evaluate.MetricInfo(
|
202 |
description=_DESCRIPTION,
|
@@ -216,7 +216,7 @@ class Rouge(evaluate.Metric):
|
|
216 |
)
|
217 |
|
218 |
def _compute(self, predictions: Sequence[str], references: Sequence[str]):
|
219 |
-
res =
|
220 |
return {
|
221 |
"rougeraw1_precision": res["1"].p,
|
222 |
"rougeraw1_recall": res["1"].r,
|
|
|
43 |
import evaluate
|
44 |
|
45 |
|
46 |
+
class RougeRawOriginal:
|
47 |
"""
|
48 |
This is the original implementation of the ROUGERaw metric.
|
49 |
Compute RougeRAW-1, RougeRAW-2, RougeRAW-L metrics.
|
|
|
196 |
|
197 |
|
198 |
@evaluate.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
|
199 |
+
class RougeRaw(evaluate.Metric):
|
200 |
def _info(self):
|
201 |
return evaluate.MetricInfo(
|
202 |
description=_DESCRIPTION,
|
|
|
216 |
)
|
217 |
|
218 |
def _compute(self, predictions: Sequence[str], references: Sequence[str]):
|
219 |
+
res = RougeRawOriginal().corpus(references, predictions)
|
220 |
return {
|
221 |
"rougeraw1_precision": res["1"].p,
|
222 |
"rougeraw1_recall": res["1"].r,
|