Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -642,10 +642,10 @@ def analyze_composite(msg1, date1, msg2, date2, msg3, date3, *answers_and_none):
|
|
642 |
|
643 |
composite_abuse = int(round(sum(composite_abuse_scores) / len(composite_abuse_scores)))
|
644 |
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
|
650 |
if total_weight > 0:
|
651 |
final_score = (weighted_score / total_weight) * 100
|
|
|
642 |
|
643 |
composite_abuse = int(round(sum(composite_abuse_scores) / len(composite_abuse_scores)))
|
644 |
|
645 |
+
for label, score in top_patterns:
|
646 |
+
weight = PATTERN_WEIGHTS.get(label, 1.0)
|
647 |
+
weighted_score += score * weight
|
648 |
+
total_weight += weight
|
649 |
|
650 |
if total_weight > 0:
|
651 |
final_score = (weighted_score / total_weight) * 100
|