Update process_data.py
Browse files- process_data.py +8 -2
process_data.py
CHANGED
|
@@ -34,7 +34,7 @@ def generate_json(input_data, parameters):
|
|
| 34 |
Returns:
|
| 35 |
3 processed data-filled JSON objects: farm_pretty_json, interactions_pretty_json, trial_pretty_json
|
| 36 |
"""
|
| 37 |
-
|
| 38 |
input_text = input_data["input_text"]
|
| 39 |
model_version = parameters["model_version"]
|
| 40 |
|
|
@@ -130,6 +130,7 @@ def generate_json_pieces(input_data, parameters):
|
|
| 130 |
Returns:
|
| 131 |
(str - json) A final combined JSON containing the data filled schema for Farm Activites
|
| 132 |
"""
|
|
|
|
| 133 |
specification = input_data["input_text"]
|
| 134 |
model_version = parameters["model_version"]
|
| 135 |
|
|
@@ -345,6 +346,7 @@ def process_specifications(input_data, parameters):
|
|
| 345 |
Returns:
|
| 346 |
3 processed data-filled JSON objects: farm_pretty_json, interactions_pretty_json, trial_pretty_json
|
| 347 |
"""
|
|
|
|
| 348 |
# here is where parsing and other things will happen before
|
| 349 |
if parameters["stepwise_json_creation"] == "stepwisejsoncreation":
|
| 350 |
if parameters["pre_prompt"] == True:
|
|
@@ -386,6 +388,8 @@ def parse_survey_stack_parameters(data):
|
|
| 386 |
|
| 387 |
try:
|
| 388 |
|
|
|
|
|
|
|
| 389 |
pre_promp_parameters = data[0]['data']['group_2']
|
| 390 |
|
| 391 |
if pre_promp_parameters['preprompt']['value'][0] == 'continue_preprompts':
|
|
@@ -428,7 +432,9 @@ def parse_survey_stack_parameters(data):
|
|
| 428 |
|
| 429 |
except Exception as e:
|
| 430 |
print(f"An error occurred: {e}")
|
| 431 |
-
|
|
|
|
|
|
|
| 432 |
return processed_data
|
| 433 |
|
| 434 |
def parse_survey_stack_data(data):
|
|
|
|
| 34 |
Returns:
|
| 35 |
3 processed data-filled JSON objects: farm_pretty_json, interactions_pretty_json, trial_pretty_json
|
| 36 |
"""
|
| 37 |
+
print("Generating JSON Whole!")
|
| 38 |
input_text = input_data["input_text"]
|
| 39 |
model_version = parameters["model_version"]
|
| 40 |
|
|
|
|
| 130 |
Returns:
|
| 131 |
(str - json) A final combined JSON containing the data filled schema for Farm Activites
|
| 132 |
"""
|
| 133 |
+
print("Generating JSON Pieces!")
|
| 134 |
specification = input_data["input_text"]
|
| 135 |
model_version = parameters["model_version"]
|
| 136 |
|
|
|
|
| 346 |
Returns:
|
| 347 |
3 processed data-filled JSON objects: farm_pretty_json, interactions_pretty_json, trial_pretty_json
|
| 348 |
"""
|
| 349 |
+
print("Processing specifications")
|
| 350 |
# here is where parsing and other things will happen before
|
| 351 |
if parameters["stepwise_json_creation"] == "stepwisejsoncreation":
|
| 352 |
if parameters["pre_prompt"] == True:
|
|
|
|
| 388 |
|
| 389 |
try:
|
| 390 |
|
| 391 |
+
print("Extracting parameters")
|
| 392 |
+
|
| 393 |
pre_promp_parameters = data[0]['data']['group_2']
|
| 394 |
|
| 395 |
if pre_promp_parameters['preprompt']['value'][0] == 'continue_preprompts':
|
|
|
|
| 432 |
|
| 433 |
except Exception as e:
|
| 434 |
print(f"An error occurred: {e}")
|
| 435 |
+
|
| 436 |
+
print("Done Extracting parameters:")
|
| 437 |
+
print(str(processed_data))
|
| 438 |
return processed_data
|
| 439 |
|
| 440 |
def parse_survey_stack_data(data):
|