SamanthaStorm commited on
Commit
cbc7dd5
·
verified ·
1 Parent(s): 318d453

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -148,7 +148,17 @@ def analyze_single_message(text, thresholds, motif_flags):
148
 
149
  pattern_labels = threshold_labels + [label for label, _ in matched_phrases]
150
  darvo_score = calculate_darvo_score(pattern_labels, 0.0, sentiment_score, motifs, contradiction_flag)
151
-
 
 
 
 
 
 
 
 
 
 
152
  return (
153
  np.mean([score for _, score in top_patterns]) * 100,
154
  threshold_labels,
 
148
 
149
  pattern_labels = threshold_labels + [label for label, _ in matched_phrases]
150
  darvo_score = calculate_darvo_score(pattern_labels, 0.0, sentiment_score, motifs, contradiction_flag)
151
+
152
+ print("\n--- Debug Info ---")
153
+ print(f"Text: {text}")
154
+ print(f"Sentiment: {sentiment} (raw: {result['label']}, score: {result['score']:.3f})")
155
+ print("Abuse Pattern Scores:")
156
+ for label, score in zip(LABELS, scores):
157
+ passed = "✅" if score > adjusted_thresholds[label] else "❌"
158
+ print(f" {label:25} → {score:.3f} {passed}")
159
+ print(f"Motifs: {motifs}")
160
+ print(f"Contradiction: {contradiction_flag}")
161
+ print("------------------\n")
162
  return (
163
  np.mean([score for _, score in top_patterns]) * 100,
164
  threshold_labels,