Update app.py
Browse filesupdated , removed label inference status
app.py
CHANGED
|
@@ -140,7 +140,7 @@ def build_impression_from_labels(selected):
|
|
| 140 |
lines.append("Pleural effusion is suspected, which may be clinically significant.")
|
| 141 |
|
| 142 |
if has_pneumonia and has_atelectasis:
|
| 143 |
-
lines.append("Focal pulmonary opacity suspicious for pneumonia
|
| 144 |
elif has_pneumonia or has_consolidation:
|
| 145 |
lines.append("Focal pulmonary opacity is suspicious for pneumonia in the appropriate clinical context.")
|
| 146 |
elif has_atelectasis:
|
|
@@ -150,7 +150,7 @@ def build_impression_from_labels(selected):
|
|
| 150 |
lines.append("Cardiac silhouette appears enlarged, correlate clinically for cardiomegaly.")
|
| 151 |
|
| 152 |
if "Support Devices" in name_to_prob:
|
| 153 |
-
lines.append("Support devices/tubes are present
|
| 154 |
|
| 155 |
if not lines:
|
| 156 |
for i, p in selected:
|
|
@@ -184,7 +184,7 @@ def generate_textual_report(probs, default_threshold: float = 0.5, top_k: int =
|
|
| 184 |
description = label_descriptions.get(label, "")
|
| 185 |
phrase = prob_to_phrase(prob)
|
| 186 |
prob_pct = int(round(prob * 100))
|
| 187 |
-
findings_lines.append(f"- {label}: {description}
|
| 188 |
|
| 189 |
findings_text = "Findings:\n" + "\n".join(findings_lines)
|
| 190 |
impression_text = build_impression_from_labels(selected)
|
|
|
|
| 140 |
lines.append("Pleural effusion is suspected, which may be clinically significant.")
|
| 141 |
|
| 142 |
if has_pneumonia and has_atelectasis:
|
| 143 |
+
lines.append("Focal pulmonary opacity suspicious for pneumonia, atelectasis remains a differential consideration.")
|
| 144 |
elif has_pneumonia or has_consolidation:
|
| 145 |
lines.append("Focal pulmonary opacity is suspicious for pneumonia in the appropriate clinical context.")
|
| 146 |
elif has_atelectasis:
|
|
|
|
| 150 |
lines.append("Cardiac silhouette appears enlarged, correlate clinically for cardiomegaly.")
|
| 151 |
|
| 152 |
if "Support Devices" in name_to_prob:
|
| 153 |
+
lines.append("Support devices/tubes are present, correlate with clinical indication and positioning.")
|
| 154 |
|
| 155 |
if not lines:
|
| 156 |
for i, p in selected:
|
|
|
|
| 184 |
description = label_descriptions.get(label, "")
|
| 185 |
phrase = prob_to_phrase(prob)
|
| 186 |
prob_pct = int(round(prob * 100))
|
| 187 |
+
findings_lines.append(f"- {label}: {description}.")
|
| 188 |
|
| 189 |
findings_text = "Findings:\n" + "\n".join(findings_lines)
|
| 190 |
impression_text = build_impression_from_labels(selected)
|