From Text to Tables: A Local Privacy Preserving Large Language Model for Structured Information Retrieval from Medical Documents
Preprint
Abstract
Background and Aims: Most clinical information is encoded as text, but extracting quantitative information from text is challenging. Large Language Models (LLMs) have emerged as powerful tools for natural language processing and can parse clinical text. However, many LLMs including ChatGPT reside in remote data centers, which disqualifies them from processing personal healthcare data. We present an open-source pipeline using the local LLM “Llama 2” for extracting quantitative information from clinical text and evaluate its use to detect clinical features of decompensated liver cirrhosis. Methods: We tasked the LLM to identify five key clinical features of decompensated liver cirrhosis in a zero- and one-shot way without any model training. Our specific objective was to identify abdominal pain, shortness of breath, confusion, liver cirrhosis, and ascites from 500 patient medical histories from the MIMIC IV dataset. We compared LLMs with three different sizes and a variety of pre-specified prompt engineering approaches. Model predictions were compared against the ground truth provided by the consent of three blinded medical experts. Results: Our open-source pipeline yielded in highly accurate extraction of quantitative features from medical free text. Clinical features which were explicitly mentioned in the source text, such as liver cirrhosis and ascites, were detected with a sensitivity of 100% and 95% and a specificity of 96% and 95%, respectively from the 70 billion parameter model. Other clinical features, which are often paraphrased in a variety of ways, such as the presence of confusion, were detected only with a sensitivity of 76% and a specificity of 94%. Abdominal pain was detected with a sensitivity of 84% and a specificity of 97%. Shortness of breath was detected with a sensitivity of 87% and a specificity of 96%. The larger version of Llama 2 with 70b parameters outperformed the smaller version with 7b parameters in all tasks. Prompt engineering improved zero-shot performance, particularly for smaller model sizes. Conclusion: Our study successfully demonstrates the capability of using locally deployed LLMs to extract clinical information from free text. The hardware requirements are so low that not only on-premise, but also point-of-care deployment of LLMs are possible. Lay summary: We leveraged the large language model Llama 2 to extract five key features of decompensated liver cirrhosis from medical history texts, simplifying the analysis of complex text-based healthcare data.Keywords
This publication has 28 references indexed in Scilit:
- Multimodal integration of radiology, pathology and genomics for prediction of response to PD-(L)1 blockade in patients with non-small cell lung cancerNature Cancer, 2022
- Risk of further decompensation/mortality in patients with cirrhosis and ascites as the first single decompensation eventJHEP Reports, 2022
- Natural language processing in medicine: A reviewTrends in Anaesthesia and Critical Care, 2021
- Use of deep learning to develop continuous-risk models for adverse event prediction from electronic health recordsNature Protocols, 2021
- Clinical concept extraction using transformersJournal of the American Medical Informatics Association, 2020
- Managing Unstructured Big Data in Healthcare SystemHealthcare Informatics Research, 2019
- Clinical information extraction applications: A literature reviewJournal of Biomedical Informatics, 2018
- Is omission of free text records a possible source of data loss and bias in Clinical Practice Research Datalink studies? A case–control studyBMJ Open, 2016
- Hospital Readmissions Among Patients With Decompensated CirrhosisAmerican Journal of Gastroenterology, 2012
- Overcoming barriers to NLP for clinical text: the role of shared tasks and the need for additional creative solutionsJournal of the American Medical Informatics Association, 2011