Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -117,7 +117,41 @@ def get_health_professionals_and_map(current_location, health_professional_query
|
|
117 |
|
118 |
# Function to generate suggestions based on the detected emotion
|
119 |
def generate_suggestions(emotion):
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
# Gradio interface
|
123 |
def gradio_app(message, location, health_query, submit_button, history, state):
|
|
|
117 |
|
118 |
# Function to generate suggestions based on the detected emotion
|
119 |
def generate_suggestions(emotion):
|
120 |
+
if emotion == 'joy':
|
121 |
+
return [
|
122 |
+
{"Title": "Relaxation Techniques", "Subject": "Relaxation", "Link": "https://www.helpguide.org/mental-health/meditation/mindful-breathing-meditation"},
|
123 |
+
{"Title": "Dealing with Stress", "Subject": "Stress Management", "Link": "https://www.helpguide.org/mental-health/anxiety/tips-for-dealing-with-anxiety"},
|
124 |
+
{"Title": "Emotional Wellness Toolkit", "Subject": "Wellness", "Link": "https://www.nih.gov/health-information/emotional-wellness-toolkit"},
|
125 |
+
{"Title": "Relaxation Video", "Subject": "Video", "Link": "https://youtu.be/m1vaUGtyo-A"}
|
126 |
+
]
|
127 |
+
elif emotion == 'anger':
|
128 |
+
return [
|
129 |
+
{"Title": "Emotional Wellness Toolkit", "Subject": "Wellness", "Link": "https://www.nih.gov/health-information/emotional-wellness-toolkit"},
|
130 |
+
{"Title": "Stress Management Tips", "Subject": "Stress Management", "Link": "https://www.health.harvard.edu/health-a-to-z"},
|
131 |
+
{"Title": "Dealing with Anger", "Subject": "Anger Management", "Link": "https://www.helpguide.org/mental-health/anxiety/tips-for-dealing-with-anxiety"},
|
132 |
+
{"Title": "Relaxation Video", "Subject": "Video", "Link": "https://youtu.be/MIc299Flibs"}
|
133 |
+
]
|
134 |
+
elif emotion == 'fear':
|
135 |
+
return [
|
136 |
+
{"Title": "Mindfulness Practices", "Subject": "Mindfulness", "Link": "https://www.helpguide.org/mental-health/meditation/mindful-breathing-meditation"},
|
137 |
+
{"Title": "Coping with Anxiety", "Subject": "Anxiety Management", "Link": "https://www.helpguide.org/mental-health/anxiety/tips-for-dealing-with-anxiety"},
|
138 |
+
{"Title": "Emotional Wellness Toolkit", "Subject": "Wellness", "Link": "https://www.nih.gov/health-information/emotional-wellness-toolkit"},
|
139 |
+
{"Title": "Relaxation Video", "Subject": "Video", "Link": "https://youtu.be/yGKKz185M5o"}
|
140 |
+
]
|
141 |
+
elif emotion == 'sadness':
|
142 |
+
return [
|
143 |
+
{"Title": "Emotional Wellness Toolkit", "Subject": "Wellness", "Link": "https://www.nih.gov/health-information/emotional-wellness-toolkit"},
|
144 |
+
{"Title": "Dealing with Anxiety", "Subject": "Anxiety Management", "Link": "https://www.helpguide.org/mental-health/anxiety/tips-for-dealing-with-anxiety"},
|
145 |
+
{"Title": "Relaxation Video", "Subject": "Video", "Link": "https://youtu.be/-e-4Kx5px_I"}
|
146 |
+
]
|
147 |
+
elif emotion == 'surprise':
|
148 |
+
return [
|
149 |
+
{"Title": "Managing Stress", "Subject": "Stress Management", "Link": "https://www.health.harvard.edu/health-a-to-z"},
|
150 |
+
{"Title": "Coping Strategies", "Subject": "Coping", "Link": "https://www.helpguide.org/mental-health/anxiety/tips-for-dealing-with-anxiety"},
|
151 |
+
{"Title": "Relaxation Video", "Subject": "Video", "Link": "https://youtu.be/m1vaUGtyo-A"}
|
152 |
+
]
|
153 |
+
else:
|
154 |
+
return []
|
155 |
|
156 |
# Gradio interface
|
157 |
def gradio_app(message, location, health_query, submit_button, history, state):
|