File size: 3,636 Bytes
29859f5
 
 
 
 
 
9a47985
29859f5
 
 
 
 
 
9a47985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
title: Astral.AI
emoji: πŸƒ
colorFrom: pink
colorTo: red
sdk: gradio
sdk_version: 5.37.0
app_file: app.py
pinned: false
license: afl-3.0
short_description: An AI Powered Tracker
---

# 🩺 Pediatric Respiratory Triage Assistant (NLP-Powered)

An intelligent, interactive assistant that helps parents and caregivers **triage common pediatric respiratory symptoms**.  
Built using interpretable machine learning, custom NLP pipelines, and deployed with a friendly **Gradio chatbot interface**.

> ⚠️ This tool provides **non-diagnostic guidance** only. It is not a substitute for medical advice.

---

## πŸš€ Live Demo

Try the app on [Hugging Face Spaces](https://huggingface.co/spaces/your-username/pediatric-triage)  
*(replace with actual URL when deployed)*

---

## 🎯 Project Objective

- Enable users to describe symptoms in **natural language**
- Use an ML model to classify input into **one of four triage levels**
- Return a **safe, easy-to-understand recommendation**
- Support early triage decisions, especially in low-resource or high-volume contexts

---

## 🧠 How It Works

1. User enters a free-text symptom description  
2. The text is processed via `TF-IDF` vectorization  
3. A **Decision Tree classifier** predicts the triage category  
4. A friendly chatbot message is displayed based on the prediction

### Triage Labels:
| Label               | Guidance                                                               |
|--------------------|-------------------------------------------------------------------------|
| 🟒 Monitor at Home  | Mild symptoms, low risk. Watch and observe.                            |
| 🟑 Consult GP       | Suggests seeing a doctor for further evaluation.                       |
| 🫁 Use Inhaler       | Asthma-like symptoms. Use prescribed inhaler and monitor closely.     |
| πŸ”΄ Visit Emergency  | Serious symptoms. Seek urgent medical attention.                       |

---

## πŸ§ͺ Model Summary

- Vectorizer: `TfidfVectorizer` with bigrams
- Best model: `DecisionTreeClassifier` (Accuracy: 96%)
- Other tested models: Linear SVM, XGBoost, LightGBM, Random Forest

---

## πŸ—ƒοΈ Files in This Repo

```mathematica
β”œβ”€β”€ app.py # Gradio app entry point
β”œβ”€β”€ best_model_decision_tree.joblib # Trained ML model
β”œβ”€β”€ requirements.txt # All required libraries
β”œβ”€β”€ README.md # You're reading it
```

---

## 🧰 Tech Stack

- `Gradio` – chatbot interface
- `Scikit-learn` – model training + TF-IDF pipeline
- `XGBoost`, `LightGBM`, `Random Forest` – tested alternates
- `Joblib` – model persistence
- `Matplotlib`, `Seaborn` – EDA & diagnostics

---

## 🧠 Limitations

- Not a diagnostic system β€” designed only for **low-risk triage advice**
- Based on synthetic and heuristic-labeled data from medical education text
- Requires expansion for multilingual or multi-condition support

---

## 🧭 Future Plans

- Integrate BERT for deeper semantic understanding  
- Add class weighting or active learning  
- Train on verified clinical text or real-world triage logs  
- Publish as an embeddable widget or API

---

## ⚠️ Disclaimer

This project is for educational and research purposes only. It is not a certified medical device or diagnostic tool.  
Always consult a licensed healthcare provider for professional medical advice.

---

## πŸ“„ License

MIT License – feel free to modify, fork, and improve responsibly.

---

## πŸ™Œ Credits

Built with ❀️ by [SilverDragon9](https://huggingface.co/SilverDragon9)  
Inspired by pediatricians, caregivers, and the need for accessible, responsible healthcare AI.