-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhuman.py
38 lines (28 loc) · 1 KB
/
human.py
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
36
37
38
import json
file = "examples_v2"
with open(f'{file}.jsonl', 'r') as in_file:
with open(f'{file}_strong.jsonl', 'w') as strong_file:
with open(f'{file}_weak.jsonl', 'w') as weak_file:
while True:
line = in_file.readline()
if not line:
break
data = json.loads(line)
prompt = data["prompt"]
print(f'\nPrompt:\n\n{prompt}')
meaningful = None
while True:
print(f'\nIs this a meaningful prompt (y/n):')
i = input()
if i == "n":
meaningful = False
break
elif i == "y":
meaningful = True
break
else:
continue
if meaningful:
strong_file.write(line)
else:
weak_file.write(line)