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

Function math_postprocess

opencompass/datasets/math.py:174–181  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

172
173@TEXT_POSTPROCESSORS.register_module('math_postprocess')
174def math_postprocess(text: str) -> str:
175
176 for maybe_ans in text.split('.'):
177 if 'final answer' in maybe_ans.lower():
178 return normalize_final_answer(maybe_ans)
179 return normalize_final_answer(text.split('.')[0])
180 # return normalize_final_answer(
181 # text.split('Final Answer: ', 1)[-1].split('\n\n')[0])
182
183
184@TEXT_POSTPROCESSORS.register_module('math_judement_preprocess')

Callers

nothing calls this directly

Calls 2

normalize_final_answerFunction · 0.85
lowerMethod · 0.45

Tested by

no test coverage detected