How priyanshidongre/ai-healthcare-chatbot works
Project type and purpose
• This is a lightweight, single-module AI-powered healthcare chatbot implemented in Python (app.py), intended to run as a web service (likely with Flask or FastAPI).
• It serves as a text-based interface for users to ask general health questions, leveraging an NLP pipeline.
File structure
• Top-level files only:
• app.py – the main web server and request-handling logic
• requirements.txt – Python dependencies (e.g., Flask/FastAPI, transformers, spaCy, etc.)
• README.md – project overview and roadmap
• No dedicated frontend folder—UI likely rendered via simple HTML templates or an API to a separate client.
• No database folder/config—persistence is not yet implemented.
README for additional insights
• Current scope: conversational chatbot with basic medical guidance
• Future features hint at: user-history storage, third-party appointment/medicine APIs, multilingual/voice support, video-chat service.
Core components
a. User Interface (Chat Client)
• Web browser or mobile app sending/receiving JSON or rendered HTML.
b. Web Server (app.py)
• HTTP endpoints for chat messages.
• Input validation, session management.
c. NLP Engine
• Local models or calls to external ML/AI services (e.g., Hugging Face, OpenAI API).
• Tokenization → Intent classification → Response generation.
d. Data Store (future)
• Conversation logs, user profiles, medical history.
• Could be a relational DB (PostgreSQL) or NoSQL (MongoDB).
e. External Services (future)
• Disease prediction API
• Appointment booking API
• Medicine suggestion API
• Translation/voice-processing service
• Video-chat platform
Relationships and interactions
• User → HTTP(S) → Web Server
• Web Server → NLP Engine (local or external)
• Web Server ↔ Data Store (for logging & history)
• Web Server → External Healthcare APIs (for booking, suggestions)
• Future: Web Server ↔ Voice/Translation Service; Web Server ↔ Video Chat Service
Architectural patterns/principles
• Layered architecture: Presentation (UI) → Application logic (Flask) → NLP/Service integrations → Data
• Separation of concerns: keep chat logic, NLP pipeline, and external/service integrations in distinct modules.
• Plan for microservices as features grow (e.g., a standalone “Booking Service” or “VideoChat Service”).
Then Backend ↔ Data Store, Backend → Appointment API, etc.