Spaces:
Runtime error
Runtime error
Create models.py
Browse files
models.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# models.py
|
2 |
+
# (the dataclasses/enums)
|
3 |
+
|
4 |
+
from dataclasses import dataclass
|
5 |
+
from typing import List
|
6 |
+
from enum import Enum
|
7 |
+
|
8 |
+
@dataclass
|
9 |
+
class MessageAnalysis:
|
10 |
+
timestamp: str # ISO format string for JSON compatibility
|
11 |
+
message_id: str
|
12 |
+
text: str
|
13 |
+
sender: str
|
14 |
+
abuse_score: float
|
15 |
+
darvo_score: float
|
16 |
+
boundary_health: str
|
17 |
+
detected_patterns: List[str]
|
18 |
+
emotional_tone: str
|
19 |
+
risk_level: str
|
20 |
+
|
21 |
+
class RiskTrend(Enum):
|
22 |
+
ESCALATING = "escalating"
|
23 |
+
STABLE_HIGH = "stable_high"
|
24 |
+
STABLE_MODERATE = "stable_moderate"
|
25 |
+
IMPROVING = "improving"
|
26 |
+
CYCLICAL = "cyclical"
|
27 |
+
UNKNOWN = "unknown"
|