Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -499,7 +499,7 @@ def analyze_single_message(text, thresholds):
|
|
499 |
print(f"Contradiction: {contradiction_flag}")
|
500 |
print("------------------\n")
|
501 |
|
502 |
-
return abuse_score, threshold_labels, top_patterns, {"label": sentiment}, stage, darvo_score
|
503 |
|
504 |
def analyze_composite(msg1, date1, msg2, date2, msg3, date3, *answers_and_none):
|
505 |
none_selected_checked = answers_and_none[-1]
|
@@ -593,6 +593,10 @@ def analyze_composite(msg1, date1, msg2, date2, msg3, date3, *answers_and_none):
|
|
593 |
out += generate_risk_snippet(composite_abuse, top_label, escalation_score if escalation_score is not None else 0, most_common_stage)
|
594 |
out += f"\n\n{stage_text}"
|
595 |
out += darvo_blurb
|
|
|
|
|
|
|
|
|
596 |
print(f"DEBUG: avg_darvo = {avg_darvo}")
|
597 |
pattern_labels = [r[0][2][0][0] for r in results] # top label for each message
|
598 |
timeline_image = generate_abuse_score_chart(dates_used, abuse_scores, pattern_labels)
|
|
|
499 |
print(f"Contradiction: {contradiction_flag}")
|
500 |
print("------------------\n")
|
501 |
|
502 |
+
return abuse_score, threshold_labels, top_patterns, {"label": sentiment}, stage, darvo_score, tone_tag
|
503 |
|
504 |
def analyze_composite(msg1, date1, msg2, date2, msg3, date3, *answers_and_none):
|
505 |
none_selected_checked = answers_and_none[-1]
|
|
|
593 |
out += generate_risk_snippet(composite_abuse, top_label, escalation_score if escalation_score is not None else 0, most_common_stage)
|
594 |
out += f"\n\n{stage_text}"
|
595 |
out += darvo_blurb
|
596 |
+
out += "\n\n🎭 **Emotional Tones Detected:**\n"
|
597 |
+
for i, tone in enumerate(tone_tags):
|
598 |
+
label = tone if tone else "none"
|
599 |
+
out += f"• Message {i+1}: *{label}*\n"
|
600 |
print(f"DEBUG: avg_darvo = {avg_darvo}")
|
601 |
pattern_labels = [r[0][2][0][0] for r in results] # top label for each message
|
602 |
timeline_image = generate_abuse_score_chart(dates_used, abuse_scores, pattern_labels)
|