mou11's picture
Update README.md
f8f374a verified
---
tags:
- medical-ai
- llm
- report-generation
- hallucination-detection
- fhir
- clinical-nlp
license: mit
pipeline_tag: text-generation
base_model: mistralai/Mistral-7B-v0.1
library_name: transformers
---
# Medical Report Generator
![Python](https://img.shields.io/badge/Python-3.10-blue)
![LLaMA](https://img.shields.io/badge/LLaMA-3.3%2070B-green)
![FHIR](https://img.shields.io/badge/FHIR-R4%20Compliant-red)
![HuggingFace](https://img.shields.io/badge/HuggingFace-Spaces-yellow)
## Live Demo
πŸ‘‰ [Try it on Hugging Face Spaces](https://huggingface.co/spaces/mou11/medical-report-generator)
## Overview
An end-to-end clinical report generation pipeline that generates structured medical reports from patient data, detects hallucinations using NLI, outputs FHIR R4 compliant JSON, and exports professional PDF reports.
## Results
| Report Type | BERTScore F1 | Safety Score |
|-------------|-------------|--------------|
| Radiology | 0.8628 | 0.625 |
| Discharge Summary | 0.9045 | 1.0 |
| Lab Report | 0.8129 | 0.375 |
## Hallucination Detection
| Report Type | Total Claims | Hallucination Rate | Safety Score |
|-------------|-------------|-------------------|--------------|
| Radiology | 4 | 0.375 | 0.625 |
| Discharge | 1 | 0.0 | 1.0 |
| Lab | 4 | 0.625 | 0.375 |
## Features
- Generates 3 types of clinical reports: Radiology, Discharge Summary, Lab Report
- Hallucination detection using NLI (cross-encoder/nli-deberta-v3-base)
- FHIR R4 compliant JSON output (HL7 healthcare standard)
- BERTScore and ROUGE evaluation metrics
- Professional PDF export with quality assessment table
- Gradio web interface
## Architecture
Patient Data β†’ Report Generation (LLaMA 3.3 70B via Groq) β†’ Hallucination Detection (DeBERTa NLI) β†’ Evaluation (BERTScore + ROUGE) β†’ FHIR R4 JSON β†’ PDF Export
## Tech Stack
| Component | Tool |
|-----------|------|
| LLM | Groq β€” LLaMA 3.3 70B |
| Hallucination Detection | cross-encoder/nli-deberta-v3-base |
| Evaluation | BERTScore + ROUGE |
| FHIR Output | HL7 R4 JSON |
| PDF Export | ReportLab |
| UI | Gradio |
| Platform | Google Colab (T4 GPU) |
## How to Run
1. Get a free Groq API key at [console.groq.com](https://console.groq.com)
2. Open `app.py` in Google Colab
3. Add your key to Colab Secrets as `GROQ_KEY_1`
4. Run all cells in order
## Medical Disclaimer
This system is for educational and research purposes only. It does not provide medical advice. Always consult a qualified healthcare professional for medical decisions.
## Project Status
βœ… Report generation pipeline complete
βœ… Hallucination detection implemented
βœ… FHIR R4 compliant output
βœ… PDF export working
βœ… Gradio demo deployed on Hugging Face Spaces