Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -243,7 +243,7 @@ def analyze_single_message(text, thresholds):
|
|
243 |
|
244 |
return abuse_score, threshold_labels, top_patterns, result, stage, darvo_score
|
245 |
|
246 |
-
|
247 |
none_selected_checked = answers_and_none[-1]
|
248 |
responses_checked = any(answers_and_none[:-1])
|
249 |
none_selected = not responses_checked and none_selected_checked
|
@@ -280,9 +280,9 @@ def analyze_composite(msg1, msg2, msg3, *answers_and_none):
|
|
280 |
out += "π This reflects the strength and severity of detected abuse patterns in the message(s).\n\n"
|
281 |
|
282 |
if escalation_score is None:
|
|
|
283 |
out += "Escalation Potential: Unknown (Checklist not completed)\n"
|
284 |
out += "π *This section was not completed. Escalation potential is unknown.*\n\n"
|
285 |
-
escalation_score = 0 # fallback to allow generate_risk_snippet to still work
|
286 |
else:
|
287 |
risk_level = (
|
288 |
"High" if escalation_score >= 16 else
|
@@ -292,7 +292,7 @@ def analyze_composite(msg1, msg2, msg3, *answers_and_none):
|
|
292 |
out += f"Escalation Potential: {risk_level} ({escalation_score}/{sum(w for _, w in ESCALATION_QUESTIONS)})\n"
|
293 |
out += "π¨ This indicates how many serious risk factors are present based on your answers to the safety checklist.\n\n"
|
294 |
|
295 |
-
out += generate_risk_snippet(composite_abuse, top_label, escalation_score, most_common_stage)
|
296 |
out += f"\n\n{stage_text}"
|
297 |
out += darvo_blurb
|
298 |
|
|
|
243 |
|
244 |
return abuse_score, threshold_labels, top_patterns, result, stage, darvo_score
|
245 |
|
246 |
+
ddef analyze_composite(msg1, msg2, msg3, *answers_and_none):
|
247 |
none_selected_checked = answers_and_none[-1]
|
248 |
responses_checked = any(answers_and_none[:-1])
|
249 |
none_selected = not responses_checked and none_selected_checked
|
|
|
280 |
out += "π This reflects the strength and severity of detected abuse patterns in the message(s).\n\n"
|
281 |
|
282 |
if escalation_score is None:
|
283 |
+
risk_level = "unknown"
|
284 |
out += "Escalation Potential: Unknown (Checklist not completed)\n"
|
285 |
out += "π *This section was not completed. Escalation potential is unknown.*\n\n"
|
|
|
286 |
else:
|
287 |
risk_level = (
|
288 |
"High" if escalation_score >= 16 else
|
|
|
292 |
out += f"Escalation Potential: {risk_level} ({escalation_score}/{sum(w for _, w in ESCALATION_QUESTIONS)})\n"
|
293 |
out += "π¨ This indicates how many serious risk factors are present based on your answers to the safety checklist.\n\n"
|
294 |
|
295 |
+
out += generate_risk_snippet(composite_abuse, top_label, escalation_score or 0, most_common_stage)
|
296 |
out += f"\n\n{stage_text}"
|
297 |
out += darvo_blurb
|
298 |
|