Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -581,19 +581,11 @@ def analyze_composite(msg1, date1, msg2, date2, msg3, date3, *answers_and_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 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
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
|
597 |
elif label in moderate:
|
598 |
counts['moderate'] += 1
|
599 |
elif label in low:
|
|
|
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 |
+
predicted_labels = [label for r in results for label, _ in r[0][2]]
|
585 |
+
|
586 |
+
for label in predicted_labels:
|
587 |
+
if label in high:
|
588 |
+
counts['high'] += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
589 |
elif label in moderate:
|
590 |
counts['moderate'] += 1
|
591 |
elif label in low:
|