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

Function remove_boxed

opencompass/datasets/agieval/post_process.py:99–109  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

97 return raw_string
98
99 def remove_boxed(s):
100 left = '\\boxed{'
101 try:
102 assert s[:len(left)] == left
103 assert s[-1] == '}'
104 answer = s[len(left):-1]
105 if '=' in answer:
106 answer = answer.split('=')[-1].lstrip(' ')
107 return answer
108 except:
109 return None
110
111 def last_boxed_only_string(string):
112 idx = string.rfind('\\boxed')

Callers 1

parse_math_answerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected