Spaces:
Runtime error
Runtime error
update
Browse files- ctc_eval.py +4 -3
ctc_eval.py
CHANGED
@@ -84,12 +84,13 @@ class CTC_Eval(evaluate.EvaluationModule):
|
|
84 |
def _download_and_prepare(self, dl_manager):
|
85 |
"""Optional: download external resources useful to compute the scores"""
|
86 |
# TODO: Download external resources if needed
|
87 |
-
|
|
|
88 |
|
89 |
def _compute(self, predictions, references):
|
90 |
"""Returns the scores"""
|
91 |
# TODO: Compute the different scores of the module
|
92 |
-
|
93 |
return {
|
94 |
-
"
|
95 |
}
|
|
|
84 |
def _download_and_prepare(self, dl_manager):
|
85 |
"""Optional: download external resources useful to compute the scores"""
|
86 |
# TODO: Download external resources if needed
|
87 |
+
from ctc_score import StyleTransferScorer, SummarizationScorer, DialogScorer
|
88 |
+
self.scorer = SummarizationScorer(align='D-cnndm')
|
89 |
|
90 |
def _compute(self, predictions, references):
|
91 |
"""Returns the scores"""
|
92 |
# TODO: Compute the different scores of the module
|
93 |
+
ctc_score = self.scorer.score(doc=references, refs=[], hypo=predictions, aspect='consistency')
|
94 |
return {
|
95 |
+
"ctc_score": ctc_score,
|
96 |
}
|