MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / _normalize_ground_truth

Function _normalize_ground_truth

src/benchmarks/aime/evaluate.py:64–73  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

62
63
64def _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
76def verify_answer(model_response: str, ground_truth: str) -> bool:

Callers 1

verify_answerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected