MCPcopy Create free account
hub / github.com/InternScience/SciReason / extract_answer

Function extract_answer

opencompass/datasets/math.py:134–137  ·  view source on GitHub ↗
(response_text: str)

Source from the content-addressed store, hash-verified

132
133
134def extract_answer(response_text: str):
135 # We suggest to return an empty string but not None when extract failed
136 match = re.search(ANSWER_PATTERN, response_text)
137 return match.group(1) if match else ''
138
139
140@LOAD_DATASET.register_module()

Callers 1

math_judement_preprocessFunction · 0.70

Calls 1

groupMethod · 0.80

Tested by

no test coverage detected