Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -112,7 +112,10 @@ def analyze_messages(input_text, risk_flags):
|
|
112 |
else:
|
113 |
resources = "For more information on abuse patterns, consider reaching out to support groups or professional counselors."
|
114 |
|
115 |
-
scored_patterns = [
|
|
|
|
|
|
|
116 |
top_patterns = sorted(scored_patterns, key=lambda x: x[1], reverse=True)[:2]
|
117 |
|
118 |
top_pattern_explanations = "\n".join([
|
|
|
112 |
else:
|
113 |
resources = "For more information on abuse patterns, consider reaching out to support groups or professional counselors."
|
114 |
|
115 |
+
scored_patterns = [
|
116 |
+
(label, score) for label, score in zip(PATTERN_LABELS, scores[:15])
|
117 |
+
if label != "non_abusive"
|
118 |
+
]
|
119 |
top_patterns = sorted(scored_patterns, key=lambda x: x[1], reverse=True)[:2]
|
120 |
|
121 |
top_pattern_explanations = "\n".join([
|