StringJammer commited on
Commit
775ea8e
Β·
verified Β·
1 Parent(s): 46a6d24

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +72 -38
README.md CHANGED
@@ -9,6 +9,8 @@ tags:
9
  - distilbert
10
  - patient-doctor-conversations
11
  - text-classification
 
 
12
  model_index:
13
  - name: patient-emotion-classifier
14
  results:
@@ -16,34 +18,61 @@ model_index:
16
  type: text-classification
17
  metrics:
18
  - type: accuracy
19
- value: 0.67
20
  - type: f1
21
- value: 0.62
22
  ---
23
 
24
- # Patient Emotion Analysis
25
 
26
- NLP emotion classification model for patient-doctor conversations.
27
 
28
- ## Emotion Categories
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  | Category | Description |
31
  |----------|-------------|
32
- | Neutral | Neutral statements |
33
- | Anxiety/Fear | Patient expresses worry or fear |
34
- | Anger/Frustration | Patient shows frustration or anger |
35
- | Sadness/Helplessness | Patient feels sad or helpless |
36
- | Confusion/Doubt | Patient expresses confusion or doubt |
37
- | Gratitude/Relief | Patient expresses gratitude |
38
 
39
- ## Model Performance
40
 
41
  ### Overall Metrics
42
 
43
  | Metric | Value |
44
  |--------|-------|
45
- | Accuracy | 71.3% |
46
- | Macro F1 | 0.72 |
47
  | Weighted F1 | 0.72 |
48
 
49
  ### Per-Class Performance
@@ -61,53 +90,58 @@ NLP emotion classification model for patient-doctor conversations.
61
 
62
  ![Label Distribution](data/label_distribution.png)
63
 
64
- ## Quick Start
65
 
66
  ### 1. Install Dependencies
67
 
68
  ```bash
69
  pip install -r requirements.txt
70
- ```
71
 
72
- ### 2. Run the Service
73
 
74
  ```bash
75
  cd see
76
  python app.py
77
- ```
78
 
79
- ### 3. Open in Browser
80
 
81
- ```
82
  http://localhost:8002
83
- ```
84
 
85
- ## Dataset
86
 
