Large language model derived regular expressions for sleep phenotyping from electronic health record: a feasibility study.

Nathanael Hwang, M Brandon Westover, Diego R Mazzotti, Robert J Thomas, Lynn Marie Trotti, Dennis Hwang, Matt Gratton, Jiaxiao Shi, Rui Yan, Emmanuel Mignot, Gari D Clifford, Umakanth A Katwa, Kendra A Becker, Matthew T Klimper, Jessica K Jara, Haoqi Sun
{"title":"Large language model derived regular expressions for sleep phenotyping from electronic health record: a feasibility study.","authors":"Nathanael Hwang, M Brandon Westover, Diego R Mazzotti, Robert J Thomas, Lynn Marie Trotti, Dennis Hwang, Matt Gratton, Jiaxiao Shi, Rui Yan, Emmanuel Mignot, Gari D Clifford, Umakanth A Katwa, Kendra A Becker, Matthew T Klimper, Jessica K Jara, Haoqi Sun","doi":"10.1093/sleepadvances/zpag059","DOIUrl":null,"url":null,"abstract":"<p><strong>Study objectives: </strong>Large language models may efficiently develop Regular Expression (regex)-based natural language processing for electronic health record phenotyping. We present PromptNLP to assess feasibility by evaluating performance and generalizability to clinical notes across multiple institutions.</p><p><strong>Methods: </strong>Sleep-related clinical notes from Kaiser Permanente Southern California, Beth Israel Deaconess Medical Center, and Emory University were used to extract apnea-hypopnea index and Epworth Sleepiness Scale. PromptNLP involves two steps: (1) build an apnea-hypopnea index/Epworth Sleepiness Scale phrase library (\"Targeted\" via manual, \"General\" via large language models); (2) input the library into an large language model with prompts to generate regex. For model development (Phase 1), we compared PromptNLP regexes with manual regex. For external validation (Phase 2), we adapted the Phase 1 Targeted regex to Beth Israel Deaconess Medical Center and Emory notes. For application (Phase 3), we applied adapted the regex to 207 404 Kaiser Permanente Southern California notes with validation against 8602 structured apnea-hypopnea index.</p><p><strong>Results: </strong>Phase 1: All Targeted PromptNLP regexes outperformed manual regex for recall (apnea-hypopnea index: 95%-96% vs 80.8%; Epworth Sleepiness Scale: 98%-100% vs 88%; <i>p</i> < .05). General regexes surpassed manual, but with lower recall. Phase 2: Direct Beth Israel Deaconess Medical Center application performed poorly (apnea-hypopnea index/Epworth Sleepiness Scale: 30%/12%), but adapting the phrase library improved recall to 96%/84%. For Emory, recall improved from 85%/86% to 94%/89% after adaptation. Across Phases 1 and 2, the PromptNLP regexes achieved 100% precision. Phase 3: 8216 (95.5%) apnea-hypopnea index values were correctly extracted with 99.8% precision.</p><p><strong>Conclusions: </strong>PromptNLP demonstrated feasibility as an efficient, accurate, and generalizable method, outperforming manual approaches and enabling iterative cross-system improvement. Systematic comparisons to direct large language model approaches are needed.</p>","PeriodicalId":74808,"journal":{"name":"Sleep advances : a journal of the Sleep Research Society","volume":"7 3","pages":"zpag059"},"PeriodicalIF":0.0000,"publicationDate":"2026-06-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC13372092/pdf/","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Sleep advances : a journal of the Sleep Research Society","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1093/sleepadvances/zpag059","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2026/1/1 0:00:00","PubModel":"eCollection","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Study objectives: Large language models may efficiently develop Regular Expression (regex)-based natural language processing for electronic health record phenotyping. We present PromptNLP to assess feasibility by evaluating performance and generalizability to clinical notes across multiple institutions.

Methods: Sleep-related clinical notes from Kaiser Permanente Southern California, Beth Israel Deaconess Medical Center, and Emory University were used to extract apnea-hypopnea index and Epworth Sleepiness Scale. PromptNLP involves two steps: (1) build an apnea-hypopnea index/Epworth Sleepiness Scale phrase library ("Targeted" via manual, "General" via large language models); (2) input the library into an large language model with prompts to generate regex. For model development (Phase 1), we compared PromptNLP regexes with manual regex. For external validation (Phase 2), we adapted the Phase 1 Targeted regex to Beth Israel Deaconess Medical Center and Emory notes. For application (Phase 3), we applied adapted the regex to 207 404 Kaiser Permanente Southern California notes with validation against 8602 structured apnea-hypopnea index.

Results: Phase 1: All Targeted PromptNLP regexes outperformed manual regex for recall (apnea-hypopnea index: 95%-96% vs 80.8%; Epworth Sleepiness Scale: 98%-100% vs 88%; p < .05). General regexes surpassed manual, but with lower recall. Phase 2: Direct Beth Israel Deaconess Medical Center application performed poorly (apnea-hypopnea index/Epworth Sleepiness Scale: 30%/12%), but adapting the phrase library improved recall to 96%/84%. For Emory, recall improved from 85%/86% to 94%/89% after adaptation. Across Phases 1 and 2, the PromptNLP regexes achieved 100% precision. Phase 3: 8216 (95.5%) apnea-hypopnea index values were correctly extracted with 99.8% precision.

Conclusions: PromptNLP demonstrated feasibility as an efficient, accurate, and generalizable method, outperforming manual approaches and enabling iterative cross-system improvement. Systematic comparisons to direct large language model approaches are needed.

大型语言模型从电子健康记录中导出睡眠表型的正则表达式:可行性研究。
研究目标:大型语言模型可以有效地开发基于正则表达式(regex)的电子健康记录表型自然语言处理。我们提出PromptNLP通过评估多个机构的临床记录的性能和普遍性来评估可行性。方法:采用Kaiser Permanente Southern California、Beth Israel Deaconess Medical Center和Emory University的睡眠相关临床记录提取呼吸暂停低通气指数和Epworth嗜睡量表。PromptNLP包括两个步骤:(1)建立一个呼吸暂停-低呼吸指数/Epworth嗜睡量表短语库(“目标”通过手册,“一般”通过大型语言模型);(2)将库输入到大型语言模型中,并提示生成正则表达式。对于模型开发(阶段1),我们比较了PromptNLP正则表达式和手动正则表达式。为了进行外部验证(第二阶段),我们根据Beth Israel Deaconess医疗中心和Emory笔记调整了第一阶段的目标正则。对于应用(第3阶段),我们将正则表达式应用于207404 Kaiser Permanente Southern California笔记,并根据8602结构化呼吸暂停-低通气指数进行验证。结果:第一阶段:所有Targeted PromptNLP regex在召回方面优于手动regex(呼吸暂停-低通气指数:95%-96% vs 80.8%; Epworth嗜睡量表:98%-100% vs 88%; p结论:PromptNLP作为一种高效、准确、可推广的方法证明了其可行性,优于手动方法,并可进行迭代的跨系统改进。需要与直接的大型语言模型方法进行系统比较。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
CiteScore
2.10
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书