Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -480,9 +480,10 @@ def analyze_composite(msg1, date1, msg2, date2, msg3, date3, *answers_and_none):
|
|
480 |
out = f"Abuse Intensity: {composite_abuse}%\n"
|
481 |
out += "π This reflects the strength and severity of detected abuse patterns in the message(s).\n\n"
|
482 |
|
483 |
-
|
484 |
-
|
485 |
-
|
|
|
486 |
else:
|
487 |
out += f"Escalation Potential: {risk_level} ({escalation_score}/{sum(w for _, w in ESCALATION_QUESTIONS)})\n"
|
488 |
out += "π¨ This indicates how many serious risk factors are present based on your answers to the safety checklist.\n"
|
@@ -494,6 +495,7 @@ def analyze_composite(msg1, date1, msg2, date2, msg3, date3, *answers_and_none):
|
|
494 |
print(f"DEBUG: avg_darvo = {avg_darvo}")
|
495 |
pattern_labels = [r[0][2][0][0] for r in results] # top label for each message
|
496 |
timeline_image = generate_abuse_score_chart(dates_used, abuse_scores, pattern_labels)
|
|
|
497 |
return out, timeline_image
|
498 |
|
499 |
message_date_pairs = [
|
|
|
480 |
out = f"Abuse Intensity: {composite_abuse}%\n"
|
481 |
out += "π This reflects the strength and severity of detected abuse patterns in the message(s).\n\n"
|
482 |
|
483 |
+
# Save this line for later use at the end
|
484 |
+
escalation_text = f"𧨠**Escalation Potential: {risk_level} ({escalation_score}/{sum(w for _, w in ESCALATION_QUESTIONS)})**\n"
|
485 |
+
escalation_text += "This score comes directly from the safety checklist and functions as a standalone escalation risk score.\n"
|
486 |
+
escalation_text += "It indicates how many serious risk factors are present based on your answers to the safety checklist.\n"
|
487 |
else:
|
488 |
out += f"Escalation Potential: {risk_level} ({escalation_score}/{sum(w for _, w in ESCALATION_QUESTIONS)})\n"
|
489 |
out += "π¨ This indicates how many serious risk factors are present based on your answers to the safety checklist.\n"
|
|
|
495 |
print(f"DEBUG: avg_darvo = {avg_darvo}")
|
496 |
pattern_labels = [r[0][2][0][0] for r in results] # top label for each message
|
497 |
timeline_image = generate_abuse_score_chart(dates_used, abuse_scores, pattern_labels)
|
498 |
+
out += "\n" + escalation_text
|
499 |
return out, timeline_image
|
500 |
|
501 |
message_date_pairs = [
|