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

Function _parse

opencompass/datasets/ProteinLMBench.py:10–24  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

8
9
10def _parse(item):
11 item['start'] = chr(65)
12 item['end'] = chr(65 + len(item.get('options', [])) - 1)
13 new_options = []
14 choices = ''
15 for i in range(len(item['options'])):
16 new_options.append(item['options'][i].split(': ')[-1])
17 choices += chr(65 +
18 i) + '. ' + item['options'][i].split(': ')[-1] + '\n'
19 item['question'] = (f'\nQuestion: {item["question"]}\n'
20 f'Answer Choices: \n{choices}')
21 item['options'] = new_options
22 item['label'] = chr(65 + int(item['answer'].split(' ')[-1]) -
23 1) # Index from 1 in answer
24 return item
25
26
27@LOAD_DATASET.register_module()

Callers 1

loadMethod · 0.70

Calls 1

getMethod · 0.80

Tested by

no test coverage detected