tarrasyed19472007 commited on
Commit
7b937b1
·
verified ·
1 Parent(s): 3dc752e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -7
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": [{"title": "Staying Positive", "url": "https://example.com/positivity"}],
30
- "videos": [{"title": "Boosting Happiness", "url": "https://www.youtube.com/watch?v=happinessboost"}],
 
 
 
 
 
 
31
  },
32
  "NEGATIVE": {
33
  "suggestions": ["Take a break to relax.", "Talk to someone you trust.", "Try mindfulness exercises."],
34
- "articles": [{"title": "Managing Stress", "url": "https://example.com/stressmanagement"}],
35
- "videos": [{"title": "Dealing with Stress", "url": "https://www.youtube.com/watch?v=stressrelief"}],
 
 
 
 
 
 
36
  },
37
  "NEUTRAL": {
38
  "suggestions": ["Take a short walk.", "Plan your next task mindfully.", "Enjoy a calming activity like reading."],
39
- "articles": [{"title": "Finding Balance", "url": "https://example.com/balance"}],
40
- "videos": [{"title": "Relaxation Techniques", "url": "https://www.youtube.com/watch?v=relaxvideo"}],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
- else: # Negative emotions
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):