Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -214,6 +214,26 @@ def get_emotional_tone_tag(text, sentiment, patterns, abuse_score):
|
|
214 |
):
|
215 |
return "direct threat"
|
216 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
# 1. Performative Regret
|
218 |
if (
|
219 |
sadness > 0.3 and
|
|
|
214 |
):
|
215 |
return "direct threat"
|
216 |
|
217 |
+
# Prophetic Punishment (New)
|
218 |
+
text_lower = text.lower()
|
219 |
+
future_consequences = [
|
220 |
+
"will end up", "you'll be", "you will be", "going to be",
|
221 |
+
"will become", "will find yourself", "will realize",
|
222 |
+
"you'll regret", "you'll see", "will learn"
|
223 |
+
]
|
224 |
+
dismissive_endings = [
|
225 |
+
"i'm out", "i'm done", "whatever", "good luck",
|
226 |
+
"your choice", "your problem", "regardless"
|
227 |
+
]
|
228 |
+
|
229 |
+
if (
|
230 |
+
any(phrase in text_lower for phrase in future_consequences) and
|
231 |
+
(any(p in patterns for p in ["dismissiveness", "control"]) or
|
232 |
+
any(end in text_lower for end in dismissive_endings)) and
|
233 |
+
(disgust > 0.3 or neutral > 0.4)
|
234 |
+
):
|
235 |
+
return "predictive punishment"
|
236 |
+
|
237 |
# 1. Performative Regret
|
238 |
if (
|
239 |
sadness > 0.3 and
|