SamanthaStorm commited on
Commit
898be48
·
verified ·
1 Parent(s): 16b94bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -446,6 +446,13 @@ def analyze_single_message(text, thresholds):
446
  label for label, score in zip(LABELS, scores)
447
  if score > adjusted_thresholds[label]
448
  ]
 
 
 
 
 
 
 
449
 
450
  top_patterns = sorted(
451
  [(label, score) for label, score in zip(LABELS, scores)],
 
446
  label for label, score in zip(LABELS, scores)
447
  if score > adjusted_thresholds[label]
448
  ]
449
+ # Suppress all outputs if no abuse labels pass threshold
450
+ if not threshold_labels:
451
+ abuse_score = 0.0
452
+ darvo_score = 0.0
453
+ top_patterns = []
454
+ tone_tag = "supportive"
455
+ return abuse_score, threshold_labels, top_patterns, {"label": sentiment}, stage, darvo_score, tone_tag
456
 
457
  top_patterns = sorted(
458
  [(label, score) for label, score in zip(LABELS, scores)],