87
- - **Original Source**: [Chinese MedDialog Dataset](https://tianchi.aliyun.com/dataset/92110) (ι˜Ώι‡ŒδΊ‘ε€©ζ± )
88
- - **Processing**: Filtered and labeled for 6 emotion categories
89
- - **Total samples**: 28,280
 
 
90
  - **Categories**: 6 emotion labels
91
  - **Language**: English
92
 
93
- ## Model
94
 
95
- - **Base model**: [DistilBERT](https://huggingface.co/distilbert/distilbert-base-uncased)
96
- - **Task**: 6-class emotion classification
 
 
 
 
97
 
98
- ## Directory Structure
99
 
100
- ```
101
  patient-emotion-analysis/
102
- β”œβ”€β”€ best_model/ # Trained model files
103
  β”œβ”€β”€ see/ # Inference service
104
- β”‚ β”œβ”€β”€ app.py
105
- β”‚ β”œβ”€β”€ inference.py
106
- β”‚ └── templates/
107
- β”œβ”€β”€ data/ # Training dataset
108
- β”œβ”€β”€ requirements.txt
109
- └── README.md
110
- ```
 
111
 
 
112
 
 
113
 
 
 
9
  - distilbert
10
  - patient-doctor-conversations
11
  - text-classification
12
+ - clinical-AI
13
+ - mental-health
14
  model_index:
15
  - name: patient-emotion-classifier
16
  results:
 
18
  type: text-classification
19
  metrics:
20
  - type: accuracy
21
+ value: 0.713
22
  - type: f1
23
+ value: 0.722
24
  ---
25
 
26
+ <div align="center">
27
 
28
+ # πŸ€– Patient Emotion Classifier
29
 
30
+ **Advanced AI-Powered Emotion Recognition for Healthcare Dialogues**
31
+
32
+ *Part of the Blended AI+X Initiative β€” Bridging Artificial Intelligence and Healthcare*
33
+
34
+ ---
35
+
36
+ [![Model](https://img.shields.io/badge/Model-DistilBERT-blue)](https://huggingface.co/distilbert/distilbert-base-uncased)
37
+ [![License](https://img.shields.io/badge/License-Apache--2.0-green)](LICENSE)
38
+ [![Performance](https://img.shields.io/badge/F1--Score-72.2%25-orange)]()
39
+
40
+ </div>
41
+
42
+ ## πŸ”¬ Overview
43
+
44
+ We are thrilled to introduce **Patient Emotion Classifier**, a state-of-the-art NLP model engineered to understand emotional nuances in patient-doctor conversations.
45
+
46
+ This model represents our commitment to advancing **AI for Healthcare (AI+X)**, leveraging cutting-edge transformer architectures to bridge the gap between artificial intelligence and compassionate care.
47
+
48
+ ### Key Capabilities
49
+
50
+ - **Multiclass Emotion Recognition** β€” Identifies 6 distinct emotional states in clinical dialogues
51
+ - **Healthcare-Optimized** β€” Specifically trained on medical conversation data
52
+ - **Production-Ready** β€” Deployable via REST API for real-time inference
53
+ - **Lightweight & Efficient** β€” Built on DistilBERT for fast inference
54
+
55
+ ## 🎯 Emotion Categories
56
+
57
+ Our model classifies emotional states into **6 clinically-relevant categories**:
58
 
59
  | Category | Description |
60
  |----------|-------------|
61
+ | 😐 **Neutral** | Objective, non-emotional statements |
62
+ | 😰 **Anxiety/Fear** | Patient expresses worry, concern, or fear |
63
+ | 😠 **Anger/Frustration** | Patient shows frustration or displeasure |
64
+ | 😒 **Sadness/Helplessness** | Patient feels down or hopeless |
65
+ | πŸ€” **Confusion/Doubt** | Patient expresses uncertainty or questions |
66
+ | πŸ™ **Gratitude/Relief** | Patient conveys thanks or relief |
67
 
68
+ ## πŸ“Š Model Performance
69
 
70
  ### Overall Metrics
71
 
72
  | Metric | Value |
73
  |--------|-------|
74
+ | **Accuracy** | **71.3%** |
75
+ | **Macro F1** | **0.722** |
76
  | Weighted F1 | 0.72 |
77
 
78
  ### Per-Class Performance
 
90
 
91
  ![Label Distribution](data/label_distribution.png)
92
 
93
+ ## πŸš€ Quick Start
94
 
95
  ### 1. Install Dependencies
96
 
97
  ```bash
98
  pip install -r requirements.txt
 
99
 
100
+ ### 2. Launch the Service
101
 
102
  ```bash
103
  cd see
104
  python app.py
 
105
 
106
+ ### 3. Access the Interface
107
 
 
108
  http://localhost:8002
 
109
 
110
+ ## πŸ“š Dataset
111
 
112
+ This model was trained on a meticulously curated subset of medical dialogues:
113
+
114
+ - **Original Source**: [Chinese MedDialog Dataset](https://tianchi.aliyun.com/dataset/92110) β€” Alibaba Cloud Tianchi
115
+ - **Post-Processing**: Carefully filtered, translated, and annotated for emotion classification
116
+ - **Total Samples**: 28,280 annotated dialogues
117
  - **Categories**: 6 emotion labels
118
  - **Language**: English
119
 
120
+ ## πŸ—οΈ Technical Specifications
121
 
122
+ | Component | Details |
123
+ |-----------|---------|
124
+ | **Base Architecture** | [DistilBERT](https://huggingface.co/distilbert/distilbert-base-uncased) |
125
+ | **Task Type** | 6-class emotion classification |
126
+ | **Max Sequence Length** | 512 tokens |
127
+ | **Framework** | PyTorch + Transformers |
128
 
129
+ ## πŸ“ Project Structure
130
 
 
131
  patient-emotion-analysis/
132
+ β”œβ”€β”€ best_model/ # Fine-tuned model weights
133
  β”œβ”€β”€ see/ # Inference service
134
+ β”‚ β”œβ”€β”€ app.py # Web application
135
+ β”‚ β”œβ”€β”€ inference.py # Core inference logic
136
+ β”‚ └── templates/ # UI templates
137
+ β”œβ”€β”€ data/ # Training & evaluation data
138
+ β”œβ”€β”€ requirements.txt # Dependencies
139
+ └── README.md # This file
140
+
141
+ ---
142
 
143
+ <div align="center">
144
 
145
+ **Blended AI+X Initiative** β€” *Advancing Healthcare Through Intelligence*
146
 
147
+ </div>