SamanthaStorm commited on
Commit
aeed86a
·
verified ·
1 Parent(s): 2dc9dfb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -18
app.py CHANGED
@@ -15,30 +15,39 @@ model = RobertaForSequenceClassification.from_pretrained(model_name, trust_remot
15
  tokenizer = RobertaTokenizer.from_pretrained(model_name, trust_remote_code=True)
16
 
17
  LABELS = [
18
- "gaslighting", "mockery", "dismissiveness", "control", "guilt_tripping", "apology_baiting", "blame_shifting", "projection",
19
- "contradictory_statements", "manipulation", "deflection", "insults", "obscure_formal", "recovery_phase"
 
20
  ]
21
 
22
  THRESHOLDS = {
23
- "gaslighting": 0.25, "mockery": 0.15, "dismissiveness": 0.45, "control": 0.43, "guilt_tripping": 0.15,
24
- "apology_baiting": 0.2, "blame_shifting": 0.23, "projection": 0.50, "contradictory_statements": 0.25,
25
- "manipulation": 0.25, "deflection": 0.30, "insults": 0.34, "obscure_formal": 0.25, "recovery_phase": 0.25
 
 
 
 
 
 
 
 
26
  }
27
 
 
 
28
  EXPLANATIONS = {
29
- "gaslighting": "Gaslighting involves making someone question their own reality or perceptions...",
30
- "blame_shifting": "Blame-shifting is when one person redirects the responsibility...",
31
- "projection": "Projection involves accusing the victim of behaviors the abuser exhibits.",
32
- "dismissiveness": "Dismissiveness is belittling or disregarding another person’s feelings.",
33
- "mockery": "Mockery ridicules someone in a hurtful, humiliating way.",
34
- "recovery_phase": "Recovery phase dismisses someone's emotional healing process.",
35
- "insults": "Insults are derogatory remarks aimed at degrading someone.",
36
- "apology_baiting": "Apology-baiting manipulates victims into apologizing for abuser's behavior.",
37
- "deflection": "Deflection avoids accountability by redirecting blame.",
38
- "control": "Control restricts autonomy through manipulation or coercion.",
39
- "guilt_tripping": "Guilt-tripping uses guilt to manipulate someone’s actions.",
40
- "manipulation": "Manipulation deceives to influence or control outcomes.",
41
- "obscure_formal": "Obscure/formal language manipulates through confusion or superiority."
42
  }
43
 
44
  PATTERN_WEIGHTS = {
 
15
  tokenizer = RobertaTokenizer.from_pretrained(model_name, trust_remote_code=True)
16
 
17
  LABELS = [
18
+ "blame shifting", "contradictory statements", "control", "dismissiveness",
19
+ "gaslighting", "guilt tripping", "insults", "obscure language",
20
+ "projection", "recovery phase", "threat"
21
  ]
22
 
23
  THRESHOLDS = {
24
+ "blame shifting": 0.23,
25
+ "contradictory statements": 0.25,
26
+ "control": 0.40,
27
+ "dismissiveness": 0.45,
28
+ "gaslighting": 0.30,
29
+ "guilt tripping": 0.20,
30
+ "insults": 0.34,
31
+ "obscure language": 0.25,
32
+ "projection": 0.35,
33
+ "recovery phase": 0.25,
34
+ "threat": 0.25
35
  }
36
 
37
+ PATTERN_LABELS = LABELS
38
+
39
  EXPLANATIONS = {
40
+ "blame shifting": "Blame-shifting is when one person redirects responsibility onto someone else to avoid accountability.",
41
+ "contradictory statements": "Contradictory statements confuse the listener by flipping positions or denying previous claims.",
42
+ "control": "Control restricts another person’s autonomy through coercion, manipulation, or threats.",
43
+ "dismissiveness": "Dismissiveness is belittling or disregarding another person’s feelings, needs, or opinions.",
44
+ "gaslighting": "Gaslighting involves making someone question their own reality, memory, or perceptions.",
45
+ "guilt tripping": "Guilt-tripping uses guilt to manipulate someones actions or decisions.",
46
+ "insults": "Insults are derogatory or demeaning remarks meant to shame, belittle, or hurt someone.",
47
+ "obscure language": "Obscure language manipulates through complexity, vagueness, or superiority to confuse the other person.",
48
+ "projection": "Projection accuses someone else of the very behaviors or intentions the speaker is exhibiting.",
49
+ "recovery phase": "Recovery phase statements attempt to soothe or reset tension without acknowledging harm or change.",
50
+ "threat": "Threats use fear of harm (physical, emotional, or relational) to control or intimidate someone."
 
 
51
  }
52
 
53
  PATTERN_WEIGHTS = {