How huuthanh2k4/wed_chuan_doan_benh works
Project type and purpose
• This is a Python-based, multi-page web application (likely Streamlit or a similar framework) that loads pre-trained ML models (.sav files) from disk and exposes prediction functionality via different UI pages (admin, history).
File structure
• Top-level files:
• app.py – the main entry point that launches the web server and routes to page modules
• requirements.txt – lists Python dependencies (e.g., streamlit or Flask, scikit-learn)
• pages/ directory:
• admin.py – administrative interface (model management or user controls)
• lich_su.py – “history” page (logs or past predictions)
• Model/ directory:
• CDTC_knn.sav, ML_heartattack.sav, NutriAI.sav, NutriAI1.sav – serialized ML models for different prediction tasks
README
• Minimal content (“Cập nhập” = “Update” in Vietnamese), no embedded architecture details. Rely on file structure to infer architecture.
Main components and their interactions
a. Client (Web Browser)
b. Web Application Server (app.py + pages/*.py)
c. Model Storage (Model/*.sav files on disk)
d. Dependencies / Libraries (scikit-learn, Streamlit/Flask, pandas, etc.)
Relationships:
• Client sends HTTP requests (UI interactions) to the Web App Server.
• Server routes requests to the appropriate page module (admin or history).
• Page module code loads the required ML model from disk, processes user input, and returns prediction results.
• Server sends back rendered HTML (or Streamlit UI) to the Client.
Architectural patterns and design principles
• Monolithic, single-process server that combines routing and model-serving
• Separation of concerns: routing logic in app.py, UI per page in pages/, ML logic decoupled in separate model files
• Lazy loading of models: load only the needed .sav file when a page is accessed (improves memory usage)