Update script_for_automation.py
Browse files- script_for_automation.py +40 -23
script_for_automation.py
CHANGED
|
@@ -141,22 +141,28 @@ def get_recipes():
|
|
| 141 |
my_recipes = []
|
| 142 |
for row in results:
|
| 143 |
print(f"Row ID: {row.get('id')}, Data: {row}")
|
| 144 |
-
|
|
|
|
|
|
|
| 145 |
pre_processing_strategy = row.get("Pre-Processing Strategy")
|
| 146 |
-
pre_processing_text = row.get("
|
|
|
|
| 147 |
prompting_strategy = row.get("Prompting Strategy")
|
| 148 |
plantings_and_fields_prompt = row.get("Plantings and Fields Prompting Text")
|
| 149 |
interactions_prompt = row.get("Interactions Prompting Text")
|
| 150 |
treatments_prompt = row.get("Treatments Prompting Text")
|
| 151 |
|
| 152 |
recipe_dict = {
|
| 153 |
-
"
|
| 154 |
-
"
|
| 155 |
-
"
|
| 156 |
-
"
|
| 157 |
-
"
|
| 158 |
-
"
|
| 159 |
-
"
|
|
|
|
|
|
|
|
|
|
| 160 |
}
|
| 161 |
|
| 162 |
my_recipes.append(recipe_dict)
|
|
@@ -175,6 +181,8 @@ def fill_out_survey(recipe_dict, input_data):
|
|
| 175 |
pre_processing = False
|
| 176 |
pre_process = "no"
|
| 177 |
pre_process_model_version = "None"
|
|
|
|
|
|
|
| 178 |
|
| 179 |
# Set the prompting strategy to be a variable from the list
|
| 180 |
# Do this here
|
|
@@ -190,15 +198,17 @@ def fill_out_survey(recipe_dict, input_data):
|
|
| 190 |
"secondschemaprompt": recipe_dict["interactions_prompt"],
|
| 191 |
"thirdschemaprompt": recipe_dict["treatments_prompt"],
|
| 192 |
},
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
|
|
|
|
|
|
| 202 |
}
|
| 203 |
}
|
| 204 |
|
|
@@ -213,11 +223,18 @@ def fill_out_survey(recipe_dict, input_data):
|
|
| 213 |
"secondschemaprompt": recipe_dict["interactions_prompt"],
|
| 214 |
"thirdschemaprompt": recipe_dict["treatments_prompt"],
|
| 215 |
},
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
}
|
| 222 |
}
|
| 223 |
|
|
|
|
| 141 |
my_recipes = []
|
| 142 |
for row in results:
|
| 143 |
print(f"Row ID: {row.get('id')}, Data: {row}")
|
| 144 |
+
recipe_id = row.get("Recipe ID")
|
| 145 |
+
testing_strategy_text = row.get("Testing Strategy for Set")
|
| 146 |
+
schema_processing_model = row.get("Schema Processing Model")
|
| 147 |
pre_processing_strategy = row.get("Pre-Processing Strategy")
|
| 148 |
+
pre_processing_text = row.get("Pre-Prompt Text")
|
| 149 |
+
pre_processing_model = row.get("Preprocessing Model")
|
| 150 |
prompting_strategy = row.get("Prompting Strategy")
|
| 151 |
plantings_and_fields_prompt = row.get("Plantings and Fields Prompting Text")
|
| 152 |
interactions_prompt = row.get("Interactions Prompting Text")
|
| 153 |
treatments_prompt = row.get("Treatments Prompting Text")
|
| 154 |
|
| 155 |
recipe_dict = {
|
| 156 |
+
"recipe_id": recipe_id,
|
| 157 |
+
"testing_strategy_text": testing_strategy_text,
|
| 158 |
+
"schema_processing_model", schema_processing_model,
|
| 159 |
+
"pre_processing_strategy", pre_processing_strategy,
|
| 160 |
+
"pre_processing_text", pre_processing_text,
|
| 161 |
+
"pre_processing_model", pre_processing_model,
|
| 162 |
+
"prompting_strategy", prompting_strategy,
|
| 163 |
+
"plantings_and_fields_prompt", plantings_and_fields_prompt,
|
| 164 |
+
"interactions_prompt", interactions_prompt,
|
| 165 |
+
"treatments_prompt", treatments_prompt
|
| 166 |
}
|
| 167 |
|
| 168 |
my_recipes.append(recipe_dict)
|
|
|
|
| 181 |
pre_processing = False
|
| 182 |
pre_process = "no"
|
| 183 |
pre_process_model_version = "None"
|
| 184 |
+
else:
|
| 185 |
+
pre_process = recipe_dict
|
| 186 |
|
| 187 |
# Set the prompting strategy to be a variable from the list
|
| 188 |
# Do this here
|
|
|
|
| 198 |
"secondschemaprompt": recipe_dict["interactions_prompt"],
|
| 199 |
"thirdschemaprompt": recipe_dict["treatments_prompt"],
|
| 200 |
},
|
| 201 |
+
},
|
| 202 |
+
"parameters": {
|
| 203 |
+
"modelversion": recipe_dict["schema_processing_model"],
|
| 204 |
+
"preprocessdata": ["yes"],
|
| 205 |
+
"promptstyle": recipe_dict["prompting_strategy"],
|
| 206 |
+
"preprocessmodelversion": recipe_dict["prompting_strategy"],
|
| 207 |
+
"multiplepreprompts": "no",
|
| 208 |
+
"prepromptstyle": recipe_dict["pre_processing_strategy"],
|
| 209 |
+
"preprocessingprompt1": recipe_dict["pre_processing_text"],
|
| 210 |
+
"preprocessingprompt2": "",
|
| 211 |
+
"preprocessingprompt3": ""
|
| 212 |
}
|
| 213 |
}
|
| 214 |
|
|
|
|
| 223 |
"secondschemaprompt": recipe_dict["interactions_prompt"],
|
| 224 |
"thirdschemaprompt": recipe_dict["treatments_prompt"],
|
| 225 |
},
|
| 226 |
+
}
|
| 227 |
+
"parameters": {
|
| 228 |
+
"modelversion": recipe_dict["schema_processing_model"],
|
| 229 |
+
"preprocessdata": ["no"],
|
| 230 |
+
"promptstyle": recipe_dict["prompting_strategy"],
|
| 231 |
+
"preprocessmodelversion": None,
|
| 232 |
+
"multiplepreprompts": "no",
|
| 233 |
+
"prepromptstyle": None,
|
| 234 |
+
"preprocessingprompt1": None,
|
| 235 |
+
"preprocessingprompt2": None,
|
| 236 |
+
"preprocessingprompt3": None
|
| 237 |
+
|
| 238 |
}
|
| 239 |
}
|
| 240 |
|