hmpaverd/LLM-clinical-extraction

Codebase for extracting structured tabular data from unstructured clinical free-text using open-source Large Language Models with constrained decoding.

0

stars

3

commits

Python

primary language

Jun 4, 2026

updated

README

LLM-clinical-extraction

Codebase for extracting structured tabular data from unstructured clinical free-text using open-source Large Language Models with constrained decoding. This pipeline was specifically developed to extract discrete clinical variables for a dataset of liver transplant patients across three clinical report modalities: radiology reports, pathology reports, and liver transplant assessment reports.

Repository Features

  • Constrained Decoding Options: Scripts implementing two different constrained decoding methods (Guidance, Ollama) to strictly enforce output formatting, compared to unconstrained prompting.

  • Model Flexibility: Choice of implementation of four different open-source models (Llama 3.1 8B, Llama 3.3 70B, OpenBioLLM 70B, and DeepSeek R1 8B).

  • Calibration: Testing scripts to benchmark and evaluate the LLMs' extraction accuracy against manually annotated calibration datasets.

  • Full-Scale Extraction: A combined, end-to-end script designed to execute the extraction pipeline across the full clinical dataset.

Publication

Paverd et al. LLM-based reconstruction of longitudinal clinical trajectories in chronic liver disease (2026) https://www.medrxiv.org/content/10.64898/2026.02.10.26345124v1

Contributors

hmpaverd

3 commits

hmpaverd/LLM-clinical-extraction

Codebase for extracting structured tabular data from unstructured clinical free-text using open-source Large Language Models with constrained decoding.

0

stars

3

commits

Python

primary language

Jun 4, 2026

updated

README

LLM-clinical-extraction

Codebase for extracting structured tabular data from unstructured clinical free-text using open-source Large Language Models with constrained decoding. This pipeline was specifically developed to extract discrete clinical variables for a dataset of liver transplant patients across three clinical report modalities: radiology reports, pathology reports, and liver transplant assessment reports.

Repository Features

  • Constrained Decoding Options: Scripts implementing two different constrained decoding methods (Guidance, Ollama) to strictly enforce output formatting, compared to unconstrained prompting.

  • Model Flexibility: Choice of implementation of four different open-source models (Llama 3.1 8B, Llama 3.3 70B, OpenBioLLM 70B, and DeepSeek R1 8B).

  • Calibration: Testing scripts to benchmark and evaluate the LLMs' extraction accuracy against manually annotated calibration datasets.

  • Full-Scale Extraction: A combined, end-to-end script designed to execute the extraction pipeline across the full clinical dataset.

Publication

Paverd et al. LLM-based reconstruction of longitudinal clinical trajectories in chronic liver disease (2026) https://www.medrxiv.org/content/10.64898/2026.02.10.26345124v1

Contributors

hmpaverd

3 commits

Languages

Python

98.7%

Shell

1.3%