arjunguha commited on
Commit
5771e25
·
1 Parent(s): 90b0249
Files changed (3) hide show
  1. metrics.py +2 -2
  2. puzzles_cleaned.csv +2 -2
  3. results.duckdb +2 -2
metrics.py CHANGED
@@ -21,7 +21,7 @@ def _parse_answer(text: str) -> List[List[str]]:
21
  alternatives = re.split(r';', text)
22
  result = [ ]
23
  for alternative in alternatives:
24
- groups = re.split(r'-->|,', alternative)
25
  result.append([" ".join(re.findall(r'\b\w+\b', group)) for group in groups])
26
  return result
27
 
@@ -42,7 +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
- 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):
 
21
  alternatives = re.split(r';', text)
22
  result = [ ]
23
  for alternative in alternatives:
24
+ groups = re.split(r'–?-?-?>|,', alternative)
25
  result.append([" ".join(re.findall(r'\b\w+\b', group)) for group in groups])
26
  return result
27
 
 
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'\s+', ' ', completion) # normalize consecutive (Unicode) spaces to finish aligning with _parse_answer
46
  alternative_answers = _parse_answer(answer)
47
  for answer_phrases in alternative_answers:
48
  # if all(phrase in completion for phrase in answer_phrases):
puzzles_cleaned.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a008da9d40adfebfa2e0fafa504aba03125c9064efd77b45dbfcb68655eb878c
3
- size 1116075
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a97676e6cfc842a0fe5cd0999a16c6523e71ef0692b125cd426cff963eabc1a
3
+ size 1117498
results.duckdb CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c7d3a9c4a997e0b6741249ba973be3c145b6f660381633d35e5eaa94353ea30f
3
- size 39333888
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:569fd5c2d797ed702e5d2551bc6a9d4d54df78481ee016bc9ee07767361525b8
3
+ size 137637888