SamanthaStorm commited on
Commit
d754ddb
·
verified ·
1 Parent(s): bbd098a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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
- 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
  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
  ]