Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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()
|