SamanthaStorm commited on
Commit
8a5406e
·
verified ·
1 Parent(s): ca1d104

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -105,10 +105,10 @@ def calculate_darvo_score(patterns, sentiment_before, sentiment_after, motifs_fo
105
  contradiction_score = 1.0 if contradiction_flag else 0.0
106
  return round(min(0.3 * pattern_score + 0.3 * sentiment_shift_score + 0.25 * motif_score + 0.15 * contradiction_score, 1.0), 3)
107
 
108
- def generate_risk_snippet(abuse_score, top_label):
109
- if abuse_score >= 85:
110
  risk_level = "high"
111
- elif abuse_score >= 60:
112
  risk_level = "moderate"
113
  else:
114
  risk_level = "low"
 
105
  contradiction_score = 1.0 if contradiction_flag else 0.0
106
  return round(min(0.3 * pattern_score + 0.3 * sentiment_shift_score + 0.25 * motif_score + 0.15 * contradiction_score, 1.0), 3)
107
 
108
+ def generate_risk_snippet(abuse_score, top_label, escalation_score):
109
+ if abuse_score >= 85 or escalation_score >= 16:
110
  risk_level = "high"
111
+ elif abuse_score >= 60 or escalation_score >= 8:
112
  risk_level = "moderate"
113
  else:
114
  risk_level = "low"