Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,20 +90,22 @@ with gr.Blocks() as demo:
|
|
| 90 |
|
| 91 |
def uploaddetailsfromreport(report):
|
| 92 |
# Extract title
|
| 93 |
-
title = re.search(r'which title is:(.+)\n', report).group(1)
|
| 94 |
|
| 95 |
# Extract questions from summary report
|
| 96 |
questions = re.findall(r'Question \d: (.+)', report)[:3]
|
| 97 |
|
| 98 |
# Extract participant profiles and answers
|
| 99 |
-
participant_profiles = re.findall(r'// Profile (\d+) //\n(.+?)={10}', report, re.DOTALL)
|
| 100 |
-
participant_answers = re.findall(r'Participant answers:\n(.+?)\-{
|
| 101 |
|
| 102 |
# Combine all the extracted values
|
| 103 |
output = [title] + questions
|
| 104 |
-
for profile, answer in zip(participant_profiles, participant_answers):
|
| 105 |
-
output.
|
| 106 |
-
output.
|
|
|
|
|
|
|
| 107 |
return output[0], output[1], output[2], output[3], output[5], output[8], output[11], output[14], output[17], output[20], output[23], output[26], output[29], output[32], output[6], output[9], output[12], output[15], output[18], output[21], output[24], output[27], output[30], output[33]
|
| 108 |
|
| 109 |
def checkapiinput(apikey):
|
|
|
|
| 90 |
|
| 91 |
def uploaddetailsfromreport(report):
|
| 92 |
# Extract title
|
| 93 |
+
title = re.search(r'which title is:\n(.+)\n', report).group(1)
|
| 94 |
|
| 95 |
# Extract questions from summary report
|
| 96 |
questions = re.findall(r'Question \d: (.+)', report)[:3]
|
| 97 |
|
| 98 |
# Extract participant profiles and answers
|
| 99 |
+
participant_profiles = re.findall(r'// Profile (\d+) //\n(.+?)\n={10}', report, re.DOTALL)
|
| 100 |
+
participant_answers = re.findall(r'Participant answers:\n(.+?)\-{5}', report, re.DOTALL)
|
| 101 |
|
| 102 |
# Combine all the extracted values
|
| 103 |
output = [title] + questions
|
| 104 |
+
for (profile_num, profile), answer in zip(participant_profiles, participant_answers):
|
| 105 |
+
output.append(profile_num)
|
| 106 |
+
output.append(profile.strip())
|
| 107 |
+
output.append(answer.strip())
|
| 108 |
+
|
| 109 |
return output[0], output[1], output[2], output[3], output[5], output[8], output[11], output[14], output[17], output[20], output[23], output[26], output[29], output[32], output[6], output[9], output[12], output[15], output[18], output[21], output[24], output[27], output[30], output[33]
|
| 110 |
|
| 111 |
def checkapiinput(apikey):
|