SamanthaStorm commited on
Commit
bf94f2c
Β·
verified Β·
1 Parent(s): c127ba6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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
- if escalation_score is None:
484
- out += "Escalation Potential: Unknown (Checklist not completed)\n"
485
- out += "πŸ” *This section was not completed. Escalation potential is unknown.*\n\n"
 
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 = [