All projects

Project 03 · Healthcare NLP · 2025

Medical Document AI

An AI pipeline that turns messy, multilingual clinical documents into clean, structured data for medical-tourism pre-evaluation.

Top-down illustration of a clinic desk: a doctor at a laptop with a stack of medical documents, a stethoscope and a clipboard

Overview

International patients send their records in many languages and formats — scans, discharge letters, lab reports. Before a clinician can evaluate a case, someone has to read all of it.

This pipeline translates the documents, extracts the clinical facts into structured JSON with a fine-tuned MedGemma-4B, and assembles them into one chronological timeline a clinician can review at a glance.

How it works

  1. TranslateNLLB-200 normalises multilingual input into a single language.
  2. ChunkOverlapping-window chunking keeps context across section and page boundaries.
  3. ExtractMedGemma-4B, fine-tuned with QLoRA in 4-bit, pulls diagnoses, medications, procedures and dates into structured JSON.
  4. AssembleA deterministic step orders every clinical event into a timeline for pre-evaluation review.

Output shape

{
  "diagnoses":   [ … ],
  "medications": [ … ],
  "procedures":  [ … ],
  "dates":       [ … ],
  "timeline":    [ … ]
}

What’s in the source code

The public repository is a technical write-up of the architecture and integration approach; code and data are not included.

  • README.mdPipeline design, model choices and how the stages fit together

Built with Python, PyTorch, Hugging Face Transformers and PEFT.