DocUA commited on
Commit
f8dfa52
·
1 Parent(s): 8cd03e6

docs: Add K/L/S/T classification diagram to README

Browse files

- Add visual flowchart showing Entry Classifier logic
- Include detailed explanation of K/L/S/T format
- Add examples table with real patient messages
- Show routing logic for all 4 modes
- Mermaid diagram with color-coded components

Improves understanding of intelligent mode routing system

Files changed (1) hide show
  1. README.md +98 -0
README.md CHANGED
@@ -34,6 +34,104 @@
34
  - Збереження історії при переключенні
35
  - Коректне завершення сесій
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  ---
38
 
39
  ## 📦 Модулі
 
34
  - Збереження історії при переключенні
35
  - Коректне завершення сесій
36
 
37
+ ### 🔍 K/L/S/T Classification Logic
38
+
39
+ Система використовує інтелектуальний Entry Classifier для автоматичного визначення найкращого режиму підтримки на основі аналізу повідомлення пацієнта:
40
+
41
+ ```mermaid
42
+ flowchart TD
43
+ %% Стилізація
44
+ classDef input fill:#e8f5e9,stroke:#4caf50,stroke-width:3px
45
+ classDef classifier fill:#fff9c4,stroke:#fbc02d,stroke-width:2px
46
+ classDef medical fill:#e3f2fd,stroke:#2196f3,stroke-width:2px
47
+ classDef lifestyle fill:#fff3e0,stroke:#ff9800,stroke-width:2px
48
+ classDef spiritual fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px
49
+ classDef combined fill:#fce4ec,stroke:#e91e63,stroke-width:3px
50
+ classDef urgent fill:#ffebee,stroke:#f44336,stroke-width:3px
51
+ classDef decision fill:#eceff1,stroke:#607d8b,stroke-width:2px
52
+
53
+ %% Input
54
+ Start([📨 User Message]):::input
55
+ Start --> EntryClassifier
56
+
57
+ %% Entry Classifier
58
+ EntryClassifier["🔍 ENTRY CLASSIFIER<br/>(LLM-based Analysis)"]:::classifier
59
+
60
+ EntryClassifier --> KAnalysis["<b>K - Medical Indicators</b><br/>• Symptoms<br/>• Medications<br/>• Vital signs<br/>• Pain levels"]:::medical
61
+ EntryClassifier --> LAnalysis["<b>L - Lifestyle Indicators</b><br/>• Exercise mentions<br/>• Diet/nutrition<br/>• Sleep patterns<br/>• Wellness goals"]:::lifestyle
62
+ EntryClassifier --> SAnalysis["<b>S - Spiritual Indicators</b><br/>• Meaning/purpose<br/>• Faith concerns<br/>• Hopelessness<br/>• Existential questions"]:::spiritual
63
+ EntryClassifier --> TAnalysis["<b>T - Urgency Level</b><br/>• Emergency signs<br/>• Time sensitivity<br/>• Risk assessment"]:::urgent
64
+
65
+ KAnalysis --> KResult{"K Result"}:::decision
66
+ LAnalysis --> LResult{"L Result"}:::decision
67
+ SAnalysis --> SResult{"S Result"}:::decision
68
+ TAnalysis --> TResult{"T Result"}:::decision
69
+
70
+ KResult -->|"none"| KNone["K = none"]
71
+ KResult -->|"minor"| KMinor["K = minor"]
72
+ KResult -->|"urgent"| KUrgent["K = urgent"]:::urgent
73
+
74
+ LResult -->|"off"| LOff["L = off"]
75
+ LResult -->|"on"| LOn["L = on"]:::lifestyle
76
+
77
+ SResult -->|"off"| SOff["S = off"]
78
+ SResult -->|"on"| SOn["S = on"]:::spiritual
79
+
80
+ TResult -->|"routine"| TRoutine["T = routine"]
81
+ TResult -->|"urgent"| TUrgent["T = urgent"]:::urgent
82
+ TResult -->|"emergency"| TEmergency["T = emergency"]:::urgent
83
+
84
+ %% Routing Logic
85
+ KUrgent --> MedicalPriority["🏥 MEDICAL MODE<br/>(Priority Override)"]:::medical
86
+ TEmergency --> MedicalPriority
87
+ TUrgent --> MedicalPriority
88
+
89
+ KNone --> RoutingCheck
90
+ KMinor --> RoutingCheck
91
+ TRoutine --> RoutingCheck
92
+
93
+ RoutingCheck{"Routing<br/>Decision"}:::classifier
94
+
95
+ %% Routing based on L and S
96
+ LOff --> RoutingCheck
97
+ LOn --> RoutingCheck
98
+ SOff --> RoutingCheck
99
+ SOn --> RoutingCheck
100
+
101
+ RoutingCheck -->|"L=on, S=off"| LifestyleMode["💚 LIFESTYLE MODE"]:::lifestyle
102
+ RoutingCheck -->|"L=off, S=on"| SpiritualMode["🕊️ SPIRITUAL MODE"]:::spiritual
103
+ RoutingCheck -->|"L=on, S=on"| CombinedMode["🌟 COMBINED MODE"]:::combined
104
+ RoutingCheck -->|"L=off, S=off"| MedicalDefault["🏥 MEDICAL MODE<br/>(Default)"]:::medical
105
+
106
+ %% Output
107
+ MedicalPriority --> Output
108
+ LifestyleMode --> Output
109
+ SpiritualMode --> Output
110
+ CombinedMode --> Output
111
+ MedicalDefault --> Output
112
+
113
+ Output([📤 Route to Assistant]):::input
114
+
115
+ %% Legend
116
+ subgraph Legend["📋 K/L/S/T FORMAT"]
117
+ direction LR
118
+ LegK["<b>K</b> - Medical (none/minor/urgent)"]
119
+ LegL["<b>L</b> - Lifestyle (off/on)"]
120
+ LegS["<b>S</b> - Spiritual (off/on)"]
121
+ LegT["<b>T</b> - Urgency (routine/urgent/emergency)"]
122
+ end
123
+ ```
124
+
125
+ **Приклади класифікації:**
126
+
127
+ | Повідомлення пацієнта | K | L | S | T | Режим |
128
+ |------------------------|---|---|---|---|-------|
129
+ | "У мене болить голова" | minor | off | off | routine | 🏥 Medical |
130
+ | "Хочу почати займатися спортом" | none | on | off | routine | 💚 Lifestyle |
131
+ | "Втратив сенс життя після хвороби" | none | off | on | routine | 🕊️ Spiritual |
132
+ | "Хочу бути здоровішим, але відчуваю порожнечу" | none | on | on | routine | 🌟 Combined |
133
+ | "Сильний біль у грудях!" | urgent | off | off | emergency | 🏥 Medical (Priority) |
134
+
135
  ---
136
 
137
  ## 📦 Модулі