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

Method clean

opencompass/datasets/math_intern.py:129–135  ·  view source on GitHub ↗
(cls, target_str: str)

Source from the content-addressed store, hash-verified

127 return target_str[:i]
128
129 def clean(cls, target_str: str):
130 opt = target_str.strip().replace('{{', '{').replace('}}', '}')
131 if not opt:
132 return opt
133 if opt[-1] == '.' or opt[-1] == '。':
134 return opt[:-1]
135 return opt
136
137 def extract_answer(cls, pred: str, extract_last_num=False):
138 if pred.find('The final answer is ') >= 0:

Callers 1

extract_answerMethod · 0.80

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected