SamanthaStorm commited on
Commit
b493dab
·
verified ·
1 Parent(s): bd4971f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -147,14 +147,16 @@ def analyze_messages(input_text, risk_flags):
147
  for label, _ in top_patterns
148
  ])
149
 
150
- result = (
151
- f"Abuse Risk Score: {abuse_level}% {abuse_description}\n\n"
152
- f"Most Likely Patterns:\n{top_pattern_explanations}\n\n"
 
153
  f"⚠️ Critical Danger Flags Detected: {danger_flag_count} of 3\n"
154
  "Resources: " + resources + "\n\n"
155
  f"Sentiment: {sentiment_label.title()} (Confidence: {sentiment_score*100:.2f}%)"
156
  )
157
 
 
158
  # THEN immediately follow with this:
159
  if contextual_flags:
160
  result += "\n\n⚠️ You indicated the following:\n" + "\n".join([f"• {flag.replace('_', ' ').title()}" for flag in contextual_flags])
 
147
  for label, _ in top_patterns
148
  ])
149
 
150
+ result = f"Abuse Risk Score: {abuse_level}% – {abuse_description}\n\n"
151
+ if abuse_level >= 15:
152
+ result += f"Most Likely Patterns:\n{top_pattern_explanations}\n\n"
153
+
154
  f"⚠️ Critical Danger Flags Detected: {danger_flag_count} of 3\n"
155
  "Resources: " + resources + "\n\n"
156
  f"Sentiment: {sentiment_label.title()} (Confidence: {sentiment_score*100:.2f}%)"
157
  )
158
 
159
+
160
  # THEN immediately follow with this:
161
  if contextual_flags:
162
  result += "\n\n⚠️ You indicated the following:\n" + "\n".join([f"• {flag.replace('_', ' ').title()}" for flag in contextual_flags])