Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -468,13 +468,13 @@ def analyze_single_message(text, thresholds):
|
|
468 |
if score > adjusted_thresholds[label]
|
469 |
]
|
470 |
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
|
479 |
# Abuse score
|
480 |
abuse_score_raw = compute_abuse_score(matched_scores, sentiment)
|
|
|
468 |
if score > adjusted_thresholds[label]
|
469 |
]
|
470 |
|
471 |
+
|
472 |
+
# Cap subtle insults to avoid excessive abuse score
|
473 |
+
if (
|
474 |
+
len(threshold_labels) == 1 and "insults" in threshold_labels
|
475 |
+
and emotion_profile.get("neutral", 0) > 0.85
|
476 |
+
):
|
477 |
+
abuse_score_raw = min(abuse_score_raw, 40)
|
478 |
|
479 |
# Abuse score
|
480 |
abuse_score_raw = compute_abuse_score(matched_scores, sentiment)
|