Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,20 +93,20 @@ def analyze_message(text):
|
|
| 93 |
if not red_flags:
|
| 94 |
red_flags = ["no obvious red flags"]
|
| 95 |
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
risk_display = "🟢 LOW RISK"
|
| 103 |
|
| 104 |
-
summary = f"{risk_display}"
|
| 105 |
-
confidence_text = f"Confidence: {confidence:.0%}"
|
| 106 |
-
flags_text = "\n".join([f"⚠️ {flag}" for flag in red_flags])
|
| 107 |
|
| 108 |
-
return summary, confidence_text, flags_text
|
| 109 |
|
|
|
|
| 110 |
# ======================
|
| 111 |
# Interface
|
| 112 |
# ======================
|
|
|
|
| 93 |
if not red_flags:
|
| 94 |
red_flags = ["no obvious red flags"]
|
| 95 |
|
| 96 |
+
if pred == "high":
|
| 97 |
+
risk_display = "🔴 HIGH RISK"
|
| 98 |
+
elif pred == "medium":
|
| 99 |
+
risk_display = "🟠 MEDIUM RISK"
|
| 100 |
+
else:
|
| 101 |
+
risk_display = "🟢 LOW RISK"
|
|
|
|
| 102 |
|
| 103 |
+
summary = f"{risk_display}"
|
| 104 |
+
confidence_text = f"Confidence: {confidence:.0%}"
|
| 105 |
+
flags_text = "\n".join([f"⚠️ {flag}" for flag in red_flags])
|
| 106 |
|
| 107 |
+
return summary, confidence_text, flags_text
|
| 108 |
|
| 109 |
+
|
| 110 |
# ======================
|
| 111 |
# Interface
|
| 112 |
# ======================
|