SamanthaStorm commited on
Commit
37f3ef9
·
verified ·
1 Parent(s): 252a66b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -121,11 +121,10 @@ def analyze_messages(input_text, risk_flags):
121
  outputs = model(**inputs)
122
  scores = torch.sigmoid(outputs.logits.squeeze(0)).numpy()
123
 
124
- pattern_labels_used = list(set(
125
- threshold_labels = [label for label, score in zip(PATTERN_LABELS, scores[:15]) if score > adjusted_thresholds[label]]
126
- phrase_labels = [label for label, _ in matched_phrases]
127
- pattern_labels_used = list(set(threshold_labels + phrase_labels))
128
- ]
129
  ))
130
 
131
  abuse_level = calculate_abuse_level(scores, adjusted_thresholds, motif_hits=[label for label, _ in matched_phrases])
 
121
  outputs = model(**inputs)
122
  scores = torch.sigmoid(outputs.logits.squeeze(0)).numpy()
123
 
124
+ threshold_labels = [label for label, score in zip(PATTERN_LABELS, scores[:15]) if score > adjusted_thresholds[label]]
125
+ phrase_labels = [label for label, _ in matched_phrases]
126
+ pattern_labels_used = list(set(threshold_labels + phrase_labels))
127
+
 
128
  ))
129
 
130
  abuse_level = calculate_abuse_level(scores, adjusted_thresholds, motif_hits=[label for label, _ in matched_phrases])