Skip to content

Commit 77040e9

Browse files
committed
update keywords for sentiment analysis in cli.py
1 parent 88fedbd commit 77040e9

File tree

1 file changed

+34
-11
lines changed

1 file changed

+34
-11
lines changed

cli.py

+34-11
Original file line numberDiff line numberDiff line change
@@ -293,17 +293,40 @@ def sanitize_response(response):
293293
def analyze_mood(user_input):
294294
analysis = TextBlob(user_input)
295295
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+
]
307330

308331
if any(keyword in user_input.lower() for keyword in flirty_keywords):
309332
return "flirty"

0 commit comments

Comments
 (0)