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

Function process_jsonl

tools/convert_alignmentbench.py:48–63  ·  view source on GitHub ↗
(file_path)

Source from the content-addressed store, hash-verified

46
47
48def process_jsonl(file_path):
49 new_data = []
50 with open(file_path, 'r', encoding='utf-8') as file:
51 for line in file:
52 json_data = json.loads(line)
53 new_dict = {
54 'question': json_data['question'],
55 'capability': json_data['category'],
56 'others': {
57 'subcategory': json_data['subcategory'],
58 'reference': json_data['reference'],
59 'question_id': json_data['question_id']
60 }
61 }
62 new_data.append(new_dict)
63 return new_data
64
65
66def save_as_json(data, output_file='./alignment_bench.json'):

Callers 1

Calls 1

openFunction · 0.85

Tested by

no test coverage detected