The DOI matches its Crossref record; 1 of the 1 references it cites were found in a registry or an index.
A large language model–based generative natural language processing framework fine‐tuned on clinical notes accurately extracts headache frequency from electronic health records
Open accessAbstract
Objective: To develop a natural language processing (NLP) algorithm that can accurately extract headache frequency from free‐text clinical notes. Background: Headache frequency, defined as the number of days with any headache in a month (or 4 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 NLP algorithms. Methods: This was a retrospective cross‐sectional study with patients identified from two tertiary headache referral centers, Mayo Clinic Arizona and Mayo Clinic Rochester. All neurology consultation notes written by 15 specialized clinicians (11 headache specialists and 4 nurse practitioners) between 2012 and 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 clinical notes, and (4) GPT‐2 generative model few‐shot training fine‐tuned on clinical notes to generate the answer by considering the context of included text. Results: The mean (standard deviation) headache frequency of our training and testing datasets were 13.4 (10.9) and 14.4 (11.2), respectively. The GPT‐2 generative model was the best‐performing model with an accuracy of 0.92 (0.91, 0.93, 95% confidence interval [CI]) and R 2 score of 0.89 (0.87, 0.90, 95% CI), and all GPT‐2–based models outperformed the ClinicalBERT model in terms of exact matching accuracy. Although the ClinicalBERT regression model had the lowest accuracy of 0.27 (0.26, 0.28), it demonstrated a high R 2 score of 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 information extraction model based on a state‐of‐the‐art large language model, 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 GPT‐2–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. Additional fine‐tuning of the algorithm might be required when applied to different health‐care systems for various clinical use cases.
Overview
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
The ability to identify linguistically complex constructs at scale has implications for mixed-methods researchers, in that measures that were previously unquantifiable may be quantified.
“The ability to identify linguistically complex constructs at scale also has implications for mixed-methods researchers, in that measures that were previously unquantifiable may be quantified.39–42”
From Assessment of a Zero-Shot Large Language Model in Measuring Documented Goals-of-Care Discussions (2026) · cites this paper as [40]
The Introduction (page unavailable) says varied wording makes large-scale extraction of headache frequency difficult, and the Results report that the model extracted it accurately. This supports quantifying information from complex clinical text at scale, but not the claim that the measure was previously unquantifiable: the Methods describe readers manually extracting headache frequency from notes. (LLM, conf=0.84)
Experimental — accuracy not yet measured
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Language Models are Few-Shot Learners
Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. (2020) · arXiv · doi:10.48550/arxiv.2005.14165 · Cited by 23,372
Flagged first, then by citations
Research works printed but not linked: 19
- 10.1111/head.12482 · DOI
- 10.1186/s10194-022-01490-0 · DOI
- Guo Y, 2023, Generalizable natural language processing framework for migraine reporting from social media, AMIA Jt Summits Transl Sci Proc, 2023, 261
- 10.1186/s10194-022-01493-x · DOI
- 10.1038/sdata.2016.35 · DOI · Paper page
- AlsentzerE MurphyJR BoagW et al.Publicly available clinical BERT embeddings.ArXiv2019. doi:10.48550/arxiv.1904.03323 · DOI
- HuangK AltosaarJ RanganathR.ClinicalBERT: modeling clinical notes and predicting hospital readmission.ArXiv2019. doi:10.48550/arxiv.1904.05342 · DOI · Paper page
- 10.18653/v1/W19-1909 · DOI · Paper page
- BjorckJ WeinbergerK GomesC.Understanding decoupled and early weight decay.ArXiv2020. doi:10.48550/arxiv.2012.13841 · DOI
- LoshchilovI HutterF.Decoupled weight decay regularization. InInternational Conference on Learning Representations 20182017. doi:10.48550/arxiv.1711.05101 · DOI · Paper page
- 10.18653/v1/D16-1264 · DOI · Paper page
- 10.1111/head.14069 · DOI
- 10.1111/head.14154 · DOI
- 10.1177/0333102417738202 · DOI
- 10.1111/head.14495 · DOI
- 10.1177/03331024231156925 · DOI
- 10.1111/head.14324 · DOI
- 10.1111/ene.15458 · DOI
- 10.1111/head.14339 · DOI
Cited by
Sorted by citations
Assessing Empathy in Large Language Models with Real-World Physician-Patient Interactions
Luo, M., Warren, C. J., Cheng, L., Abdul-Muhsin, H. M., & Banerjee, I. (2024) · 2024 IEEE International Conference on Big Data (BigData) · doi:10.1109/bigdata62323.2024.10825307 · Cited by 36
Self-citationAssessment of a Zero-Shot Large Language Model in Measuring Documented Goals-of-Care Discussions
Lee, R. Y., Li, K. S., Sibley, J., Cohen, T., Lober, W. B., Dotolo, D. G., & Kross, E. K. (2026) · Journal of Pain and Symptom Management · doi:10.1016/j.jpainsymman.2025.09.025 · Cited by 5
Metadata
- Authors
- Chiang, C., Luo, M., Dumkrieger, G., Trivedi, S., Chen, Y., Chao, C., Schwedt, T. J., Sarker, A., & Banerjee, I.
- Affiliations
- Mayo Clinic (US)
- Emory University (US)
- Corresponding author
- Chiang, Chia‐Chun
- ORCID
- Venue
- Headache: The Journal of Head and Face Pain
- Publisher
- Wiley
- Published
- 2024-03-25
- Volume
- 64
- Issue
- 4
- Pages
- 400-409
- ISSN
- 0017-8748 (ISSN-L)
- 1526-4610
- PMC
- PMC12128507
- OpenAlex
- W4393148752
- Cited by
- 53
- References
- 1
- Citations by year
- 2026: 13 · 2025: 19 · 2024: 21
- FWCI
- 7.82
- Type
- journal article
- Language
- en
- Open access
- green
- doi.org
- Licence
- Locations
- Headache The Journal of Head and Face Pain (publishedVersion)
- medRxiv (acceptedVersion, cc-by-nc-nd)
- PubMed (publishedVersion)
- PubMed Central (acceptedVersion, cc-by-nc-nd)
- PubMed Central (submittedVersion, cc-by-nc-nd)
- Funders
- National Cancer Institute (U01 CA269264‐01‐1)
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Machine Learning in Healthcare
- Health Sciences › Medicine › Health Informatics › Biomedical Text Mining and Ontologies
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Keywords
- migraine, clinical notes, electronic health records, large language models, GPT-2, ClinicalBERT, clinical text extraction, natural language processing, zero-shot question answering, few-shot fine-tuning, generative models, regression models, clinical documentation improvement, nurse practitioners
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review