SamanthaStorm commited on
Commit
daa7bce
·
verified ·
1 Parent(s): c6c79a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -103,7 +103,7 @@ def analyze_single_message(text, thresholds):
103
  )[:2]
104
 
105
  weighted_scores = [(PATTERN_WEIGHTS.get(label, 1.0) * score) for label, score in top_patterns]
106
- abuse_score = np.mean(weighted_scores) * 100
107
 
108
  stage = get_risk_stage(threshold_labels, sentiment)
109
 
@@ -157,4 +157,4 @@ iface = gr.Interface(
157
  )
158
 
159
  if __name__ == "__main__":
160
- iface.launch()
 
103
  )[:2]
104
 
105
  weighted_scores = [(PATTERN_WEIGHTS.get(label, 1.0) * score) for label, score in top_patterns]
106
+ abuse_score = min(np.mean(weighted_scores) * 100, 100)
107
 
108
  stage = get_risk_stage(threshold_labels, sentiment)
109
 
 
157
  )
158
 
159
  if __name__ == "__main__":
160
+ iface.launch()