SamanthaStorm commited on
Commit
cfdfbb0
Β·
verified Β·
1 Parent(s): 8edffe2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -27
app.py CHANGED
@@ -67,30 +67,16 @@ model = AutoModelForSequenceClassification.from_pretrained(model_name)
67
  tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
68
 
69
  LABELS = [
70
- "blame shifting",
71
- "contradictory statements",
72
- "control",
73
- "dismissiveness",
74
- "gaslighting",
75
- "guilt tripping",
76
- "insults",
77
- "obscure language",
78
- "projection",
79
- "recovery phase",
80
- "threat"
81
- "deflection"
82
- "aggression"
83
- "coercion"
84
-
85
  ]
86
 
87
  THRESHOLDS = {
88
- "recovery phase": 0.622,
89
  "control": 0.100,
90
  "gaslighting": 0.410,
91
  "dismissiveness": 0.867,
92
  "blame shifting": 0.116,
93
- "contradictory statements": 0.100,
94
  "coercion": 0.100,
95
  "aggression": 0.100,
96
  "nonabusive": 0.100,
@@ -98,17 +84,19 @@ THRESHOLDS = {
98
  "projection": 0.100,
99
  "insults": 0.100
100
  }
 
101
  PATTERN_WEIGHTS = {
102
- "gaslighting": 1.4, # Slightly reduced: threshold tuned to 0.41 (high precision)
103
- "control": 1.3, # Increased: very low threshold, deserves slightly higher weight
104
- "dismissiveness": 0.9, # Increased from 0.7 due to high threshold needed
105
- "blame shifting": 0.6, # Slight increase for stronger detection
106
- "guilt tripping": 1.2, # Leave as is (not in current threshold set, assumed stable)
107
- "insults": 1.5, # Raised slightly: F1 of 1.0 at low threshold, so still high signal
108
- "projection": 1.2, # Leave as is: still valid at current detection levels
109
- "recovery phase": 1.0, # Slightly lowered to reduce false sense of safety
110
- "contradictory statements": 0.75, # Leave as is unless retrained
111
- "threat": 1.6 # Keep high due to high severity, even if threshold wasn't tuned here
 
112
  }
113
  RISK_STAGE_LABELS = {
114
  1: "πŸŒ€ Risk Stage: Tension-Building\nThis message reflects rising emotional pressure or subtle control attempts.",
 
67
  tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
68
 
69
  LABELS = [
70
+ "recovery", "control", "gaslighting", "dismissiveness", "blame shifting",
71
+ "coercion", "aggression", "nonabusive", "deflection", "projection", "insults"
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  ]
73
 
74
  THRESHOLDS = {
75
+ "recovery": 0.622,
76
  "control": 0.100,
77
  "gaslighting": 0.410,
78
  "dismissiveness": 0.867,
79
  "blame shifting": 0.116,
 
80
  "coercion": 0.100,
81
  "aggression": 0.100,
82
  "nonabusive": 0.100,
 
84
  "projection": 0.100,
85
  "insults": 0.100
86
  }
87
+
88
  PATTERN_WEIGHTS = {
89
+ "gaslighting": 1.5,
90
+ "control": 1.2,
91
+ "dismissiveness": 0.7,
92
+ "blame shifting": 0.5,
93
+ "insults": 1.4,
94
+ "projection": 1.2,
95
+ "recovery": 1.1,
96
+ "coercion": 1.3,
97
+ "aggression": 1.4,
98
+ "nonabusive": 0.1,
99
+ "deflection": 0.4
100
  }
101
  RISK_STAGE_LABELS = {
102
  1: "πŸŒ€ Risk Stage: Tension-Building\nThis message reflects rising emotional pressure or subtle control attempts.",