File size: 557 Bytes
a0d95b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import json

def read_json(file_path):
    with open(file_path, 'r') as file:
        data = json.load(file)
    return data

def writer(data, path):
    with open(path, 'w') as file:
        json.dump(data, file, indent=4)

test_data_path = "testset.json"

test_data = read_json(test_data_path)

test_data_processed = []
for sample in test_data:
    test_data_processed.append({
        "instruction": sample["original_text"],
        "input": "",
        "output": "",
        "answer": str(sample["ans"]),
    })

writer(test_data_processed, "test.json")