Shaltiel commited on
Commit
5d21832
·
1 Parent(s): 22e8b00

Removed xml tags from heq score

Browse files
Files changed (1) hide show
  1. src/custom_tasks/heq_task.py +2 -1
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
- return max([tlnls(x, predictions[0]) for x in golds])
 
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",