Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -98,29 +98,18 @@ def generate_risk_snippet(abuse_score, top_label, escalation_score):
|
|
98 |
|
99 |
explanation = WHY_FLAGGED.get(pattern_label.lower(), WHY_FLAGGED["default"])
|
100 |
|
101 |
-
base = f"
|
102 |
-
|
103 |
-
🛑 Risk Level: {risk_level.capitalize()}
|
104 |
-
"
|
105 |
base += f"This message shows strong indicators of **{pattern_label}**. "
|
106 |
|
107 |
if risk_level == "high":
|
108 |
-
base += "The language may reflect patterns of emotional control, even when expressed in soft or caring terms
|
109 |
-
"
|
110 |
elif risk_level == "moderate":
|
111 |
-
base += "There are signs of emotional pressure or indirect control that may escalate if repeated
|
112 |
-
"
|
113 |
else:
|
114 |
-
base += "The message does not strongly indicate abuse, but it's important to monitor for patterns
|
115 |
-
|
116 |
-
|
117 |
-
base += f"
|
118 |
-
💡 *Why this might be flagged:*
|
119 |
-
{explanation}
|
120 |
-
"
|
121 |
-
base += f"
|
122 |
-
Detected Pattern: **{pattern_label} ({pattern_score})**
|
123 |
-
"
|
124 |
base += "🧠 You can review the pattern in context. This tool highlights possible dynamics—not judgments."
|
125 |
|
126 |
return base
|
|
|
98 |
|
99 |
explanation = WHY_FLAGGED.get(pattern_label.lower(), WHY_FLAGGED["default"])
|
100 |
|
101 |
+
base = f"\n\n🛑 Risk Level: {risk_level.capitalize()}\n"
|
|
|
|
|
|
|
102 |
base += f"This message shows strong indicators of **{pattern_label}**. "
|
103 |
|
104 |
if risk_level == "high":
|
105 |
+
base += "The language may reflect patterns of emotional control, even when expressed in soft or caring terms.\n"
|
|
|
106 |
elif risk_level == "moderate":
|
107 |
+
base += "There are signs of emotional pressure or indirect control that may escalate if repeated.\n"
|
|
|
108 |
else:
|
109 |
+
base += "The message does not strongly indicate abuse, but it's important to monitor for patterns.\n"
|
110 |
+
|
111 |
+
base += f"\n💡 *Why this might be flagged:*\n{explanation}\n"
|
112 |
+
base += f"\nDetected Pattern: **{pattern_label} ({pattern_score})**\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
base += "🧠 You can review the pattern in context. This tool highlights possible dynamics—not judgments."
|
114 |
|
115 |
return base
|