Tegaconsult commited on
Commit
1b22e0c
·
verified ·
1 Parent(s): d825907

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +167 -152
README.md CHANGED
@@ -1,152 +1,167 @@
1
- # Digital Doctors Assistant ML API
2
-
3
- A FastAPI-based machine learning service that provides two prediction models for healthcare applications:
4
-
5
- 1. **Risk Assessment Model** - Predicts patient risk levels (Low/Medium/High) based on vitals and health metrics
6
- 2. **Treatment Outcome Model** - Predicts treatment success probability based on patient data and medication
7
-
8
- ## Features
9
-
10
- - RESTful API endpoints for ML predictions
11
- - Interactive web interface for easy testing
12
- - ONNX Runtime for fast inference
13
- - Pre-trained models hosted on HuggingFace
14
- - Docker support for easy deployment
15
-
16
- ## Quick Start
17
-
18
- ### Local Setup
19
-
20
- 1. Install dependencies:
21
- ```bash
22
- pip install -r requirements.txt
23
- ```
24
-
25
- 2. Set your HuggingFace token:
26
- ```bash
27
- # Windows PowerShell
28
- $env:HUGGINGFACE_TOKEN="your_token_here"
29
-
30
- # Windows CMD
31
- set HUGGINGFACE_TOKEN=your_token_here
32
-
33
- # Linux/Mac
34
- export HUGGINGFACE_TOKEN=your_token_here
35
- ```
36
-
37
- 3. Run the server:
38
- ```bash
39
- uvicorn ml:app --host 0.0.0.0 --port 7860
40
- ```
41
-
42
- 4. Open your browser:
43
- - Web Interface: http://localhost:7860
44
- - API Docs: http://localhost:7860/docs
45
- - Health Check: http://localhost:7860/health
46
-
47
- ### Docker Setup
48
-
49
- ```bash
50
- docker build -t dda-ml-api .
51
- docker run -p 7860:7860 -e HUGGINGFACE_TOKEN="your_token_here" dda-ml-api
52
- ```
53
-
54
- ## API Endpoints
55
-
56
- ### POST /predict/risk
57
- Predict patient risk level based on health metrics.
58
-
59
- **Request Body:**
60
- ```json
61
- {
62
- "age": 45,
63
- "bmi": 28.5,
64
- "systolic_bp": 140,
65
- "diastolic_bp": 90,
66
- "chronic_conditions": "diabetes,hypertension",
67
- "severity_score": 7.5
68
- }
69
- ```
70
-
71
- **Response:**
72
- ```json
73
- {
74
- "success": true,
75
- "model": "risk_assessment",
76
- "prediction": "High",
77
- "confidence": 0.85,
78
- "probabilities": {
79
- "Low": 0.05,
80
- "Medium": 0.10,
81
- "High": 0.85
82
- }
83
- }
84
- ```
85
-
86
- ### POST /predict/treatment
87
- Predict treatment outcome success probability.
88
-
89
- **Request Body:**
90
- ```json
91
- {
92
- "patient_age": 55,
93
- "severity_score": 6.5,
94
- "compliance_rate": 0.85,
95
- "medication": "Metformin",
96
- "condition": "Diabetes Type 2"
97
- }
98
- ```
99
-
100
- **Response:**
101
- ```json
102
- {
103
- "success": true,
104
- "model": "treatment_outcome",
105
- "prediction": 1,
106
- "success_probability": 78.5,
107
- "confidence": 0.78,
108
- "probabilities": {
109
- "failure": 0.22,
110
- "success": 0.78
111
- }
112
- }
113
- ```
114
-
115
- ## Supported Medications
116
-
117
- - Paracetamol
118
- - Ibuprofen
119
- - Amoxicillin
120
- - Ciprofloxacin
121
- - Metformin
122
- - Lisinopril
123
- - Amlodipine
124
- - Omeprazole
125
-
126
- ## Supported Conditions
127
-
128
- - Common Cold
129
- - Influenza
130
- - Pneumonia
131
- - Bronchitis
132
- - Hypertension
133
- - Diabetes Type 2
134
- - Migraine
135
- - Gastroenteritis
136
-
137
- ## Environment Variables
138
-
139
- - `HUGGINGFACE_TOKEN` - Required. Your HuggingFace access token for downloading models
140
-
141
- ## Technology Stack
142
-
143
- - FastAPI - Web framework
144
- - ONNX Runtime - ML inference
145
- - NumPy - Numerical computing
146
- - HuggingFace Hub - Model hosting
147
- - Pydantic - Data validation
148
- - Uvicorn - ASGI server
149
-
150
- ## License
151
-
152
- MIT
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Digital Doctors Assistant ML API
3
+ emoji: 🏥
4
+ colorFrom: blue
5
+ colorTo: purple
6
+ sdk: docker
7
+ pinned: false
8
+ license: mit
9
+ ---
10
+
11
+ # Digital Doctors Assistant ML API
12
+
13
+ A FastAPI-based machine learning service that provides two prediction models for healthcare applications:
14
+
15
+ 1. **Risk Assessment Model** - Predicts patient risk levels (Low/Medium/High) based on vitals and health metrics
16
+ 2. **Treatment Outcome Model** - Predicts treatment success probability based on patient data and medication
17
+
18
+ ## Features
19
+
20
+ - RESTful API endpoints for ML predictions
21
+ - Interactive web interface for easy testing
22
+ - ONNX Runtime for fast inference
23
+ - Pre-trained models hosted on HuggingFace
24
+ - Docker support for easy deployment
25
+
26
+ ## Quick Start
27
+
28
+ ### Using HuggingFace Space
29
+
30
+ Simply visit the Space URL and use the web interface to make predictions.
31
+
32
+ ### Run Locally with Docker
33
+
34
+ ```bash
35
+ docker run -it -p 7860:7860 \
36
+ -e HUGGINGFACE_TOKEN="your_token_here" \
37
+ registry.hf.space/your-username-your-space-name:latest
38
+ ```
39
+
40
+ ### Local Setup (Without Docker)
41
+
42
+ 1. Install dependencies:
43
+ ```bash
44
+ pip install -r requirements.txt
45
+ ```
46
+
47
+ 2. Set your HuggingFace token:
48
+ ```bash
49
+ # Windows PowerShell
50
+ $env:HUGGINGFACE_TOKEN="your_token_here"
51
+
52
+ # Windows CMD
53
+ set HUGGINGFACE_TOKEN=your_token_here
54
+
55
+ # Linux/Mac
56
+ export HUGGINGFACE_TOKEN=your_token_here
57
+ ```
58
+
59
+ 3. Run the server:
60
+ ```bash
61
+ uvicorn ml:app --host 0.0.0.0 --port 7860
62
+ ```
63
+
64
+ 4. Open your browser:
65
+ - Web Interface: http://localhost:7860
66
+ - API Docs: http://localhost:7860/docs
67
+ - Health Check: http://localhost:7860/health
68
+
69
+ ## API Endpoints
70
+
71
+ ### POST /predict/risk
72
+ Predict patient risk level based on health metrics.
73
+
74
+ **Request Body:**
75
+ ```json
76
+ {
77
+ "age": 45,
78
+ "bmi": 28.5,
79
+ "systolic_bp": 140,
80
+ "diastolic_bp": 90,
81
+ "chronic_conditions": "diabetes,hypertension",
82
+ "severity_score": 7.5
83
+ }
84
+ ```
85
+
86
+ **Response:**
87
+ ```json
88
+ {
89
+ "success": true,
90
+ "model": "risk_assessment",
91
+ "prediction": "High",
92
+ "confidence": 0.85,
93
+ "probabilities": {
94
+ "Low": 0.05,
95
+ "Medium": 0.10,
96
+ "High": 0.85
97
+ }
98
+ }
99
+ ```
100
+
101
+ ### POST /predict/treatment
102
+ Predict treatment outcome success probability.
103
+
104
+ **Request Body:**
105
+ ```json
106
+ {
107
+ "patient_age": 55,
108
+ "severity_score": 6.5,
109
+ "compliance_rate": 0.85,
110
+ "medication": "Metformin",
111
+ "condition": "Diabetes Type 2"
112
+ }
113
+ ```
114
+
115
+ **Response:**
116
+ ```json
117
+ {
118
+ "success": true,
119
+ "model": "treatment_outcome",
120
+ "prediction": 1,
121
+ "success_probability": 78.5,
122
+ "confidence": 0.78,
123
+ "probabilities": {
124
+ "failure": 0.22,
125
+ "success": 0.78
126
+ }
127
+ }
128
+ ```
129
+
130
+ ## Supported Medications
131
+
132
+ - Paracetamol
133
+ - Ibuprofen
134
+ - Amoxicillin
135
+ - Ciprofloxacin
136
+ - Metformin
137
+ - Lisinopril
138
+ - Amlodipine
139
+ - Omeprazole
140
+
141
+ ## Supported Conditions
142
+
143
+ - Common Cold
144
+ - Influenza
145
+ - Pneumonia
146
+ - Bronchitis
147
+ - Hypertension
148
+ - Diabetes Type 2
149
+ - Migraine
150
+ - Gastroenteritis
151
+
152
+ ## Environment Variables
153
+
154
+ - `HUGGINGFACE_TOKEN` - Required. Your HuggingFace access token for downloading models
155
+
156
+ ## Technology Stack
157
+
158
+ - FastAPI - Web framework
159
+ - ONNX Runtime - ML inference
160
+ - NumPy - Numerical computing
161
+ - HuggingFace Hub - Model hosting
162
+ - Pydantic - Data validation
163
+ - Uvicorn - ASGI server
164
+
165
+ ## License
166
+
167
+ MIT