Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -346,11 +346,11 @@ def analyze_single_message(text, thresholds):
|
|
346 |
emotion_profile = get_emotion_profile(text)
|
347 |
sentiment_score = emotion_profile.get("anger", 0) + emotion_profile.get("disgust", 0)
|
348 |
|
349 |
-
# Override if neutral tone masks abusive content
|
350 |
if emotion_profile.get("neutral", 0) > 0.85 and any(
|
351 |
scores[label] > THRESHOLDS[label]
|
352 |
-
|
353 |
-
):
|
354 |
sentiment = "undermining"
|
355 |
else:
|
356 |
sentiment = "undermining" if sentiment_score > 0.25 else "supportive"
|
|
|
346 |
emotion_profile = get_emotion_profile(text)
|
347 |
sentiment_score = emotion_profile.get("anger", 0) + emotion_profile.get("disgust", 0)
|
348 |
|
349 |
+
# Override if neutral tone masks abusive content
|
350 |
if emotion_profile.get("neutral", 0) > 0.85 and any(
|
351 |
scores[label] > THRESHOLDS[label]
|
352 |
+
for label in ["control", "threat", "blame shifting"]
|
353 |
+
):
|
354 |
sentiment = "undermining"
|
355 |
else:
|
356 |
sentiment = "undermining" if sentiment_score > 0.25 else "supportive"
|