SamanthaStorm commited on
Commit
e905632
·
verified ·
1 Parent(s): d25e518

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -125,10 +125,11 @@ def get_emotional_tone_tag(emotion_profile, patterns, text_lower):
125
  if lex_counts["joy"] > 0 and any(k in text_lower for k in ["support","hope","grace"]):
126
  return "supportive"
127
 
128
- # 1. Performative Regret
129
- if sadness > 0.4 \
130
- and (lex_counts["sadness"] > 0 or any(p in patterns for p in ["blame shifting","guilt tripping","recovery phase"])):
131
- return "performative regret"
 
132
 
133
  # 2. Coercive Warmth
134
  if (joy > 0.3 or sadness > 0.4) \
 
125
  if lex_counts["joy"] > 0 and any(k in text_lower for k in ["support","hope","grace"]):
126
  return "supportive"
127
 
128
+ + # 1. Performative Regret
129
+ + # → only when we see one of those patterns, not just lexicon hits
130
+ + if sadness > 0.4 \
131
+ + and any(p in patterns for p in ["blame shifting","guilt tripping","recovery phase"]):
132
+ + return "performative regret"
133
 
134
  # 2. Coercive Warmth
135
  if (joy > 0.3 or sadness > 0.4) \