File size: 971 Bytes
b6a1d8d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
33
34
35
import os
import json

def self_construction(datatype):
    demo_dir = "./demo_pool/{datatype}_demo".format(datatype=datatype)

    data_dir = "./data_pool/{datatype}".format(datatype=datatype)
    if os.path.exists(demo_dir):
        print(demo_dir)
    if os.path.exists(data_dir):
        with open(data_dir, 'r') as f:
            for line in f.readlines

self_construction('strategyqa')

single_data = {
            'question': "asfawreg",
            'datatype': "dfawds",
            'base_ans': "",
            'base_cots': "",
            'adapter_ans': "",
            'revised_cots': "",
            'retrieved_knowledge': "", 
            'feedback': ""
        }

data_dir = "./data_pool/{datatype}".format(datatype="test")
#with open(data_dir, 'a') as f:
#    data_json = json.dumps(single_data)
#    f.write(data_json + "\n")

with open(data_dir, 'r') as f:
    for line in f.readlines():
        data_dict = json.loads(line)
        print(type(data_dict))