MediChat chatbot, from raw data to deployment

The chatbot inside a team health-consultation app. I built it from the data up: filtering, choosing a model, training it and designing how it talks.

Work
Senior capstone, Manhattan University, 2025
My part
The chatbot process, end to end
Stack
Python, PyTorch, Transformers, FastAPI

MediChat is a health-consultation app built by a team. My share was the chatbot: everything from raw medical text to a working chat system.

The team built the rest, including the app and frontend. I handed the frontend team four iterations of the chatbot as it improved, and the code for my process lives in its own repository. Teammates are credited on the repository and below.

The pipeline

  1. Data and filtering

    I assembled medical text from public sources and filtered it to muscle-related conditions, then fixed several bugs in the original filtering scripts.

  2. Choose a model

    I compared four models locally and kept RoBERTa for question answering.

  3. Fine-tune in stages

    The model started from deepset/roberta-base-squad2. It was then tuned on disease and symptom question answering, then on PubMedQA yes/no questions, then on a custom question-answering set.

  4. Train on the cluster

    The final training ran on the Artemis node of the Kakos cluster at Manhattan University.

  5. Design the chatbot

    I turned the model into a chat system, over four stages (below).

A small, honest test

To compare models I wrote a selection test on 100 muscle-filtered entries, run in both directions, for 200 passes. Given a disease, the model names three symptoms, and it scores a hit when two match. Given symptoms, it names the disease, and it scores a hit when the disease matches.

31

hits for RoBERTa on a local machine

56

hits after cluster training

This is a sanity check for choosing a direction, not a benchmark. It is small and specific, and it does not show clinical accuracy.

How the chatbot evolved

  1. Gradio prototype and FastAPI baseline

    A first working loop, then an API the frontend team could call.

  2. Polishing experiments

    I tried Zephyr-7B and GPT-3.5 to polish the answers. Zephyr was too light and not promising enough, and I tried GPT-3.5 as the alternative.

  3. NLTK symptom matching

    A command-line version that matches symptoms directly. It showed me what the local knowledge could do alone.

  4. Final hybrid on Mistral-7B-Instruct

    The local guide began as a router and became a knowledge base that acts as a barrier against wrongly inferred answers. Mistral writes the conversation around it.

Limits

MediChat is a student project and not a medical device. It does not diagnose, and nobody should use it in place of a clinician.

Code and credits

Built with teammates, who are credited in the repository. Data from public sources including the Disease-Symptom Description Dataset on Kaggle (Itachi 9604, 2022), PubMed and DrugBank.