Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -147,8 +147,8 @@ def analyze_single_message(text, thresholds):
|
|
147 |
abuse_score = min(np.mean(weighted_scores) * 100, 100)
|
148 |
|
149 |
stage = get_risk_stage(threshold_labels, sentiment)
|
|
|
150 |
|
151 |
-
return abuse_score, threshold_labels, top_patterns, result, stage
|
152 |
print("\n--- Debug Info ---")
|
153 |
print(f"Text: {text}")
|
154 |
print(f"Sentiment: {sentiment} (raw: {result['label']}, score: {result['score']:.3f})")
|
@@ -159,6 +159,9 @@ def analyze_single_message(text, thresholds):
|
|
159 |
print(f"Motifs: {motifs}")
|
160 |
print(f"Contradiction: {contradiction_flag}")
|
161 |
print("------------------\n")
|
|
|
|
|
|
|
162 |
def analyze_composite(msg1, msg2, msg3, *answers_and_none):
|
163 |
responses = answers_and_none[:len(ESCALATION_QUESTIONS)]
|
164 |
none_selected = answers_and_none[-1]
|
|
|
147 |
abuse_score = min(np.mean(weighted_scores) * 100, 100)
|
148 |
|
149 |
stage = get_risk_stage(threshold_labels, sentiment)
|
150 |
+
stage = get_risk_stage(threshold_labels, sentiment)
|
151 |
|
|
|
152 |
print("\n--- Debug Info ---")
|
153 |
print(f"Text: {text}")
|
154 |
print(f"Sentiment: {sentiment} (raw: {result['label']}, score: {result['score']:.3f})")
|
|
|
159 |
print(f"Motifs: {motifs}")
|
160 |
print(f"Contradiction: {contradiction_flag}")
|
161 |
print("------------------\n")
|
162 |
+
|
163 |
+
return abuse_score, threshold_labels, top_patterns, result, stage
|
164 |
+
|
165 |
def analyze_composite(msg1, msg2, msg3, *answers_and_none):
|
166 |
responses = answers_and_none[:len(ESCALATION_QUESTIONS)]
|
167 |
none_selected = answers_and_none[-1]
|