Akis Giannoukos commited on
Commit
b9af04c
·
1 Parent(s): 305847b

Commented out lines for demo

Browse files
Files changed (1) hide show
  1. app.py +43 -43
app.py CHANGED
@@ -591,28 +591,28 @@ def build_patient_summary(chat_history: List[Tuple[str, str]], meta: Dict[str, A
591
 
592
  lines = []
593
  lines.append("# Summary for Patient\n")
594
- if total is not None and severity:
595
- lines.append(f"- PHQ‑9 Total: **{total}** ")
596
- lines.append(f"- Severity: **{severity}**\n")
597
-
598
- # Highlights: show one quote per item if available
599
- if exp_full and isinstance(exp_full, dict):
600
- items = exp_full.get("items", [])
601
- if isinstance(items, list) and items:
602
- lines.append("### Highlights from our conversation\n")
603
- for it in items:
604
- item = it.get("item")
605
- ev = it.get("evidence", [])
606
- if item and ev:
607
- lines.append(f"- {item}: \"{ev[0]}\"")
608
- lines.append("")
609
-
610
- if reflection:
611
- note = reflection.get("notes")
612
- if note:
613
- lines.append("### Reflection\n")
614
- lines.append(note)
615
- lines.append("")
616
 
617
  lines.append("### Conversation Transcript\n\n")
618
  lines.append(f"```\n{transcript_text}\n```")
@@ -642,25 +642,25 @@ def build_clinician_summary(chat_history: List[Tuple[str, str]], meta: Dict[str,
642
  md.append("")
643
  md.append("### Item Scores\n" + scores_lines + "\n")
644
 
645
- # Confidence bars
646
- if confidences:
647
- bars = []
648
- for i, k in enumerate(scores.keys()):
649
- c = confidences[i] if i < len(confidences) else 0.0
650
- bar_len = int(round(c * 20))
651
- bars.append(f"- {k}: [{'#'*bar_len}{'.'*(20-bar_len)}] {c:.2f}")
652
- md.append("### Confidence by item\n" + "\n".join(bars) + "\n")
653
-
654
- # Light explainability snapshot
655
- if exp_light:
656
- strength = exp_light.get("evidence_strength", {})
657
- recommended = exp_light.get("recommended_focus")
658
- if strength:
659
- md.append("### Evidence strength (light)\n")
660
- md.extend([f"- {k}: {v}" for k, v in strength.items()])
661
- md.append("")
662
- if recommended:
663
- md.append(f"- Next focus (if continuing): **{recommended}**\n")
664
 
665
  # Full explainability excerpts
666
  if exp_full and isinstance(exp_full, dict):
@@ -681,8 +681,8 @@ def build_clinician_summary(chat_history: List[Tuple[str, str]], meta: Dict[str,
681
  pd = ed.get("prosody_descriptors", [])
682
  if q:
683
  md.append(f" - Turn {t}: \"{q}\" ({', '.join(pd)})")
684
- if pros:
685
- md.append(f" - session prosody: {', '.join([str(p) for p in pros[:4]])}")
686
  md.append("")
687
 
688
  # Reflection summary
 
591
 
592
  lines = []
593
  lines.append("# Summary for Patient\n")
594
+ # if total is not None and severity:
595
+ # lines.append(f"- PHQ‑9 Total: **{total}** ")
596
+ # lines.append(f"- Severity: **{severity}**\n")
597
+
598
+ # # Highlights: show one quote per item if available
599
+ # if exp_full and isinstance(exp_full, dict):
600
+ # items = exp_full.get("items", [])
601
+ # if isinstance(items, list) and items:
602
+ # lines.append("### Highlights from our conversation\n")
603
+ # for it in items:
604
+ # item = it.get("item")
605
+ # ev = it.get("evidence", [])
606
+ # if item and ev:
607
+ # lines.append(f"- {item}: \"{ev[0]}\"")
608
+ # lines.append("")
609
+
610
+ # if reflection:
611
+ # note = reflection.get("notes")
612
+ # if note:
613
+ # lines.append("### Reflection\n")
614
+ # lines.append(note)
615
+ # lines.append("")
616
 
617
  lines.append("### Conversation Transcript\n\n")
618
  lines.append(f"```\n{transcript_text}\n```")
 
642
  md.append("")
643
  md.append("### Item Scores\n" + scores_lines + "\n")
644
 
645
+ # # Confidence bars
646
+ # if confidences:
647
+ # bars = []
648
+ # for i, k in enumerate(scores.keys()):
649
+ # c = confidences[i] if i < len(confidences) else 0.0
650
+ # bar_len = int(round(c * 20))
651
+ # bars.append(f"- {k}: [{'#'*bar_len}{'.'*(20-bar_len)}] {c:.2f}")
652
+ # md.append("### Confidence by item\n" + "\n".join(bars) + "\n")
653
+
654
+ # # Light explainability snapshot
655
+ # if exp_light:
656
+ # strength = exp_light.get("evidence_strength", {})
657
+ # recommended = exp_light.get("recommended_focus")
658
+ # if strength:
659
+ # md.append("### Evidence strength (light)\n")
660
+ # md.extend([f"- {k}: {v}" for k, v in strength.items()])
661
+ # md.append("")
662
+ # if recommended:
663
+ # md.append(f"- Next focus (if continuing): **{recommended}**\n")
664
 
665
  # Full explainability excerpts
666
  if exp_full and isinstance(exp_full, dict):
 
681
  pd = ed.get("prosody_descriptors", [])
682
  if q:
683
  md.append(f" - Turn {t}: \"{q}\" ({', '.join(pd)})")
684
+ # if pros:
685
+ # md.append(f" - session prosody: {', '.join([str(p) for p in pros[:4]])}")
686
  md.append("")
687
 
688
  # Reflection summary