SPELL-LLMs: A Scalable and Privacy-Compliant NLP Pipeline Using Locally Hosted Large Language Models for Clinical Information Extraction

Read the full article See related articles

Listed in

This article is not in any list yet, why not save it to one of your lists.
Log in to save this article

Abstract

Objective: Electronic health records (EHRs) contain valuable information for clinical research and decision making. However, leveraging these data remains challenging due to data heterogeneity, inconsistent documentation, missing information, and evolving terminology, especially within unstructured clinical notes. We developed a scalable, privacy preserving natural language processing (NLP) workflow to systematically extract structured clinical insights from large volumes of clinical narratives. Materials and Methods: Our platform employs a hybrid approach combining regular expressions (regex) to rapidly identify relevant textual snippets with locally hosted large language models (LLMs) for accurate clinical interpretation. All data processing occurs securely within institutional environments, adhering strictly to data privacy regulations. The modular Python based workflow facilitates adaptation across institutions and is optimized for computational efficiency, supporting high-throughput processing even in resource-limited settings. Results: The pipeline efficiently processed millions of clinical reports (1976 2024) from multiple hospitals. By analyzing targeted snippets rather than entire documents, our approach reduced processing time by 80% compared to traditional full document LLM inference, and by 97% compared to manual physician annotation. Accuracy was rigorously validated using three obstetric tasks: extraction of numerical values (blood loss volumes), dates (estimated delivery dates), and diagnoses (hemolysis, elevated liver enzymes, and low platelets [HELLP] syndrome), achieving 95% agreement with expert annotations. Generalizability was further confirmed by accurately identifying ventricular tachycardia diagnoses in the publicly available MT Samples dataset. Discussion and Conclusions: Our hybrid NLP framework significantly enhances the usability of unstructured EHR data for clinical research, decision support, and large-scale retrospective analyses.

Article activity feed