MCPcopy
hub / github.com/deepseek-ai/DeepSeek-Coder / extract_program_output

Function extract_program_output

Evaluation/PAL-Math/utils/parser.py:227–238  ·  view source on GitHub ↗

extract output between the last ```output\n...\n```

(pred_str)

Source from the content-addressed store, hash-verified

225
226
227def extract_program_output(pred_str):
228 """
229 extract output between the last ```output\n...\n```
230 """
231 if "```output" not in pred_str:
232 return ""
233 if '```output' in pred_str:
234 pred_str = pred_str.split('```output')[-1]
235 if '```' in pred_str:
236 pred_str = pred_str.split('```')[0]
237 output = pred_str.strip()
238 return output
239
240
241def parse_ground_truth(example: Dict[str, Any], data_name):

Callers 2

extract_answerFunction · 0.85
run_executeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected