SamanthaStorm commited on
Commit
7ccf2f5
·
verified ·
1 Parent(s): a01d2f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -72,7 +72,7 @@ LABELS = [
72
  ]
73
 
74
  THRESHOLDS = {
75
- "recovery": 0.75,
76
  "control": 0.100,
77
  "gaslighting": 0.410,
78
  "dismissiveness": 0.867,
@@ -459,7 +459,10 @@ def analyze_single_message(text, thresholds):
459
  if score > adjusted_thresholds[label]
460
  ]
461
  # Post-threshold validation: strip recovery if it occurs with undermining sentiment
462
- if "recovery" in threshold_labels and sentiment == "undermining":
 
 
 
463
  print("⚠️ Removing 'recovery' due to undermining sentiment (not genuine repair)")
464
  threshold_labels.remove("recovery")
465
  motifs = [phrase for _, phrase in matched_phrases]
 
72
  ]
73
 
74
  THRESHOLDS = {
75
+ "recovery": 0.100,
76
  "control": 0.100,
77
  "gaslighting": 0.410,
78
  "dismissiveness": 0.867,
 
459
  if score > adjusted_thresholds[label]
460
  ]
461
  # Post-threshold validation: strip recovery if it occurs with undermining sentiment
462
+ # Override top label if recovery was removed
463
+ if "recovery" in threshold_labels and tone_tag == "forced accountability flip":
464
+ threshold_labels.remove("recovery")
465
+ top_patterns = [p for p in top_patterns if p[0] != "recovery"]
466
  print("⚠️ Removing 'recovery' due to undermining sentiment (not genuine repair)")
467
  threshold_labels.remove("recovery")
468
  motifs = [phrase for _, phrase in matched_phrases]