Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -72,7 +72,7 @@ LABELS = [
|
|
72 |
]
|
73 |
|
74 |
THRESHOLDS = {
|
75 |
-
"recovery": 0.
|
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(
|