SamanthaStorm commited on
Commit
16058bd
·
verified ·
1 Parent(s): 6153eb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -58,7 +58,7 @@ PATTERN_WEIGHTS = {
58
 
59
  # --- DARVO Detection Tools ---
60
  DARVO_PATTERNS = {
61
- "blame shifting", "projection", "mockery", "dismissiveness", "deflection", "guilt tripping"
62
  }
63
  DARVO_MOTIFS = [
64
  "i guess i’m the bad guy", "after everything i’ve done", "you always twist everything",
@@ -92,11 +92,12 @@ def calculate_darvo_score(patterns, sentiment_before, sentiment_after, motifs_fo
92
  darvo_score = (
93
  0.3 * pattern_score +
94
  0.3 * sentiment_shift_score +
95
- 0.2 * motif_score +
96
- 0.2 * contradiction_score
97
  )
98
  return round(min(darvo_score, 1.0), 3)
99
 
 
100
  def custom_sentiment(text):
101
  inputs = sentiment_tokenizer(text, return_tensors="pt", truncation=True, padding=True)
102
  with torch.no_grad():
 
58
 
59
  # --- DARVO Detection Tools ---
60
  DARVO_PATTERNS = {
61
+ "blame shifting", "projection", "dismissiveness", "guilt tripping", "contradictory statements"
62
  }
63
  DARVO_MOTIFS = [
64
  "i guess i’m the bad guy", "after everything i’ve done", "you always twist everything",
 
92
  darvo_score = (
93
  0.3 * pattern_score +
94
  0.3 * sentiment_shift_score +
95
+ 0.25 * motif_score +
96
+ 0.15 * contradiction_score
97
  )
98
  return round(min(darvo_score, 1.0), 3)
99
 
100
+
101
  def custom_sentiment(text):
102
  inputs = sentiment_tokenizer(text, return_tensors="pt", truncation=True, padding=True)
103
  with torch.no_grad():