MCPcopy Create free account
hub / github.com/deepseek-ai/DeepSeek-Coder / parse_question

Function parse_question

Evaluation/PAL-Math/utils/parser.py:282–303  ·  view source on GitHub ↗
(example, data_name)

Source from the content-addressed store, hash-verified

280
281
282def parse_question(example, data_name):
283 question = ""
284 if data_name == "asdiv":
285 question = f"{example['body'].strip()} {example['question'].strip()}"
286 elif data_name == "svamp":
287 body = example["Body"].strip()
288 if not body.endswith("."):
289 body = body + "."
290 question = f'{body} {example["Question"].strip()}'
291 elif data_name == "tabmwp":
292 title_str = f'regarding "{example["table_title"]}" ' if example['table_title'] else ""
293 question = f'Read the following table {title_str}and answer a question:\n'
294 question += f'{example["table"]}\n{example["question"]}'
295 if example['choices']:
296 question += f' Please select from the following options: {example["choices"]}'
297 else:
298 for key in ['question', 'problem', 'Question', 'input']:
299 if key in example:
300 question = example[key]
301 break
302 assert question != ""
303 return question.strip()
304
305
306def run_execute(executor, result, prompt_type, execute=False):

Callers 1

load_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected