feat(nlp): remove surprise & neutral emotions from NLP processing

These emotions often dominate due to the writing style of online users and don't provide an accurate picture of the sentiment.
This commit is contained in:
2026-02-24 15:28:30 +00:00
parent e82ac8d73b
commit ce0aa6bc43
2 changed files with 32 additions and 6 deletions

View File

@@ -5,14 +5,9 @@ class EmotionalAnalysis:
self.df = df
def avg_emotion_by_topic(self) -> dict:
emotion_exclusions = [
"emotion_neutral",
"emotion_surprise"
]
emotion_cols = [
col for col in self.df.columns
if col.startswith("emotion_") and col not in emotion_exclusions
if col.startswith("emotion_")
]
counts = (