How ruslanmv/ai-medical-chatbot works
Main Components
• Environment Setup (“1-Environment”)
– This part defines the local configuration and assets needed to create the models. Think of it as the foundational “preparation layer” for the project.
• Data Preparation (“2-Data”)
– The project compiles and preprocesses the medical datasets — including dialogues, embedded data, and image assets — which will be used to train and validate the models. Include notebooks, configuration files (YAML), and assorted data assets.
• Modeling and Feature Engineering (“3-Modeling”)
– This module covers several notebooks for preprocessing, clustering, feature engineering, and building the model using retrieval augmented generation (RAG) techniques. Also, it contains tools and scripts that manage different aspects of model creation.
• Chatbot Logic and Deployment (“4-Chatbot” & “5-HuggingFace”)
– While the “Chatbot” folder supports code or assets for a chatbot interface, the “HuggingFace” directory is dedicated to deployment. Here you have Dockerfiles, production-ready app scripts, and backup versions, indicating an emphasis on running the chatbot in a live environment.
• Fine-Tuning of Models (“6-FineTunning”)
– This section focuses on fine-tuning pre-trained models (like Medical-Llama3 and Mixtral-7B) with custom datasets to ensure the chatbot handles medical queries effectively.
• Multimodal Capabilities (“7-Multimodal”)
– This module suggests the system is extended to process and analyze medical images as well as text.
• Specialized Interview Module (“8-Interviewer”)
– A distinct module is built for handling medical interviews, again pointing to a different interface and interaction pattern.
• External Integrations & Notebooks
– Additional top-level notebooks (e.g., Chatbot-Medical-Llama3-v2.ipynb, Medical-Llama3-v2.ipynb) provide workflow scripts, demos, and further instructions.
Relationships and Interactions
• Data flows through a pipe:
– Environment → Data Preparation → Modeling (including Feature Engineering and RAG) → Fine-Tuning
• Model Deployment & Interfaces:
– Fine-tuned models are then connected to production interfaces (Chatbot deployed via HuggingFace and the Interviewer module).
– Multimodal module interacts either as an added input service (e.g., image analysis) or a subprocess within the chatbot to provide enhanced diagnostic capabilities.
• External Services:
– Links to external GitHub repositories (i.e., production-ready chatbot versions) can be noted as “external API/Integration points.”
Architectural Patterns and Technologies
• Modular architecture:
– Clearly separated modules (environment, data, modeling, fine-tuning, interfacing) emphasize separation-of-concerns.
• Pipeline Style Workflow:
– The data -> modeling -> fine-tuning -> chatbot flow is central.
• Deployment and Versioning:
– The use of Docker (in the HuggingFace folder) and backup directories suggests a CI/CD practice and containerized deployment.
• Frameworks and Technologies:
– IBM WatsonX and Watson Assistant for backend operations.
– Foundation models using popular architectures (T5, GPT, etc.) as the core of the AI capabilities.
– Use of Jupyter notebooks, Python scripts, and container orchestration (Docker) for development and deployment.
Summarized Steps for the Principal Software Engineer
• Within each module, break down into subcomponents as guided by the file tree (for example, under Modeling, include sections for pre-processing and clustering).
• Integration points with external services like IBM WatsonX, Watson Assistant, and deployment channels like HuggingFace.
• Annotations where necessary to explain technologies and design principles (i.e., microservice or modular pipeline approach).