SamanthaStorm commited on
Commit
4c24baa
·
verified ·
1 Parent(s): 4c77a70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -275,6 +275,21 @@ def get_emotional_tone_tag(emotions, sentiment, patterns, abuse_score):
275
  sentiment == "undermining"
276
  ):
277
  return "conditional affection"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  return None
279
  def detect_contradiction(message):
280
  patterns = [
 
275
  sentiment == "undermining"
276
  ):
277
  return "conditional affection"
278
+
279
+ if (
280
+ (anger + disgust) > 0.5 and
281
+ any(p in patterns for p in ["blame shifting", "projection", "deflection"]) and
282
+ sentiment == "undermining
283
+ ):
284
+ return "forced accountability flip"
285
+
286
+ # Emotional Instability Fallback
287
+ if (
288
+ (anger + sadness + disgust) > 0.6 and
289
+ sentiment == "undermining"
290
+ ):
291
+ return "emotional instability"
292
+
293
  return None
294
  def detect_contradiction(message):
295
  patterns = [