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
- TranslateNLLB-200 normalises multilingual input into a single language.
- ChunkOverlapping-window chunking keeps context across section and page boundaries.
- ExtractMedGemma-4B, fine-tuned with QLoRA in 4-bit, pulls diagnoses, medications, procedures and dates into structured JSON.
- 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.