Skip to content

Latest commit

ย 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Python React TypeScript Flask Scikit-learn

๐Ÿฅ SymptoGuide

AI-Powered Healthcare Assistant for Symptom Analysis & Medical Guidance

SymptoGuide is an intelligent healthcare assistance system that helps users understand and categorize their symptoms, providing preliminary assessments and guiding them toward appropriate medical experts or hospitals.


๐ŸŽฏ Problem Statement

Community Connection Challenge - The Local Services Trust Problem

Develop an intelligent healthcare assistance system that:

  • โœ… Helps users understand and categorize their symptoms
  • โœ… Provides preliminary, non-diagnostic assessments
  • โœ… Guides users toward appropriate medical experts or hospitals
  • โœ… Identifies emergency indicators and concern areas
  • โœ… Recommends departments and specialists

โš ๏ธ Disclaimer: This system does NOT replace professional medical diagnosis. Always consult a healthcare provider for medical advice.


๐Ÿ’ก Our Solution

SymptoGuide combines Machine Learning and Natural Language Processing to:

  1. ๐Ÿ—ฃ๏ธ Accept natural language symptom descriptions - "I have a bad headache and feeling very tired"
  2. ๐Ÿ” Extract and identify symptoms using NLP with 100+ phrase mappings
  3. ๐Ÿค– Predict potential conditions using an ensemble ML model (Random Forest + Gradient Boosting + SVM)
  4. ๐Ÿ“Š Assess severity levels and identify emergency indicators
  5. ๐Ÿ’Š Provide recommendations including specialists, medications, diet, and precautions
  6. ๐Ÿฅ Connect users to nearby hospitals and appropriate departments

โœจ Features

๐Ÿ”ฌ AI-Powered Symptom Analysis

  • Natural language processing for symptom extraction
  • Support for 230+ medical symptoms
  • Intelligent phrase matching ("chest pain", "difficulty breathing", etc.)

๐ŸŽฏ Disease Prediction

  • Ensemble machine learning model with 95%+ accuracy
  • Top-3 disease predictions with confidence scores
  • Confidence level indicators (High/Medium/Low)

๐Ÿšจ Emergency Detection

  • Automatic identification of red-flag symptoms
  • Emergency severity scoring
  • Urgent care recommendations

๐Ÿ‘จโ€โš•๏ธ Smart Recommendations

  • Specialist recommendations based on predicted condition
  • Personalized precautions and medications
  • Diet and workout suggestions
  • Nearby hospital finder

๐Ÿ’ป Modern User Interface

  • Step-by-step symptom checker wizard
  • Real-time symptom extraction preview
  • Beautiful, responsive design
  • Dark/Light mode support

๐Ÿ› ๏ธ Tech Stack

Frontend

Technology Purpose
โš›๏ธ React 18 UI Framework
๐Ÿ“˜ TypeScript Type Safety
โšก Vite Build Tool
๐ŸŽจ Tailwind CSS Styling
๐Ÿงฉ Shadcn/UI Component Library
๐Ÿ”„ React Query Data Fetching
๐Ÿงญ React Router Navigation
๐Ÿ“Š Recharts Data Visualization

Backend

Technology Purpose
๐Ÿ Python 3.10+ Core Language
๐ŸŒ Flask REST API Framework
๐Ÿค– Scikit-learn Machine Learning
๐Ÿ”ข Pandas & NumPy Data Processing
๐Ÿ“ NLTK Natural Language Processing
๐Ÿ“ฆ Pickle Model Serialization

Machine Learning Model

Component Details
๐ŸŽฒ Algorithm Ensemble (Random Forest + Extra Trees + Gradient Boosting + KNN + SVM)
๐Ÿ“Š Features 230 binary symptom features
๐Ÿท๏ธ Classes 40+ disease categories
๐Ÿ“ˆ Accuracy 95%+ on test data

๐Ÿ“ Project Structure

