SamanthaStorm commited on
Commit
0ddf13e
·
verified ·
1 Parent(s): a5b8be6

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.622,
76
  "control": 0.100,
77
  "gaslighting": 0.410,
78
  "dismissiveness": 0.867,
@@ -458,7 +458,10 @@ def analyze_single_message(text, thresholds):
458
  label for label, score in zip(LABELS, scores)
459
  if score > adjusted_thresholds[label]
460
  ]
461
-
 
 
 
462
  motifs = [phrase for _, phrase in matched_phrases]
463
 
464
  darvo_score = calculate_darvo_score(
 
72
  ]
73
 
74
  THRESHOLDS = {
75
+ "recovery": 0.75,
76
  "control": 0.100,
77
  "gaslighting": 0.410,
78
  "dismissiveness": 0.867,
 
458
  label for label, score in zip(LABELS, scores)
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]
466
 
467
  darvo_score = calculate_darvo_score(