Spaces:
Paused
Paused
Removed xml tags from heq score
Browse files
src/custom_tasks/heq_task.py
CHANGED
@@ -73,7 +73,8 @@ def tlnls(a_gold, a_pred):
|
|
73 |
def heq_eval_fn(golds: list[str], predictions: list[str], formatted_doc: Doc = None):
|
74 |
if len(predictions) > 1:
|
75 |
raise ValueError("Predictions should have one item")
|
76 |
-
|
|
|
77 |
|
78 |
heq_tlnls_metric = CorpusLevelMetric(
|
79 |
metric="heq_tlnls",
|
|
|
73 |
def heq_eval_fn(golds: list[str], predictions: list[str], formatted_doc: Doc = None):
|
74 |
if len(predictions) > 1:
|
75 |
raise ValueError("Predictions should have one item")
|
76 |
+
pred = re.sub('<[^>]+>', '', predictions[0]) # remove xml tags
|
77 |
+
return max([tlnls(x, pred) for x in golds])
|
78 |
|
79 |
heq_tlnls_metric = CorpusLevelMetric(
|
80 |
metric="heq_tlnls",
|