A Moroccan-Darija medical assistant
A Moroccan-Darija medical assistant — fine-tuned on ~92k cleaned Darija medical Q&A pairs, served as a chat API behind a simple web app.
---
Med·Atlas takes a raw, messy dataset of Moroccan-Darija medical questions and answers, cleans it,
fine-tunes Atlas-Chat-2B (a Gemma-2 based
Darija model) on it, and exposes the result as a chat assistant that answers health questions in
Darija. The whole flow lives in four notebooks — **explore → clean → train → serve** — plus a
static web front-end.
> ⚠️ Med·Atlas is an educational project. It does **not** replace a doctor.
## The pipeline at a glance
| Step | Notebook | Output |
|------|----------|--------|
| 1. Explore | `med_qa_ma_eda.ipynb` | Data-quality scorecard |
| 2. Clean | `clean_dataset.ipynb` | `med_qa_ma_clean.csv` (92,282 rows) |
| 3. Train | `train_atlas_chat_2b.ipynb` | LoRA adapter for Atlas-Chat-2B |
| 4. Serve | `med_atlas_colab.ipynb` | Public chat API (`/chat`) |
| 5. Use | `web/` | Darija chat web app |
## Project structure
```
├── data/
│ ├── med_qa_ma.csv # raw dataset (~101k Q&A pairs)
│ └── processed/
│ ├── med_qa_ma_clean.csv # cleaned dataset (92,282 rows)
│ └── removed_rows.csv # every dropped row + the reason (audit trail)
├── notebooks/
│ ├── med_qa_ma_eda.ipynb # 1. explore & judge the raw data
│ ├── clean_dataset.ipynb # 2. reproducible cleaning pipeline
│ ├── train_atlas_chat_2b.ipynb # 3. QLoRA fine-tune Atlas-Chat-2B
│ └── med_atlas_colab.ipynb # 4. serve the model as a chat API
├── web/ # static chat front-end (HTML / CSS / JS)
│ ├── index.html
│ ├── app.js
│ ├── styles.css
│ └── assets/ # logos
└── docs/assets/ # charts shown in this README
```
## 1 · The data
The raw dataset (`med_qa_ma.csv`) has **100,966 rows** and three columns:
- **Question** — patient question, in Moroccan Darija
- **Answer** — reply, in D …