Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,18 +26,47 @@ moods = [
|
|
| 26 |
suggestion_database = {
|
| 27 |
"POSITIVE": {
|
| 28 |
"suggestions": ["Celebrate your success!", "Share your happiness with someone.", "Reflect on what makes you feel this way."],
|
| 29 |
-
"articles": [
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
},
|
| 32 |
"NEGATIVE": {
|
| 33 |
"suggestions": ["Take a break to relax.", "Talk to someone you trust.", "Try mindfulness exercises."],
|
| 34 |
-
"articles": [
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
},
|
| 37 |
"NEUTRAL": {
|
| 38 |
"suggestions": ["Take a short walk.", "Plan your next task mindfully.", "Enjoy a calming activity like reading."],
|
| 39 |
-
"articles": [
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
},
|
| 42 |
}
|
| 43 |
|
|
@@ -47,8 +76,10 @@ def map_mood_to_category(mood):
|
|
| 47 |
return "POSITIVE"
|
| 48 |
elif mood in ["Dull", "Neutral", "Tired", "Bored", "Lonely"]:
|
| 49 |
return "NEUTRAL"
|
| 50 |
-
|
| 51 |
return "NEGATIVE"
|
|
|
|
|
|
|
| 52 |
|
| 53 |
# Function to suggest activities based on the mood
|
| 54 |
def suggest_activity(mood):
|
|
|
|
| 26 |
suggestion_database = {
|
| 27 |
"POSITIVE": {
|
| 28 |
"suggestions": ["Celebrate your success!", "Share your happiness with someone.", "Reflect on what makes you feel this way."],
|
| 29 |
+
"articles": [
|
| 30 |
+
{"title": "Emotional Wellness Toolkit", "url": "https://www.nih.gov/health-information/emotional-wellness-toolkit"},
|
| 31 |
+
{"title": "Health A to Z", "url": "https://www.health.harvard.edu/health-a-to-z"},
|
| 32 |
+
],
|
| 33 |
+
"videos": [
|
| 34 |
+
{"title": "Boosting Happiness", "url": "https://youtu.be/m1vaUGtyo-A"},
|
| 35 |
+
{"title": "Motivational Short Video", "url": "https://www.youtube.com/shorts/Tq49ajl7c8Q?feature=share"},
|
| 36 |
+
],
|
| 37 |
},
|
| 38 |
"NEGATIVE": {
|
| 39 |
"suggestions": ["Take a break to relax.", "Talk to someone you trust.", "Try mindfulness exercises."],
|
| 40 |
+
"articles": [
|
| 41 |
+
{"title": "Tips for Dealing with Anxiety", "url": "https://www.helpguide.org/mental-health/anxiety/tips-for-dealing-with-anxiety"},
|
| 42 |
+
{"title": "Mindful Breathing Meditation", "url": "https://www.helpguide.org/mental-health/meditation/mindful-breathing-meditation"},
|
| 43 |
+
],
|
| 44 |
+
"videos": [
|
| 45 |
+
{"title": "Coping with Anxiety", "url": "https://youtu.be/MIc299Flibs"},
|
| 46 |
+
{"title": "Relaxation Techniques", "url": "https://www.youtube.com/shorts/fwH8Ygb0K60?feature=share"},
|
| 47 |
+
],
|
| 48 |
},
|
| 49 |
"NEUTRAL": {
|
| 50 |
"suggestions": ["Take a short walk.", "Plan your next task mindfully.", "Enjoy a calming activity like reading."],
|
| 51 |
+
"articles": [
|
| 52 |
+
{"title": "Finding Balance", "url": "https://www.health.harvard.edu/health-a-to-z"},
|
| 53 |
+
{"title": "Emotional Wellness Toolkit", "url": "https://www.nih.gov/health-information/emotional-wellness-toolkit"},
|
| 54 |
+
],
|
| 55 |
+
"videos": [
|
| 56 |
+
{"title": "Mindfulness for Beginners", "url": "https://youtu.be/Y8HIFRPU6pM"},
|
| 57 |
+
{"title": "Peaceful Mind Short", "url": "https://www.youtube.com/shorts/hTXMi7ZBKdM?feature=share"},
|
| 58 |
+
],
|
| 59 |
+
},
|
| 60 |
+
"STRESSED": {
|
| 61 |
+
"suggestions": ["Practice deep breathing exercises.", "Write down your thoughts to release stress.", "Spend time in a quiet environment."],
|
| 62 |
+
"articles": [
|
| 63 |
+
{"title": "Mindful Breathing Meditation", "url": "https://www.helpguide.org/mental-health/meditation/mindful-breathing-meditation"},
|
| 64 |
+
{"title": "Tips for Dealing with Anxiety", "url": "https://www.helpguide.org/mental-health/anxiety/tips-for-dealing-with-anxiety"},
|
| 65 |
+
],
|
| 66 |
+
"videos": [
|
| 67 |
+
{"title": "Managing Stress", "url": "https://youtu.be/-e-4Kx5px_I"},
|
| 68 |
+
{"title": "Overcoming Overwhelm", "url": "https://www.youtube.com/shorts/fwH8Ygb0K60?feature=share"},
|
| 69 |
+
],
|
| 70 |
},
|
| 71 |
}
|
| 72 |
|
|
|
|
| 76 |
return "POSITIVE"
|
| 77 |
elif mood in ["Dull", "Neutral", "Tired", "Bored", "Lonely"]:
|
| 78 |
return "NEUTRAL"
|
| 79 |
+
elif mood in ["Angry", "Frustrated", "Anxious", "Stressed", "Overwhelmed"]:
|
| 80 |
return "NEGATIVE"
|
| 81 |
+
else:
|
| 82 |
+
return "STRESSED"
|
| 83 |
|
| 84 |
# Function to suggest activities based on the mood
|
| 85 |
def suggest_activity(mood):
|