@@ -293,17 +293,40 @@ def sanitize_response(response):
293
293
def analyze_mood (user_input ):
294
294
analysis = TextBlob (user_input )
295
295
polarity = analysis .sentiment .polarity
296
- print (f"Sentiment polarity: { polarity } " ) # Debugging statement
297
-
298
- # Custom keyword lists for detecting specific emotions
299
- flirty_keywords = ["flirt" , "love" , "crush" , "charming" , "amazing" , "attractive" ]
300
- angry_keywords = ["angry" , "furious" , "mad" , "annoyed" , "pissed off" ]
301
- sad_keywords = ["sad" , "depressed" , "down" , "unhappy" , "crying" ]
302
- fearful_keywords = ["scared" , "afraid" , "fear" , "terrified" , "nervous" ]
303
- surprised_keywords = ["surprised" , "amazed" , "astonished" , "shocked" ]
304
- disgusted_keywords = ["disgusted" , "revolted" , "sick" , "nauseated" ]
305
- joyful_keywords = ["joyful" , "happy" , "elated" , "glad" , "delighted" ]
306
- neutral_keywords = ["okay" , "alright" , "fine" , "neutral" ]
296
+ print (f"Sentiment polarity: { polarity } " )
297
+
298
+ flirty_keywords = [
299
+ "flirt" , "love" , "crush" , "charming" , "amazing" , "attractive" ,
300
+ "cute" , "sweet" , "darling" , "adorable" , "alluring" , "seductive"
301
+ ]
302
+ angry_keywords = [
303
+ "angry" , "furious" , "mad" , "annoyed" , "pissed off" , "irate" ,
304
+ "enraged" , "livid" , "outraged" , "frustrated" , "infuriated"
305
+ ]
306
+ sad_keywords = [
307
+ "sad" , "depressed" , "down" , "unhappy" , "crying" , "miserable" ,
308
+ "heartbroken" , "sorrowful" , "gloomy" , "melancholy" , "despondent"
309
+ ]
310
+ fearful_keywords = [
311
+ "scared" , "afraid" , "fear" , "terrified" , "nervous" , "anxious" ,
312
+ "worried" , "frightened" , "alarmed" , "panicked" , "horrified"
313
+ ]
314
+ surprised_keywords = [
315
+ "surprised" , "amazed" , "astonished" , "shocked" , "stunned" ,
316
+ "flabbergasted" , "astounded" , "speechless" , "startled"
317
+ ]
318
+ disgusted_keywords = [
319
+ "disgusted" , "revolted" , "sick" , "nauseated" , "repulsed" ,
320
+ "grossed out" , "appalled" , "offended" , "detested"
321
+ ]
322
+ joyful_keywords = [
323
+ "joyful" , "happy" , "elated" , "glad" , "delighted" , "pleased" ,
324
+ "cheerful" , "content" , "satisfied" , "thrilled" , "ecstatic"
325
+ ]
326
+ neutral_keywords = [
327
+ "okay" , "alright" , "fine" , "neutral" , "so-so" , "indifferent" ,
328
+ "meh" , "unremarkable" , "average" , "mediocre"
329
+ ]
307
330
308
331
if any (keyword in user_input .lower () for keyword in flirty_keywords ):
309
332
return "flirty"
0 commit comments