SamanthaStorm commited on
Commit
1796883
·
verified ·
1 Parent(s): 21fd350

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -98,8 +98,13 @@ def calculate_darvo_score(patterns, sentiment_before, sentiment_after, motifs_fo
98
  motif_score = motif_hits / len(DARVO_MOTIFS)
99
 
100
  contradiction_score = 1.0 if contradiction_flag else 0.0
 
 
 
 
 
 
101
 
102
- darvo_score = calculate_darvo_score(pattern_labels_used, 0.0, sentiment_score, motif_phrases, contradiction_flag=contradiction_flag)
103
  return round(min(darvo_score, 1.0), 3)
104
 
105
  def custom_sentiment(text):
 
98
  motif_score = motif_hits / len(DARVO_MOTIFS)
99
 
100
  contradiction_score = 1.0 if contradiction_flag else 0.0
101
+ darvo_score = (
102
+ 0.3 * pattern_score +
103
+ 0.3 * sentiment_shift_score +
104
+ 0.2 * motif_score +
105
+ 0.2 * contradiction_score
106
+ )
107
 
 
108
  return round(min(darvo_score, 1.0), 3)
109
 
110
  def custom_sentiment(text):