Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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 |
-
"
|
| 19 |
-
"
|
|
|
|
| 20 |
]
|
| 21 |
|
| 22 |
THRESHOLDS = {
|
| 23 |
-
"
|
| 24 |
-
"
|
| 25 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
}
|
| 27 |
|
|
|
|
|
|
|
| 28 |
EXPLANATIONS = {
|
| 29 |
-
"
|
| 30 |
-
"
|
| 31 |
-
"
|
| 32 |
-
"dismissiveness": "Dismissiveness is belittling or disregarding another person’s feelings.",
|
| 33 |
-
"
|
| 34 |
-
"
|
| 35 |
-
"insults": "Insults are derogatory remarks
|
| 36 |
-
"
|
| 37 |
-
"
|
| 38 |
-
"
|
| 39 |
-
"
|
| 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 someone’s 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 = {
|