Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -96,11 +96,11 @@ def analyze_composite(msg1, msg2, msg3, flags):
|
|
96 |
flag_multiplier = 1 + (0.1 * len(flags)) # each checked flag increases weight by 10%
|
97 |
results = [analyze_single_message(m, thresholds, flags) for m in active_messages]
|
98 |
abuse_scores = [r[0] for r in results]
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
|
105 |
result = f"These messages show patterns of {', '.join(label for label, _ in top_labels)} and are estimated to be {composite_score}% likely abusive."
|
106 |
for expl in top_explanations:
|
|
|
96 |
flag_multiplier = 1 + (0.1 * len(flags)) # each checked flag increases weight by 10%
|
97 |
results = [analyze_single_message(m, thresholds, flags) for m in active_messages]
|
98 |
abuse_scores = [r[0] for r in results]
|
99 |
+
base_score = sum(abuse_scores) / len(abuse_scores)
|
100 |
+
danger_weight = 5 # or experiment with this
|
101 |
+
adjusted_score = min(base_score + len(flags) * danger_weight, 100)
|
102 |
+
composite_score = round(adjusted_score, 2)
|
103 |
+
|
104 |
|
105 |
result = f"These messages show patterns of {', '.join(label for label, _ in top_labels)} and are estimated to be {composite_score}% likely abusive."
|
106 |
for expl in top_explanations:
|