--- 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.