Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -240,7 +240,41 @@ def get_emotional_tone_tag(emotions, sentiment, patterns, abuse_score):
|
|
240 |
sentiment == "undermining"
|
241 |
):
|
242 |
return "deflective hostility"
|
243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
return None
|
245 |
def detect_contradiction(message):
|
246 |
patterns = [
|
|
|
240 |
sentiment == "undermining"
|
241 |
):
|
242 |
return "deflective hostility"
|
243 |
+
# 10. Mocking Detachment
|
244 |
+
if (
|
245 |
+
(neutral + joy) > 0.5 and
|
246 |
+
any(p in patterns for p in ["mockery", "insults", "projection"]) and
|
247 |
+
sentiment == "undermining"
|
248 |
+
):
|
249 |
+
return "mocking detachment"
|
250 |
+
# 11. Contradictory Gaslight
|
251 |
+
if (
|
252 |
+
(joy + anger + sadness) > 0.5 and
|
253 |
+
any(p in patterns for p in ["gaslighting", "contradictory statements"]) and
|
254 |
+
sentiment == "undermining"
|
255 |
+
):
|
256 |
+
return "contradictory gaslight"
|
257 |
+
# 12. Calculated Neutrality
|
258 |
+
if (
|
259 |
+
neutral > 0.6 and
|
260 |
+
any(p in patterns for p in ["obscure language", "deflection", "dismissiveness"]) and
|
261 |
+
sentiment == "undermining"
|
262 |
+
):
|
263 |
+
return "calculated neutrality"
|
264 |
+
# 13. Forced Accountability Flip
|
265 |
+
if (
|
266 |
+
(anger + disgust) > 0.5 and
|
267 |
+
any(p in patterns for p in ["blame shifting", "manipulation", "projection"]) and
|
268 |
+
sentiment == "undermining"
|
269 |
+
):
|
270 |
+
return "forced accountability flip"
|
271 |
+
# 14. Conditional Affection
|
272 |
+
if (
|
273 |
+
joy > 0.4 and
|
274 |
+
any(p in patterns for p in ["apology baiting", "control", "recovery phase"]) and
|
275 |
+
sentiment == "undermining"
|
276 |
+
):
|
277 |
+
return "conditional affection"
|
278 |
return None
|
279 |
def detect_contradiction(message):
|
280 |
patterns = [
|