Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -458,6 +458,9 @@ def analyze_single_message(text, thresholds):
|
|
458 |
label for label, score in zip(LABELS, scores)
|
459 |
if score > adjusted_thresholds[label]
|
460 |
]
|
|
|
|
|
|
|
461 |
# Post-threshold validation: strip recovery if it occurs with undermining sentiment
|
462 |
# Override top label if recovery was removed
|
463 |
if "recovery" in threshold_labels and tone_tag == "forced accountability flip":
|
@@ -499,9 +502,6 @@ def analyze_single_message(text, thresholds):
|
|
499 |
|
500 |
abuse_score = min(abuse_score_raw, 100 if "threat" in threshold_labels or "control" in threshold_labels else 95)
|
501 |
|
502 |
-
# Get tone tag
|
503 |
-
tone_tag = get_emotional_tone_tag(emotion_profile, sentiment, threshold_labels, abuse_score)
|
504 |
-
print(f"Emotional Tone Tag: {tone_tag}")
|
505 |
|
506 |
# Debug logs
|
507 |
print("Emotion Profile:")
|
|
|
458 |
label for label, score in zip(LABELS, scores)
|
459 |
if score > adjusted_thresholds[label]
|
460 |
]
|
461 |
+
# Get tone tag
|
462 |
+
tone_tag = get_emotional_tone_tag(emotion_profile, sentiment, threshold_labels, abuse_score)
|
463 |
+
print(f"Emotional Tone Tag: {tone_tag}")
|
464 |
# Post-threshold validation: strip recovery if it occurs with undermining sentiment
|
465 |
# Override top label if recovery was removed
|
466 |
if "recovery" in threshold_labels and tone_tag == "forced accountability flip":
|
|
|
502 |
|
503 |
abuse_score = min(abuse_score_raw, 100 if "threat" in threshold_labels or "control" in threshold_labels else 95)
|
504 |
|
|
|
|
|
|
|
505 |
|
506 |
# Debug logs
|
507 |
print("Emotion Profile:")
|