arjunguha commited on
Commit
33672bb
·
unverified ·
1 Parent(s): 2b8f77d
Files changed (1) hide show
  1. metrics.py +1 -0
metrics.py CHANGED
@@ -42,6 +42,7 @@ def _check_answer(completion: str, answer: str) -> bool:
42
  """
43
  completion = _answer_without_thoughts(completion).lower()
44
  completion = re.sub(r'[^\w\s]', ' ', completion) # this replaces punctuations with space, aligning with the _parse_answer function's ' '.join
 
45
  alternative_answers = _parse_answer(answer)
46
  for answer_phrases in alternative_answers:
47
  # if all(phrase in completion for phrase in answer_phrases):
 
42
  """
43
  completion = _answer_without_thoughts(completion).lower()
44
  completion = re.sub(r'[^\w\s]', ' ', completion) # this replaces punctuations with space, aligning with the _parse_answer function's ' '.join
45
+ completion = re.sub(r'[\u2000-\u200F\u202F\u205F\u3000]', ' ', completion) # replaces unicode spaces with space
46
  alternative_answers = _parse_answer(answer)
47
  for answer_phrases in alternative_answers:
48
  # if all(phrase in completion for phrase in answer_phrases):