Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -490,8 +490,8 @@ def analyze_single_message(text, thresholds):
|
|
490 |
abuse_score_raw = min(abuse_score_raw + 25, 100)
|
491 |
|
492 |
|
493 |
-
|
494 |
-
|
495 |
|
496 |
# Tag must happen after abuse score is finalized
|
497 |
tone_tag = get_emotional_tone_tag(emotion_profile, sentiment, threshold_labels, abuse_score)
|
@@ -501,7 +501,7 @@ def analyze_single_message(text, thresholds):
|
|
501 |
insult_label_display if label == "insults" else label
|
502 |
for label in threshold_labels
|
503 |
]
|
504 |
-
|
505 |
# ---- Profanity + Anger Override Logic ----
|
506 |
profane_words = {"fuck", "fucking", "bitch", "shit", "cunt", "ho", "asshole", "dick", "whore", "slut"}
|
507 |
tokens = set(text.lower().split())
|
|
|
490 |
abuse_score_raw = min(abuse_score_raw + 25, 100)
|
491 |
|
492 |
|
493 |
+
|
494 |
+
abuse_score = min(abuse_score_raw, 100 if "control" in threshold_labels else 95)
|
495 |
|
496 |
# Tag must happen after abuse score is finalized
|
497 |
tone_tag = get_emotional_tone_tag(emotion_profile, sentiment, threshold_labels, abuse_score)
|
|
|
501 |
insult_label_display if label == "insults" else label
|
502 |
for label in threshold_labels
|
503 |
]
|
504 |
+
return abuse_score, threshold_labels, top_patterns, {"label": sentiment}, stage, darvo_score, tone_tag
|
505 |
# ---- Profanity + Anger Override Logic ----
|
506 |
profane_words = {"fuck", "fucking", "bitch", "shit", "cunt", "ho", "asshole", "dick", "whore", "slut"}
|
507 |
tokens = set(text.lower().split())
|