Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -401,7 +401,9 @@ def analyze_single_message(text, thresholds):
|
|
401 |
"recovery phase", "obscure language"
|
402 |
]
|
403 |
|
404 |
-
|
|
|
|
|
405 |
label = score_to_label(score) if score is not None else "Unknown"
|
406 |
|
407 |
# 🛡️ Prevent obscure language from being chosen unless it crosses a hard threshold
|
|
|
401 |
"recovery phase", "obscure language"
|
402 |
]
|
403 |
|
404 |
+
# Use top_label from earlier safely, and convert to score if available
|
405 |
+
label_key = top_label.split(" = ")[0] # Extract raw label (e.g., "Control" from "Control = 78%")
|
406 |
+
score = label_scores.get(label_key)
|
407 |
label = score_to_label(score) if score is not None else "Unknown"
|
408 |
|
409 |
# 🛡️ Prevent obscure language from being chosen unless it crosses a hard threshold
|