-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabri.py
53 lines (32 loc) · 1023 Bytes
/
fabri.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python
# coding: utf-8
# In[11]:
from palm_sequence import prompt_gemini
import json
from azure import prompt_gpt
import random
# In[12]:
with open("data/h1_corrected_fabri.json") as f:
household_responses = json.load(f)
# In[13]:
scenes = list(household_responses.keys())
# In[14]:
response_users = [
key for key in household_responses[scenes[0]].keys() if key.startswith("user")
]
users_exist = len(response_users)
users_needed = 11
# In[7]:
for scene in scenes:
scene_details = household_responses[scene]["details"]
response_users = [
key for key in household_responses[scene].keys() if key.startswith("user")
]
for user in range(users_exist, users_needed):
user_copy = random.randint(1, users_exist-1)
household_responses[scene][f"user_{user}"] = household_responses[scene][
f"user_{user_copy}"
]
with open("data/h1_corrected_fabri_1.json", "w") as file:
json.dump(household_responses, file, indent=2)
# In[ ]: