Spaces:
Paused
Paused
Fix winograd task comparison
Browse files
src/custom_tasks/winograd_task.py
CHANGED
@@ -14,7 +14,7 @@ def winograd_eval_fn(golds: list[str], predictions: list[str], formatted_doc: Do
|
|
14 |
if len(predictions) > 1:
|
15 |
raise ValueError("Predictions should have one item")
|
16 |
# do some santizations, since some models produce more info
|
17 |
-
pred = re.sub('<[^>]+>', '', predictions[0]) # remove xml tags
|
18 |
return 1 if pred == golds[0] else 0
|
19 |
|
20 |
winograd_acc_metric = CorpusLevelMetric(
|
|
|
14 |
if len(predictions) > 1:
|
15 |
raise ValueError("Predictions should have one item")
|
16 |
# do some santizations, since some models produce more info
|
17 |
+
pred = re.sub('<[^>]+>', '', predictions[0]).strip() # remove xml tags
|
18 |
return 1 if pred == golds[0] else 0
|
19 |
|
20 |
winograd_acc_metric = CorpusLevelMetric(
|