A domain-specific generative chatbot designed to answer healthcare-related questions using a fine-tuned GPT-2 model. Built with a FastAPI backend and React + Tailwind frontend.
This project aims to improve access to reliable healthcare information by offering an AI-powered chatbot capable of answering medical queries with contextual relevance. The model is trained on the llama3_medquad_instruct_dataset from Hugging Face, leveraging GPT-2 for high-quality text generation.
- Name:
llama3_medquad_instruct_dataset - Source: Hugging Face Datasets
- Description: Instruction-tuned healthcare Q&A pairs covering diseases, symptoms, treatments, and medications.
- Model: GPT-2 (124M parameters)
- Training Framework: Hugging Face Transformers (PyTorch)
- Accurate and fluent healthcare-related responses
- Zero-shot filtering for irrelevant queries
- FastAPI backend serving the GPT-2 model
- Modern React/Tailwind chatbot UI with chat history and reset
- Deployed frontend (Vercel) and backend (local or cloud-ready)
| Metric | Score |
|---|---|
| Perplexity | ~4.2 |
| BLEU | 0.61 |
| F1 Score | 0.77 |
Q: What is the treatment for type 2 diabetes?
A: Type 2 diabetes is typically managed with lifestyle changes, including diet and exercise, along with oral medications like metformin...
Q: What is the capital of France?
A: Sorry, I can only help with healthcare-related questions.
cd backend
pip install -r requirements.txt
uvicorn main:app --reloadcd frontend
npm install
npm run dev├── backend/
│ └── main.py
│ └── model/
├── data/
│ └── llama3_medquad_instruct_dataset.json
├── evaluation/
│ └── metrics.py
UI repository: https://github.com/Kalisa21/botUI.git
This project is for educational and research purposes only. It is not intended for clinical use.
- willy kalisa
For questions or collaboration: [w.kalisa@alustudent.com
