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

Function _parse

opencompass/datasets/medmcqa.py:12–28  ·  view source on GitHub ↗
(item, prompt_mode)

Source from the content-addressed store, hash-verified

10
11
12def _parse(item, prompt_mode):
13 options_list = [item['opa'], item['opb'], item['opc'], item['opd']]
14 item['options'] = options_list
15
16 # 构建带标号的选项字符串
17 options_str = '\n'.join(
18 [f'{chr(65 + i)}. {opt}' for i, opt in enumerate(options_list)])
19
20 # 将选项附加到问题末尾
21 item['question'] = f"{item['question']}\n{options_str}"
22
23 item['label'] = chr(65 + item['cop'])
24 item['subject_name'] = item['subject_name'].replace('_', ' ')
25 item['prompt_mode'] = prompt_mode
26 item['start'] = chr(65)
27 item['end'] = chr(65 + len(options_list) - 1) # 使用实际选项数量
28 return item
29
30
31@LOAD_DATASET.register_module()

Callers 1

loadMethod · 0.70

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected