Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -143,12 +143,13 @@ def analyze_messages(input_text, risk_flags):
|
|
143 |
# Supportive override logic
|
144 |
if (
|
145 |
sentiment_label == "supportive"
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
):
|
151 |
return "This message is classified as non-abusive. It appears emotionally supportive and safe."
|
|
|
152 |
scored_patterns = [
|
153 |
(label, score) for label, score in zip(PATTERN_LABELS, scores[:15]) if label != "non_abusive"
|
154 |
]
|
|
|
143 |
# Supportive override logic
|
144 |
if (
|
145 |
sentiment_label == "supportive"
|
146 |
+
and sentiment_score > 0.95
|
147 |
+
and non_abusive_confident
|
148 |
+
and danger_flag_count == 0
|
149 |
+
and not matched_phrases
|
150 |
):
|
151 |
return "This message is classified as non-abusive. It appears emotionally supportive and safe."
|
152 |
+
|
153 |
scored_patterns = [
|
154 |
(label, score) for label, score in zip(PATTERN_LABELS, scores[:15]) if label != "non_abusive"
|
155 |
]
|