Normalize AIME ground truth to a plain integer string. AIME answers are always integers 0-999, but some datasets include formatting like '336^\\circ'. Extract the integer.
(ground_truth: str)
| 62 | |
| 63 | |
| 64 | def _normalize_ground_truth(ground_truth: str) -> str: |
| 65 | """Normalize AIME ground truth to a plain integer string. |
| 66 | |
| 67 | AIME answers are always integers 0-999, but some datasets include |
| 68 | formatting like '336^\\circ'. Extract the integer. |
| 69 | """ |
| 70 | import re |
| 71 | |
| 72 | m = re.search(r"\d+", ground_truth) |
| 73 | return m.group(0) if m else ground_truth |
| 74 | |
| 75 | |
| 76 | def verify_answer(model_response: str, ground_truth: str) -> bool: |