How sudhanshu-ambastha/multiple-disease-prediction-bot works
Project Type & Purpose
• This is a monolithic, single-page machine-learning web application built with Streamlit.
• Purpose: allow end users to enter symptoms → preprocess input → call a pre-trained classifier → decode prediction → display disease name.
File Structure Analysis
Top-level files (no subdirectories):
• multiple_disease_prediction.py (primary Streamlit app)
• Multiple_disease_prediction_bot_trained_model.sav (serialized sklearn model)
• label_encoder.sav (serialized LabelEncoder)
• Training.csv / Testing.csv (data sources for symptom list and optional evaluation)
• Jupyter notebooks & Python scripts (LabelEncoder.ipynb, development history – not part of runtime)
• README.md (project documentation)
Key Architecture Insights from README
• Streamlit serves both frontend (UI) and backend (logic) in one process.
• Dependencies: streamlit, joblib (model loading), pandas/numpy (data handling), scikit-learn (inference).
• Workflow: load CSV for symptom vocabulary → load model & encoder → user enters comma-separated symptoms → preprocess → predict → decode → render result.
Main Components
a. User Interface (Web Browser)
b. Streamlit Application Server (Python runtime)
• Input Module (text area + button)
• Preprocessing Module (tokenize, map to feature vector)
• Inference Module (load .sav files, call model.predict)
• Postprocessing Module (decode numeric label → string)
• Presentation Module (display result)
c. Data Stores (Local File System)
• Training.csv (symptom list)
• Testing.csv (optional eval data)
• multiple_disease_prediction_bot_trained_model.sav
• label_encoder.sav
d. External Dependencies (Python libraries, e.g., pandas, sklearn)
Relationships & Interactions
• User ↔ Browser UI ↔ Streamlit Server
• Server reads CSVs at startup → builds in-memory structures
• On “Predict” click: UI → Preprocessing → Inference → Postprocessing → UI update
• Inference Module accesses two file-based artifacts (model .sav + encoder .sav)
• All data flows are synchronous within the same process
Architectural Patterns & Principles
• Single-process, single-page “full-stack” pattern via Streamlit
• Separation of concerns: Input / Preprocessing / Inference / Postprocessing / Presentation
• Filesystem‐based model persistence (no external database)
• Dependency injection at startup (model + encoder loaded once)