Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -108,7 +108,12 @@ def calculate_darvo_score(patterns, sentiment_before, sentiment_after, motifs_fo
|
|
108 |
m_hits = len([m for m in motifs_found if any(f.lower() in m.lower() for f in DARVO_MOTIFS)])
|
109 |
m_score = m_hits / len(DARVO_MOTIFS)
|
110 |
c_score = 1.0 if contradiction_flag else 0.0
|
111 |
-
raw =
|
|
|
|
|
|
|
|
|
|
|
112 |
return round(min(raw,1.0),3)
|
113 |
|
114 |
def generate_risk_snippet(abuse_score, top_label, escalation_score, stage):
|
|
|
108 |
m_hits = len([m for m in motifs_found if any(f.lower() in m.lower() for f in DARVO_MOTIFS)])
|
109 |
m_score = m_hits / len(DARVO_MOTIFS)
|
110 |
c_score = 1.0 if contradiction_flag else 0.0
|
111 |
+
raw = (
|
112 |
+
0.25 * pattern_score
|
113 |
+
+ 0.30 * sentiment_shift_score
|
114 |
+
+ 0.35 * motif_score
|
115 |
+
+ 0.10 * contradiction_score
|
116 |
+
)
|
117 |
return round(min(raw,1.0),3)
|
118 |
|
119 |
def generate_risk_snippet(abuse_score, top_label, escalation_score, stage):
|