Skip to content
Ali El Adnani
01Work02About03Contactaliadnani056@gmail.com
Back to work

Medical Chatbot

A medical question answering assistant. BERT handles retrieval and understanding, Llama 2 rewrites the result into an answer.

Year
2025
Type
Personal project
Discipline
Natural language processing

Overview

The chatbot answers medical questions using two models with different jobs. A BERT model trained on medical data does the understanding and retrieval, finding the relevant material for a question.

Llama 2 then reformulates that material into a readable answer. Splitting the work this way keeps the answer anchored to retrieved content rather than generated from scratch.

I built this to learn how the two model types behave in practice, and where each one is the wrong tool for the job.

What I built

  • Prepared the medical dataset and fine tuned BERT on it
  • Built the retrieval step and the scoring around it
  • Wired Llama 2 in to reformulate retrieved passages
  • Evaluated answers against a held out set of questions

Stack

  • Python
  • BERT
  • Llama 2
  • Transformers
  • PyTorch

Next project

Smart Library System

2024