Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -576,21 +576,21 @@ def analyze_composite(msg1, date1, msg2, date2, msg3, date3, *answers_and_none):
|
|
576 |
responses_checked = any(answers_and_none[:-1])
|
577 |
none_selected = not responses_checked and none_selected_checked
|
578 |
|
579 |
-
if none_selected:
|
580 |
-
|
581 |
-
|
582 |
-
else:
|
583 |
-
|
584 |
|
585 |
# Abuse label escalation logic
|
586 |
-
|
587 |
-
|
588 |
'Gaslighting', 'Dismissiveness', 'Obscure Language',
|
589 |
'Insults', 'Contradictory Statements', 'Guilt-tripping'
|
590 |
-
|
591 |
-
|
592 |
|
593 |
-
|
594 |
for label in predicted_labels:
|
595 |
if label in high:
|
596 |
counts['high'] += 1
|
|
|
576 |
responses_checked = any(answers_and_none[:-1])
|
577 |
none_selected = not responses_checked and none_selected_checked
|
578 |
|
579 |
+
if none_selected:
|
580 |
+
escalation_score = None
|
581 |
+
risk_level = "unknown"
|
582 |
+
else:
|
583 |
+
escalation_score = sum(w for (_, w), a in zip(ESCALATION_QUESTIONS, answers_and_none[:-1]) if a)
|
584 |
|
585 |
# Abuse label escalation logic
|
586 |
+
high = {'Control'}
|
587 |
+
moderate = {
|
588 |
'Gaslighting', 'Dismissiveness', 'Obscure Language',
|
589 |
'Insults', 'Contradictory Statements', 'Guilt-tripping'
|
590 |
+
}
|
591 |
+
low = {'Blame-shifting', 'Projection', 'Recovery'}
|
592 |
|
593 |
+
counts = {'high': 0, 'moderate': 0, 'low': 0}
|
594 |
for label in predicted_labels:
|
595 |
if label in high:
|
596 |
counts['high'] += 1
|