Cargando…

A Large Language Model-Based Generative Natural Language Processing Framework Finetuned on Clinical Notes Accurately Extracts Headache Frequency from Electronic Health Records

BACKGROUND: Headache frequency, defined as the number of days with any headache in a month (or four weeks), remains a key parameter in the evaluation of treatment response to migraine preventive medications. However, due to the variations and inconsistencies in documentation by clinicians, significa...

Descripción completa

Detalles Bibliográficos
Autores principales: Chiang, Chia-Chun, Luo, Man, Dumkrieger, Gina, Trivedi, Shubham, Chen, Yi-Chieh, Chao, Chieh-Ju, Schwedt, Todd J., Sarker, Abeed, Banerjee, Imon
Formato: Online Artículo Texto
Lenguaje:English
Publicado: Cold Spring Harbor Laboratory 2023
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10593021/
https://www.ncbi.nlm.nih.gov/pubmed/37873417
http://dx.doi.org/10.1101/2023.10.02.23296403
_version_ 1785124381304815616
author Chiang, Chia-Chun
Luo, Man
Dumkrieger, Gina
Trivedi, Shubham
Chen, Yi-Chieh
Chao, Chieh-Ju
Schwedt, Todd J.
Sarker, Abeed
Banerjee, Imon
author_facet Chiang, Chia-Chun
Luo, Man
Dumkrieger, Gina
Trivedi, Shubham
Chen, Yi-Chieh
Chao, Chieh-Ju
Schwedt, Todd J.
Sarker, Abeed
Banerjee, Imon
author_sort Chiang, Chia-Chun
collection PubMed
description BACKGROUND: Headache frequency, defined as the number of days with any headache in a month (or four weeks), remains a key parameter in the evaluation of treatment response to migraine preventive medications. However, due to the variations and inconsistencies in documentation by clinicians, significant challenges exist to accurately extract headache frequency from the electronic health record (EHR) by traditional natural language processing (NLP) algorithms. METHODS: This was a retrospective cross-sectional study with human subjects identified from three tertiary headache referral centers- Mayo Clinic Arizona, Florida, and Rochester. All neurology consultation notes written by more than 10 headache specialists between 2012 to 2022 were extracted and 1915 notes were used for model fine-tuning (90%) and testing (10%). We employed four different NLP frameworks: (1) ClinicalBERT (Bidirectional Encoder Representations from Transformers) regression model (2) Generative Pre-Trained Transformer-2 (GPT-2) Question Answering (QA) Model zero-shot (3) GPT-2 QA model few-shot training fine-tuned on Mayo Clinic notes; and (4) GPT-2 generative model few-shot training fine-tuned on Mayo Clinic notes to generate the answer by considering the context of included text. RESULTS: The GPT-2 generative model was the best-performing model with an accuracy of 0.92[0.91 – 0.93] and R(2) score of 0.89[0.87, 0.9], and all GPT2-based models outperformed the ClinicalBERT model in terms of the exact matching accuracy. Although the ClinicalBERT regression model had the lowest accuracy 0.27[0.26 – 0.28], it demonstrated a high R(2) score 0.88[0.85, 0.89], suggesting the ClinicalBERT model can reasonably predict the headache frequency within a range of ≤ ± 3 days, and the R(2) score was higher than the GPT-2 QA zero-shot model or GPT-2 QA model few-shot training fine-tuned model. CONCLUSION: We developed a robust model based on a state-of-the-art large language model (LLM)- a GPT-2 generative model that can extract headache frequency from EHR free-text clinical notes with high accuracy and R(2) score. It overcame several challenges related to different ways clinicians document headache frequency that were not easily achieved by traditional NLP models. We also showed that GPT2-based frameworks outperformed ClinicalBERT in terms of accuracy in extracting headache frequency from clinical notes. To facilitate research in the field, we released the GPT-2 generative model and inference code with open-source license of community use in GitHub.
format Online
Article
Text
id pubmed-10593021
institution National Center for Biotechnology Information
language English
publishDate 2023
publisher Cold Spring Harbor Laboratory
record_format MEDLINE/PubMed
spelling pubmed-105930212023-10-24 A Large Language Model-Based Generative Natural Language Processing Framework Finetuned on Clinical Notes Accurately Extracts Headache Frequency from Electronic Health Records Chiang, Chia-Chun Luo, Man Dumkrieger, Gina Trivedi, Shubham Chen, Yi-Chieh Chao, Chieh-Ju Schwedt, Todd J. Sarker, Abeed Banerjee, Imon medRxiv Article BACKGROUND: Headache frequency, defined as the number of days with any headache in a month (or four weeks), remains a key parameter in the evaluation of treatment response to migraine preventive medications. However, due to the variations and inconsistencies in documentation by clinicians, significant challenges exist to accurately extract headache frequency from the electronic health record (EHR) by traditional natural language processing (NLP) algorithms. METHODS: This was a retrospective cross-sectional study with human subjects identified from three tertiary headache referral centers- Mayo Clinic Arizona, Florida, and Rochester. All neurology consultation notes written by more than 10 headache specialists between 2012 to 2022 were extracted and 1915 notes were used for model fine-tuning (90%) and testing (10%). We employed four different NLP frameworks: (1) ClinicalBERT (Bidirectional Encoder Representations from Transformers) regression model (2) Generative Pre-Trained Transformer-2 (GPT-2) Question Answering (QA) Model zero-shot (3) GPT-2 QA model few-shot training fine-tuned on Mayo Clinic notes; and (4) GPT-2 generative model few-shot training fine-tuned on Mayo Clinic notes to generate the answer by considering the context of included text. RESULTS: The GPT-2 generative model was the best-performing model with an accuracy of 0.92[0.91 – 0.93] and R(2) score of 0.89[0.87, 0.9], and all GPT2-based models outperformed the ClinicalBERT model in terms of the exact matching accuracy. Although the ClinicalBERT regression model had the lowest accuracy 0.27[0.26 – 0.28], it demonstrated a high R(2) score 0.88[0.85, 0.89], suggesting the ClinicalBERT model can reasonably predict the headache frequency within a range of ≤ ± 3 days, and the R(2) score was higher than the GPT-2 QA zero-shot model or GPT-2 QA model few-shot training fine-tuned model. CONCLUSION: We developed a robust model based on a state-of-the-art large language model (LLM)- a GPT-2 generative model that can extract headache frequency from EHR free-text clinical notes with high accuracy and R(2) score. It overcame several challenges related to different ways clinicians document headache frequency that were not easily achieved by traditional NLP models. We also showed that GPT2-based frameworks outperformed ClinicalBERT in terms of accuracy in extracting headache frequency from clinical notes. To facilitate research in the field, we released the GPT-2 generative model and inference code with open-source license of community use in GitHub. Cold Spring Harbor Laboratory 2023-10-03 /pmc/articles/PMC10593021/ /pubmed/37873417 http://dx.doi.org/10.1101/2023.10.02.23296403 Text en https://creativecommons.org/licenses/by-nc-nd/4.0/This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License (https://creativecommons.org/licenses/by-nc-nd/4.0/) , which allows reusers to copy and distribute the material in any medium or format in unadapted form only, for noncommercial purposes only, and only so long as attribution is given to the creator.
spellingShingle Article
Chiang, Chia-Chun
Luo, Man
Dumkrieger, Gina
Trivedi, Shubham
Chen, Yi-Chieh
Chao, Chieh-Ju
Schwedt, Todd J.
Sarker, Abeed
Banerjee, Imon
A Large Language Model-Based Generative Natural Language Processing Framework Finetuned on Clinical Notes Accurately Extracts Headache Frequency from Electronic Health Records
title A Large Language Model-Based Generative Natural Language Processing Framework Finetuned on Clinical Notes Accurately Extracts Headache Frequency from Electronic Health Records
title_full A Large Language Model-Based Generative Natural Language Processing Framework Finetuned on Clinical Notes Accurately Extracts Headache Frequency from Electronic Health Records
title_fullStr A Large Language Model-Based Generative Natural Language Processing Framework Finetuned on Clinical Notes Accurately Extracts Headache Frequency from Electronic Health Records
title_full_unstemmed A Large Language Model-Based Generative Natural Language Processing Framework Finetuned on Clinical Notes Accurately Extracts Headache Frequency from Electronic Health Records
title_short A Large Language Model-Based Generative Natural Language Processing Framework Finetuned on Clinical Notes Accurately Extracts Headache Frequency from Electronic Health Records
title_sort large language model-based generative natural language processing framework finetuned on clinical notes accurately extracts headache frequency from electronic health records
topic Article
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10593021/
https://www.ncbi.nlm.nih.gov/pubmed/37873417
http://dx.doi.org/10.1101/2023.10.02.23296403
work_keys_str_mv AT chiangchiachun alargelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT luoman alargelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT dumkriegergina alargelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT trivedishubham alargelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT chenyichieh alargelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT chaochiehju alargelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT schwedttoddj alargelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT sarkerabeed alargelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT banerjeeimon alargelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT chiangchiachun largelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT luoman largelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT dumkriegergina largelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT trivedishubham largelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT chenyichieh largelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT chaochiehju largelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT schwedttoddj largelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT sarkerabeed largelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords
AT banerjeeimon largelanguagemodelbasedgenerativenaturallanguageprocessingframeworkfinetunedonclinicalnotesaccuratelyextractsheadachefrequencyfromelectronichealthrecords