Text Generation
Transformers
Safetensors
llm-pipeline
medical-ai
llm
report-generation
hallucination-detection
fhir
clinical-nlp
Instructions to use mou11/medical-report-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mou11/medical-report-generator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mou11/medical-report-generator")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mou11/medical-report-generator", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use mou11/medical-report-generator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mou11/medical-report-generator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mou11/medical-report-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mou11/medical-report-generator
- SGLang
How to use mou11/medical-report-generator with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "mou11/medical-report-generator" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mou11/medical-report-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "mou11/medical-report-generator" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mou11/medical-report-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mou11/medical-report-generator with Docker Model Runner:
docker model run hf.co/mou11/medical-report-generator
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,33 +9,29 @@ tags:
|
|
| 9 |
license: mit
|
| 10 |
pipeline_tag: text-generation
|
| 11 |
base_model: mistralai/Mistral-7B-v0.1
|
|
|
|
| 12 |
---
|
| 13 |
# Medical Report Generator
|
| 14 |

|
| 15 |

|
| 16 |

|
| 17 |

|
| 18 |
-
|
| 19 |
## Live Demo
|
| 20 |
π [Try it on Hugging Face Spaces](https://huggingface.co/spaces/mou11/medical-report-generator)
|
| 21 |
-
|
| 22 |
## Overview
|
| 23 |
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.
|
| 24 |
-
|
| 25 |
## Results
|
| 26 |
| Report Type | BERTScore F1 | Safety Score |
|
| 27 |
|-------------|-------------|--------------|
|
| 28 |
| Radiology | 0.8628 | 0.625 |
|
| 29 |
| Discharge Summary | 0.9045 | 1.0 |
|
| 30 |
| Lab Report | 0.8129 | 0.375 |
|
| 31 |
-
|
| 32 |
## Hallucination Detection
|
| 33 |
| Report Type | Total Claims | Hallucination Rate | Safety Score |
|
| 34 |
|-------------|-------------|-------------------|--------------|
|
| 35 |
| Radiology | 4 | 0.375 | 0.625 |
|
| 36 |
| Discharge | 1 | 0.0 | 1.0 |
|
| 37 |
| Lab | 4 | 0.625 | 0.375 |
|
| 38 |
-
|
| 39 |
## Features
|
| 40 |
- Generates 3 types of clinical reports: Radiology, Discharge Summary, Lab Report
|
| 41 |
- Hallucination detection using NLI (cross-encoder/nli-deberta-v3-base)
|
|
@@ -43,10 +39,8 @@ An end-to-end clinical report generation pipeline that generates structured medi
|
|
| 43 |
- BERTScore and ROUGE evaluation metrics
|
| 44 |
- Professional PDF export with quality assessment table
|
| 45 |
- Gradio web interface
|
| 46 |
-
|
| 47 |
## Architecture
|
| 48 |
Patient Data β Report Generation (LLaMA 3.3 70B via Groq) β Hallucination Detection (DeBERTa NLI) β Evaluation (BERTScore + ROUGE) β FHIR R4 JSON β PDF Export
|
| 49 |
-
|
| 50 |
## Tech Stack
|
| 51 |
| Component | Tool |
|
| 52 |
|-----------|------|
|
|
@@ -57,16 +51,13 @@ Patient Data β Report Generation (LLaMA 3.3 70B via Groq) β Hallucination De
|
|
| 57 |
| PDF Export | ReportLab |
|
| 58 |
| UI | Gradio |
|
| 59 |
| Platform | Google Colab (T4 GPU) |
|
| 60 |
-
|
| 61 |
## How to Run
|
| 62 |
1. Get a free Groq API key at [console.groq.com](https://console.groq.com)
|
| 63 |
2. Open `app.py` in Google Colab
|
| 64 |
3. Add your key to Colab Secrets as `GROQ_KEY_1`
|
| 65 |
4. Run all cells in order
|
| 66 |
-
|
| 67 |
## Medical Disclaimer
|
| 68 |
This system is for educational and research purposes only. It does not provide medical advice. Always consult a qualified healthcare professional for medical decisions.
|
| 69 |
-
|
| 70 |
## Project Status
|
| 71 |
β
Report generation pipeline complete
|
| 72 |
β
Hallucination detection implemented
|
|
|
|
| 9 |
license: mit
|
| 10 |
pipeline_tag: text-generation
|
| 11 |
base_model: mistralai/Mistral-7B-v0.1
|
| 12 |
+
library_name: transformers
|
| 13 |
---
|
| 14 |
# Medical Report Generator
|
| 15 |

|
| 16 |

|
| 17 |

|
| 18 |

|
|
|
|
| 19 |
## Live Demo
|
| 20 |
π [Try it on Hugging Face Spaces](https://huggingface.co/spaces/mou11/medical-report-generator)
|
|
|
|
| 21 |
## Overview
|
| 22 |
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.
|
|
|
|
| 23 |
## Results
|
| 24 |
| Report Type | BERTScore F1 | Safety Score |
|
| 25 |
|-------------|-------------|--------------|
|
| 26 |
| Radiology | 0.8628 | 0.625 |
|
| 27 |
| Discharge Summary | 0.9045 | 1.0 |
|
| 28 |
| Lab Report | 0.8129 | 0.375 |
|
|
|
|
| 29 |
## Hallucination Detection
|
| 30 |
| Report Type | Total Claims | Hallucination Rate | Safety Score |
|
| 31 |
|-------------|-------------|-------------------|--------------|
|
| 32 |
| Radiology | 4 | 0.375 | 0.625 |
|
| 33 |
| Discharge | 1 | 0.0 | 1.0 |
|
| 34 |
| Lab | 4 | 0.625 | 0.375 |
|
|
|
|
| 35 |
## Features
|
| 36 |
- Generates 3 types of clinical reports: Radiology, Discharge Summary, Lab Report
|
| 37 |
- Hallucination detection using NLI (cross-encoder/nli-deberta-v3-base)
|
|
|
|
| 39 |
- BERTScore and ROUGE evaluation metrics
|
| 40 |
- Professional PDF export with quality assessment table
|
| 41 |
- Gradio web interface
|
|
|
|
| 42 |
## Architecture
|
| 43 |
Patient Data β Report Generation (LLaMA 3.3 70B via Groq) β Hallucination Detection (DeBERTa NLI) β Evaluation (BERTScore + ROUGE) β FHIR R4 JSON β PDF Export
|
|
|
|
| 44 |
## Tech Stack
|
| 45 |
| Component | Tool |
|
| 46 |
|-----------|------|
|
|
|
|
| 51 |
| PDF Export | ReportLab |
|
| 52 |
| UI | Gradio |
|
| 53 |
| Platform | Google Colab (T4 GPU) |
|
|
|
|
| 54 |
## How to Run
|
| 55 |
1. Get a free Groq API key at [console.groq.com](https://console.groq.com)
|
| 56 |
2. Open `app.py` in Google Colab
|
| 57 |
3. Add your key to Colab Secrets as `GROQ_KEY_1`
|
| 58 |
4. Run all cells in order
|
|
|
|
| 59 |
## Medical Disclaimer
|
| 60 |
This system is for educational and research purposes only. It does not provide medical advice. Always consult a qualified healthcare professional for medical decisions.
|
|
|
|
| 61 |
## Project Status
|
| 62 |
β
Report generation pipeline complete
|
| 63 |
β
Hallucination detection implemented
|