Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files
app.py
CHANGED
|
@@ -34,7 +34,47 @@ lang_codes = {
|
|
| 34 |
# List of harmful or dangerous keywords
|
| 35 |
harmful_keywords = [
|
| 36 |
"suicide", "kill myself", "end my life", "harm myself", "cut myself",
|
| 37 |
-
"want to die", "die", "jump off", "self-harm", "give up", "not worth it", "ending it all"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
]
|
| 39 |
|
| 40 |
# Harmful word detection response
|
|
@@ -146,7 +186,159 @@ emotions = {
|
|
| 146 |
"crushed": "That sounds painful. Let’s unpack it together.",
|
| 147 |
"troubled": "Name the trouble, then tame it. I’m here.",
|
| 148 |
"underestimated": "You are more than they think. Show them. Gently.",
|
| 149 |
-
"burned out": "Burnout needs healing. Step back to move forward."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
}
|
| 151 |
|
| 152 |
# Save personal information
|
|
@@ -291,5 +483,4 @@ def next_study_tip():
|
|
| 291 |
</iframe>
|
| 292 |
'''
|
| 293 |
)
|
| 294 |
-
|
| 295 |
app.launch()
|
|
|
|
| 34 |
# List of harmful or dangerous keywords
|
| 35 |
harmful_keywords = [
|
| 36 |
"suicide", "kill myself", "end my life", "harm myself", "cut myself",
|
| 37 |
+
"want to die", "die", "jump off", "self-harm", "give up", "not worth it", "ending it all","abomination", "abysmal", "agony", "alcohol", "alien", "anger", "angsty", "annihilate", "anti", "arson",
|
| 38 |
+
"ass", "assault", "atrocity", "awful", "backstab", "backstabber", "barbaric", "barbarian", "beast", "belittle",
|
| 39 |
+
"berserk", "betray", "betrayal", "bigot", "bigoted", "bitter", "blacklist", "blasphemy", "blind", "blockhead",
|
| 40 |
+
"blood", "bloodbath", "bloody", "blunder", "boastful", "bogus", "bomb", "bonehead", "brainless", "brutal",
|
| 41 |
+
"brute", "brutality", "burn", "butcher", "cage", "caged", "callous", "cancer", "careless", "chaos",
|
| 42 |
+
"cheap", "cheater", "childish", "clueless", "coarse", "cold-blooded", "con", "conman", "contempt", "contradict",
|
| 43 |
+
"corrupt", "cowardly", "crash", "craze", "crazed", "creepy", "crime", "criminality", "crook", "cruel",
|
| 44 |
+
"cruelty", "crybaby", "curseword", "cynical", "damage", "damaging", "danger", "dangerous", "dark", "deadly",
|
| 45 |
+
"deceit", "deceitful", "deceive", "deceiver", "deceptive", "defame", "defeat", "defeated", "defiance", "defiant",
|
| 46 |
+
"degenerate", "demented", "demon", "despise", "destroy", "destruction", "destructive", "devastate", "devil", "diabolical",
|
| 47 |
+
"dictator", "die", "dirty", "disaster", "disgust", "disgusted", "dishonor", "dishonest", "disloyal", "dismiss",
|
| 48 |
+
"disrespect", "disturb", "divisive", "doom", "doomed", "dread", "dreadful", "drunk", "drunkard", "dumbass",
|
| 49 |
+
"dungeon", "egotistical", "enemies", "enemy", "enrage", "evilness", "exile", "exploit", "exterminate", "fake",
|
| 50 |
+
"fakeness", "fallen", "fanatic", "fascist", "fatal", "filthy", "fire", "flawed", "foolish", "forbid",
|
| 51 |
+
"forceful", "forgery", "foul", "fraud", "fraudster", "freakish", "frighten", "frightful", "gang", "gangster",
|
| 52 |
+
"ghastly", "ghost", "ghoul", "gloom", "gory", "grief", "gross", "grotesque", "gruesome", "grumpy",
|
| 53 |
+
"guilty", "hag", "halfwit", "hardhearted", "harm", "harsh", "hateable", "hateful", "havoc", "hell",
|
| 54 |
+
"hellish", "heretic", "hideous", "horrid", "horrific", "hostility", "howl", "hurt", "hypocrite", "hypocrisy",
|
| 55 |
+
"idiotic", "idiocy", "ignoramus", "ill", "illegal", "illicit", "immature", "immoral", "imposter", "incapable",
|
| 56 |
+
"incompetent", "indecent", "indifference", "indifferent", "infect", "inferior", "infuriate", "inhuman", "inhumane", "injure",
|
| 57 |
+
"insensitive", "insidious", "insolent", "intolerant", "irate", "irritate", "irritating", "jerky", "joke", "joker",
|
| 58 |
+
"kidnap", "killjoy", "knock", "lawless", "liability", "lie", "loath", "loathsome", "lowlife", "madness",
|
| 59 |
+
"malicious", "malign", "manipulate", "menace", "mess", "messy", "miser", "mock", "mocking", "monster",
|
| 60 |
+
"monstrous", "moody", "mug", "murderous", "mutant", "mutiny", "nag", "nasty", "nefarious", "neglect",
|
| 61 |
+
"negative", "nemesis", "nonsense", "nosy", "obnoxious", "offend", "offender", "ominous", "oppress", "outrage",
|
| 62 |
+
"outrageous", "pain", "painful", "parasite", "pariah", "partisan", "peculiar", "penalty", "perish", "pest",
|
| 63 |
+
"petrify", "pitiful", "plague", "poison", "poisonous", "pollute", "poverty", "prejudice", "pretend", "problem",
|
| 64 |
+
"psychopath", "punch", "punish", "punishment", "quarrel", "quitter", "rage", "ragged", "rat", "rebellion",
|
| 65 |
+
"reckless", "rejects", "repel", "repulsive", "revolt", "revolting", "rioter", "rob", "robber", "rotten",
|
| 66 |
+
"rough", "ruin", "ruined", "rupture", "savage", "scar", "scare", "scared", "scary", "schemer",
|
| 67 |
+
"scold", "scorn", "scoundrel", "scream", "screwed", "self-hate", "selfishness", "serpent", "shady", "sham",
|
| 68 |
+
"shameful", "shatter", "shocking", "silly", "sin", "sinister", "skeptic", "slavey", "slimy", "slum",
|
| 69 |
+
"smash", "smelly", "smite", "snob", "snobbish", "snub", "sob", "sorrow", "spite", "spiteful",
|
| 70 |
+
"stab", "stench", "stink", "storm", "stress", "stressed", "strike", "struggle", "stubborn", "subvert",
|
| 71 |
+
"suicidal", "suspicious", "taint", "tantrum", "target", "tease", "terrible", "terrify", "thief", "threat",
|
| 72 |
+
"threaten", "thug", "torment", "torture", "tragic", "trap", "trauma", "trick", "trigger", "trouble",
|
| 73 |
+
"troubling", "ugliness", "uncivilized", "undermine", "unfair", "unhappy", "unjust", "unkind", "unlucky", "unpleasant",
|
| 74 |
+
"unworthy", "upset", "usurper", "vandal", "vandalize", "venom", "venomous", "villain", "villainous", "vindictive",
|
| 75 |
+
"violent", "viper", "vulgarity", "war", "warmonger", "waste", "wasteful", "wickedness", "wild", "wound",
|
| 76 |
+
"wrath", "wreck", "wrong", "yell", "yucky", "zero", "zombie"
|
| 77 |
+
|
| 78 |
]
|
| 79 |
|
| 80 |
# Harmful word detection response
|
|
|
|
| 186 |
"crushed": "That sounds painful. Let’s unpack it together.",
|
| 187 |
"troubled": "Name the trouble, then tame it. I’m here.",
|
| 188 |
"underestimated": "You are more than they think. Show them. Gently.",
|
| 189 |
+
"burned out": "Burnout needs healing. Step back to move forward.",
|
| 190 |
+
"stress" : "Take 3 deep breaths and relax your shoulders.",
|
| 191 |
+
"stressful" : "Break tasks into smaller steps to feel less overwhelmed.",
|
| 192 |
+
"anxiety" : "Focus on slow breathing for 5 minutes to calm your mind.",
|
| 193 |
+
"panic" : "Ground yourself by naming 5 things you see around you.",
|
| 194 |
+
"fear" : "Write down your fear and list why it may not be true.",
|
| 195 |
+
"anger" : "Walk away for a moment and count to 10.",
|
| 196 |
+
"rage" : "Listen to calming music to release intense anger.",
|
| 197 |
+
"sadness" : "Call a friend or talk to someone who cares.",
|
| 198 |
+
"grief" : "Allow yourself to cry and express your emotions.",
|
| 199 |
+
"trauma" : "Practice grounding exercises like touching nearby objects.",
|
| 200 |
+
"abuse" : "Remember, you deserve respect—consider reaching out for help.",
|
| 201 |
+
"depression" : "Take a short walk outside and notice nature.",
|
| 202 |
+
"loneliness" : "Text someone you trust to connect.",
|
| 203 |
+
"hopeless" : "Think of one small goal you can achieve today.",
|
| 204 |
+
"exhausted" : "Drink water and rest for at least 10 minutes.",
|
| 205 |
+
"overwhelmed" : "Make a priority list and focus on just 1 thing.",
|
| 206 |
+
"nervous" : "Practice positive affirmations like 'I can handle this.'",
|
| 207 |
+
"tired" : "Take a quick power nap if possible.",
|
| 208 |
+
"fatigue" : "Stretch your body to release tension.",
|
| 209 |
+
"burnout" : "Take a complete 10-minute break without screens.",
|
| 210 |
+
"frustrated" : "Pause and do 5 deep breaths to regain focus.",
|
| 211 |
+
"helpless" : "Ask for support—it's okay to seek help.",
|
| 212 |
+
"confused" : "Write down your thoughts to organize them.",
|
| 213 |
+
"worried" : "Challenge your thoughts by asking 'Is this likely to happen?'",
|
| 214 |
+
"lost" : "Take one small step towards clarity, like making a to-do list.",
|
| 215 |
+
"crying" : "Drink water and sit in a comfortable position to calm.",
|
| 216 |
+
"heartbreak" : "Allow yourself to heal and talk to a trusted friend.",
|
| 217 |
+
"guilt" : "Forgive yourself and remind yourself you are human.",
|
| 218 |
+
"shame" : "Remind yourself that mistakes do not define you.",
|
| 219 |
+
"fearful" : "Focus on your breathing for a few minutes.",
|
| 220 |
+
"meltdown" : "Step away and try a 5-minute meditation.",
|
| 221 |
+
"pressured" : "Break tasks into smaller, manageable chunks.",
|
| 222 |
+
"uneasy" : "Listen to relaxing music or nature sounds.",
|
| 223 |
+
"unmotivated" : "Start with one tiny task to build momentum.",
|
| 224 |
+
"restless" : "Try a short physical activity like stretching.",
|
| 225 |
+
"freaking" : "Count to 10 slowly to calm down.",
|
| 226 |
+
"cry" : "Let your tears out—it helps to release emotions.",
|
| 227 |
+
"breakdown" : "Sit somewhere quiet and breathe deeply.",
|
| 228 |
+
"fail" : "Remind yourself failure is part of learning.",
|
| 229 |
+
"failure" : "Focus on what you can improve, not what you lost.",
|
| 230 |
+
"pressure" : "Take breaks and drink water to refresh your mind.",
|
| 231 |
+
"worry" : "Write down your worries and challenge them logically.",
|
| 232 |
+
"trouble" : "Focus on one thing you can solve right now.",
|
| 233 |
+
"numb" : "Take a walk outside to feel present.",
|
| 234 |
+
"tense" : "Relax your shoulders and stretch for a minute.",
|
| 235 |
+
"hurting" : "Talk to someone you trust about your pain.",
|
| 236 |
+
"hurt" : "Be kind to yourself and allow healing time.",
|
| 237 |
+
"broken" : "Remember that healing is slow but possible.",
|
| 238 |
+
"tension" : "Roll your shoulders and take deep breaths.",
|
| 239 |
+
"angry" : "Punch a pillow or squeeze a stress ball instead of yelling.",
|
| 240 |
+
"pessimistic" : "List 3 things that went well today.",
|
| 241 |
+
"scared" : "Remind yourself of times you overcame fear.",
|
| 242 |
+
"worn-out" : "Take a 5-minute break and hydrate.",
|
| 243 |
+
"mental pain" : "Talk about your feelings with a trusted person.",
|
| 244 |
+
"emotional" : "Allow yourself to feel without judging your emotions.",
|
| 245 |
+
"upset" : "Pause and do 10 slow breaths.",
|
| 246 |
+
"low" : "Do something small that brings joy.",
|
| 247 |
+
"bitter" : "Write down 3 positive things about your day.",
|
| 248 |
+
"uneasiness" : "Practice slow and mindful breathing.",
|
| 249 |
+
"tense" : "Try progressive muscle relaxation.",
|
| 250 |
+
"tight" : "Do a gentle body stretch.",
|
| 251 |
+
"stressed-out" : "Focus on what you can control right now.",
|
| 252 |
+
"paranoid" : "Talk to someone to verify your fears.",
|
| 253 |
+
"devastated" : "Give yourself time to heal.",
|
| 254 |
+
"crybaby" : "Your tears are valid—let them flow.",
|
| 255 |
+
"unhappy" : "List 1 thing that can make you smile.",
|
| 256 |
+
"negative" : "Counter each negative thought with a positive one.",
|
| 257 |
+
"hopelessness" : "Set one small achievable goal today.",
|
| 258 |
+
"unsure" : "Write your pros and cons to gain clarity.",
|
| 259 |
+
"self-doubt" : "Remind yourself of your past achievements.",
|
| 260 |
+
"hurtful" : "Distance yourself from negativity for a while.",
|
| 261 |
+
"unwell" : "Drink water and rest to recover.",
|
| 262 |
+
"emotionless" : "Do something creative to spark feelings.",
|
| 263 |
+
"lostness" : "Journal your thoughts for clarity.",
|
| 264 |
+
"distress" : "Breathe in for 4 seconds, hold 4, out for 4.",
|
| 265 |
+
"emergency" : "Call someone you trust immediately.",
|
| 266 |
+
"unsettled" : "Meditate for 5 minutes on your breath.",
|
| 267 |
+
"chaotic" : "Focus on organizing one small area around you.",
|
| 268 |
+
"break" : "Take 10 minutes to step outside.",
|
| 269 |
+
"unstable" : "Seek support from a friend or counselor.",
|
| 270 |
+
"hopelessly" : "Remind yourself nothing lasts forever.",
|
| 271 |
+
"pain" : "Try deep breathing or journaling about your pain.",
|
| 272 |
+
"painful" : "Distract yourself with something positive.",
|
| 273 |
+
"angsty" : "Express feelings through writing or art.",
|
| 274 |
+
"uneasiness" : "Light a candle and focus on the flame for a minute.",
|
| 275 |
+
"irritated" : "Do 5 deep breaths to calm irritation.",
|
| 276 |
+
"frustration" : "Talk about your frustration instead of bottling it.",
|
| 277 |
+
"exhaustion" : "Sleep for at least 15 minutes if possible.",
|
| 278 |
+
"mental stress" : "Pause and take a few deep breaths.",
|
| 279 |
+
"low mood" : "Listen to uplifting music.",
|
| 280 |
+
"discouraged" : "Remind yourself of past successes.",
|
| 281 |
+
"confusion" : "Pause, take a breath, and write down thoughts.",
|
| 282 |
+
"overthinking" : "Distract yourself with a small physical activity.",
|
| 283 |
+
"hurtful words" : "Remind yourself words don’t define your worth.",
|
| 284 |
+
"traumatized" : "Seek safe space and talk about your feelings.",
|
| 285 |
+
"frantic" : "Slow your breathing and count backwards from 10.",
|
| 286 |
+
"chaos" : "Clean or organize something small around you.",
|
| 287 |
+
"lost mind" : "Ground yourself by feeling the floor beneath you.",
|
| 288 |
+
"hectic" : "Prioritize and focus on one task at a time.",
|
| 289 |
+
"unbalanced" : "Sit and take 5 deep breaths.",
|
| 290 |
+
"mentally tired" : "Close your eyes for 2 minutes and relax.",
|
| 291 |
+
"self-blame" : "Remind yourself that mistakes happen to everyone.",
|
| 292 |
+
"failure feeling" : "Focus on one thing you’ve done right today.",
|
| 293 |
+
"feeling bad" : "Say one kind thing to yourself.",
|
| 294 |
+
"worthless" : "Remember your value is not defined by others.",
|
| 295 |
+
"helplessness" : "Ask for support—it’s a sign of strength.",
|
| 296 |
+
"emotional pain" : "Talk to someone who cares about you.",
|
| 297 |
+
"lack of energy" : "Stretch your arms and drink water.",
|
| 298 |
+
"lack of sleep" : "Take a power nap of 10-20 minutes.",
|
| 299 |
+
"mood swings" : "Track your mood to find triggers.",
|
| 300 |
+
"frightened" : "Hold a comforting object and breathe slowly.",
|
| 301 |
+
"self-hate" : "Replace self-criticism with self-kindness.",
|
| 302 |
+
"negativity" : "Say one positive affirmation out loud.",
|
| 303 |
+
"anxious" : "Practice slow inhaling and exhaling.",
|
| 304 |
+
"feeling down" : "Do something you enjoy, even for 5 minutes.",
|
| 305 |
+
"unstable mind" : "Pause, breathe, and write what you feel.",
|
| 306 |
+
"uneasy feeling" : "Ground yourself by noticing your 5 senses.",
|
| 307 |
+
"confusing" : "Write down questions to get clarity.",
|
| 308 |
+
"worn out" : "Take a rest break with calm music.",
|
| 309 |
+
"pressured" : "Let go of what’s not urgent.",
|
| 310 |
+
"nervousness" : "Take 10 deep breaths slowly.",
|
| 311 |
+
"mental exhaustion" : "Do a simple 5-min body stretch.",
|
| 312 |
+
"crisis" : "Focus on what is in your control right now.",
|
| 313 |
+
"melancholy" : "Write or draw to express feelings.",
|
| 314 |
+
"mental breakdown" : "Sit down, close your eyes, and breathe.",
|
| 315 |
+
"feeling weak" : "Remind yourself you’ve overcome challenges before.",
|
| 316 |
+
"shaking" : "Sit still and breathe deeply for 2 minutes.",
|
| 317 |
+
"mental fatigue" : "Take a short screen-free break.",
|
| 318 |
+
"scared feelings" : "Tell yourself, 'This feeling will pass.'",
|
| 319 |
+
"restless mind" : "Do 5 minutes of meditation or yoga.",
|
| 320 |
+
"mind chaos" : "Write down your thoughts to clear your mind.",
|
| 321 |
+
"uncertain" : "List your options and think calmly.",
|
| 322 |
+
"self-harming thoughts" : "Reach out to someone you trust immediately.",
|
| 323 |
+
"dark thoughts" : "Remember, you are not your thoughts.",
|
| 324 |
+
"mental pressure" : "Pause and breathe for 5 deep breaths.",
|
| 325 |
+
"losing hope" : "Focus on one good thing in your day.",
|
| 326 |
+
"bad mood" : "Do something fun or silly for 5 minutes.",
|
| 327 |
+
"pain inside" : "Talk to someone, don’t hold it in.",
|
| 328 |
+
"numb feeling" : "Do a gentle self-massage on your hands.",
|
| 329 |
+
"lack of motivation" : "Start with just 1 easy task.",
|
| 330 |
+
"mind clutter" : "Write your thoughts on paper.",
|
| 331 |
+
"feeling low" : "Listen to uplifting songs or affirmations.",
|
| 332 |
+
"irritation" : "Pause and breathe deeply 3 times.",
|
| 333 |
+
"disturbed" : "Sit somewhere quiet for 5 minutes.",
|
| 334 |
+
"heavy heart" : "Talk about how you feel with someone.",
|
| 335 |
+
"mental burden" : "Break it into small, manageable steps.",
|
| 336 |
+
"scared mind" : "Repeat to yourself: 'I am safe now.'",
|
| 337 |
+
"tension headache" : "Massage your temples gently.",
|
| 338 |
+
"mind storm" : "Sit quietly and focus on one thought.",
|
| 339 |
+
"mental struggle" : "Write a small gratitude note.",
|
| 340 |
+
"mind fatigue" : "Do light stretches or walk for 5 minutes."
|
| 341 |
+
|
| 342 |
}
|
| 343 |
|
| 344 |
# Save personal information
|
|
|
|
| 483 |
</iframe>
|
| 484 |
'''
|
| 485 |
)
|
|
|
|
| 486 |
app.launch()
|