SymptoGuide/
โ”œโ”€โ”€ ๐Ÿ“‚ backend/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ app.py                    # Flask API server
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ requirements.txt          # Python dependencies
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ฆ healthcare_model.pkl      # Trained ML model
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ data/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ cleaned_datasets/     # Processed data files
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ diseases_symptoms_cleaned.csv
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ symptom_severity_cleaned.csv
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ medications_cleaned.csv
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ precautions_cleaned.csv
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ diets_cleaned.csv
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ raw_data/             # Original datasets
โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ model/
โ”‚       โ”œโ”€โ”€ ๐Ÿ“„ Healthcare_Assistant_System.py  # Core ML model
โ”‚       โ”œโ”€โ”€ ๐Ÿ“„ Interract.py                    # CLI & NLP extraction
โ”‚       โ”œโ”€โ”€ ๐Ÿ“„ Feature_Engineering.py          # Feature processing
โ”‚       โ””โ”€โ”€ ๐Ÿ“„ Complete_data_clean.py          # Data preprocessing
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ frontend/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ package.json              # Node dependencies
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ vite.config.ts            # Vite configuration
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ tailwind.config.ts        # Tailwind CSS config
โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ src/
โ”‚       โ”œโ”€โ”€ ๐Ÿ“„ App.tsx               # Main App component
โ”‚       โ”œโ”€โ”€ ๐Ÿ“‚ pages/
โ”‚       โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ Index.tsx         # Landing page
โ”‚       โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ SymptomChecker.tsx # Symptom input wizard
โ”‚       โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ Results.tsx       # Analysis results
โ”‚       โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ Hospitals.tsx     # Hospital finder
โ”‚       โ”‚   โ””โ”€โ”€ ๐Ÿ“„ Specialists.tsx   # Specialist directory
โ”‚       โ”œโ”€โ”€ ๐Ÿ“‚ components/           # Reusable UI components
โ”‚       โ”œโ”€โ”€ ๐Ÿ“‚ services/
โ”‚       โ”‚   โ””โ”€โ”€ ๐Ÿ“„ api.ts            # Backend API client
โ”‚       โ””โ”€โ”€ ๐Ÿ“‚ data/
โ”‚           โ””โ”€โ”€ ๐Ÿ“„ mockData.ts       # Fallback data
โ”‚
โ”œโ”€โ”€ ๐Ÿ“„ README.md
โ”œโ”€โ”€ ๐Ÿ“„ LICENSE
โ””โ”€โ”€ ๐Ÿ“„ package.json

๐Ÿš€ Getting Started

Prerequisites

Requirement Version
๐Ÿ Python 3.10+
๐Ÿ“ฆ Node.js 18+
๐Ÿ“ฆ npm/bun Latest

Installation

1๏ธโƒฃ Clone the Repository

git clone https://github.com/ParthShikhare19/SymptoGuide.git
cd SymptoGuide

2๏ธโƒฃ Backend Setup

cd backend

# Create virtual environment (recommended)
python -m venv venv
venv\Scripts\activate  # Windows
# source venv/bin/activate  # Linux/Mac

# Install dependencies
pip install -r requirements.txt

# Download NLTK data (first time only)
python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords'); nltk.download('wordnet')"

3๏ธโƒฃ Frontend Setup

cd frontend

# Install dependencies
npm install
# or
bun install

โ–ถ๏ธ Running the Application

Start Backend Server

cd backend
python app.py

The API will be available at http://localhost:5000

Start Frontend Development Server

cd frontend
npm run dev
# or
bun dev

The app will be available at http://localhost:5173


๐Ÿ”Œ API Endpoints

Method Endpoint Description
GET /api/health Health check
GET /api/symptoms Get all available symptoms
GET /api/symptom-keywords Get symptom keywords for NLP
POST /api/analyze Analyze symptoms (ML-powered)
POST /api/assess Simple triage assessment
POST /api/extract-symptoms Extract symptoms from text

Example: Analyze Symptoms

curl -X POST http://localhost:5000/api/analyze \
  -H "Content-Type: application/json" \
  -d '{
    "symptoms": ["fever", "headache", "fatigue"],
    "description": "I have been feeling very tired with high fever",
    "severity": "moderate",
    "duration": "3-7 days"
  }'

๐Ÿงช Testing the Model (CLI)

You can test the model directly from the command line:

cd backend/model
python Interract.py

Then enter symptoms naturally:

๐Ÿ—ฃ๏ธ  Describe how you're feeling: I have a bad headache, fever and feeling very tired

โœ… Identified 3 symptom(s):
   1. Headache
   2. High Fever
   3. Fatigue

Predicted Disease: Typhoid
Confidence: 87.3%
Recommended Specialist: Infectious Disease Specialist

๐Ÿ“Š Datasets Used

Dataset Description Records
diseases_symptoms_cleaned.csv Disease-symptom mappings 4,920
symptom_severity_cleaned.csv Symptom severity weights 133
disease_description_cleaned.csv Disease descriptions 41
precautions_cleaned.csv Disease precautions 41
medications_cleaned.csv Recommended medications 41
diets_cleaned.csv Diet recommendations 41
workouts_cleaned.csv Workout recommendations 41

๐Ÿ”ฎ Future Enhancements

  • ๐ŸŒ Multi-language support
  • ๐Ÿ“ฑ Mobile app (React Native)
  • ๐Ÿ—บ๏ธ Real-time hospital mapping with Google Maps API
  • ๐Ÿ“ž Telemedicine integration
  • ๐Ÿ“ˆ User health history tracking
  • ๐Ÿ”” Symptom progression alerts

๐Ÿ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


๐Ÿ‘ฅ Contributors

Chetan Chaudhari
Chetan Chaudhari
Nischay Chavan
Nischay Chavan
Parth Shikhare
Parth Shikhare
Tanvi Patil
Tanvi Patil

Made with โค๏ธ for better healthcare accessibility

โญ Star this repo โ€ข ๐Ÿ› Report Bug โ€ข โœจ Request Feature

About

An AI-powered healthcare assistant that analyzes symptoms, predicts potential conditions, and provides personalized health recommendations with nearby hospital location services.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages