AI-Powered Drug Classification and Indication Mapping for Pharmacoepidemiologic Studies: Prompt Development and Validation.

JMIR AI Pub Date : 2025-06-12 DOI:10.2196/65481
Benjamin Ogorek, Thomas Rhoads, Eric Finkelman, Isaac R Rodriguez-Chavez
{"title":"AI-Powered Drug Classification and Indication Mapping for Pharmacoepidemiologic Studies: Prompt Development and Validation.","authors":"Benjamin Ogorek, Thomas Rhoads, Eric Finkelman, Isaac R Rodriguez-Chavez","doi":"10.2196/65481","DOIUrl":null,"url":null,"abstract":"<p><strong>Background: </strong>Pharmacoepidemiologic studies, which promote rational drug use and improve health outcomes, often require Anatomical Therapeutic Chemical Classification System (ATC) drug classification within real-world data (RWD) sources. Existing classification tools are expensive, brittle, or have restrictive terms of service, and lack context that may inform classification itself.</p><p><strong>Objective: </strong>This study sought to establish large language models (LLMs) as an assisting technology in the drug classification task. This included developing artificial intelligence prompts that reason about drugs using RWD and showing that the resulting accuracy, efficiency, and effectiveness are favorable to alternative methods.</p><p><strong>Methods: </strong>A prompt was constructed to classify aspirin as either an analgesic or antithrombotic and evaluated within 12,294 anonymized daily dose strings from a polychronic population residing in the United States and Canada. The patients used a smart medication dispenser called \"spencer\" and consented to the use of their data for research. The LLM prompt requested that the best and next-best second-level ATC code be returned, and grading was performed on a 3-point scale. After success in a pilot sample of 20, an inference sample of 200 was taken without replacement. Finite population inference was carried out on the proportion of outputs receiving 1 of the top 2 grades. As a benchmark, Google's Programmable Search Engine was used to query the drug name plus \"ATC code\" followed by regex-based extraction of ATC codes. All imperfect results were reviewed.</p><p><strong>Results: </strong>The population consisted of 12,294 daily dose strings from 86.26% (2908/3371) patients residing in Canada and 13.73% (463/3371) residing in the United States. A prompt using the chain-of-thought reasoning was able to distinguish between aspirin's analgesic versus antithrombotic therapeutic uses and performed well in the pilot sample. In the inferential sample, 87.5% (175/200) were graded as perfect, 5% (10/200) had a minor issue, and 7.5% (15/200) had a major issue. The estimate of the proportion of at least mostly correct classification was 92.5% (185/200, 80% CI 90.1%-94.9%). For the search-based algorithm, 82.5% (165/200) were deemed acceptable. The chain-of-thought reasoning was most helpful with supplements (eg, folic acid) when high doses indicated antianemic preparations. The problem formulation of daily dose inputs and multiple ATC outputs was sometimes incompatible with the drug (eg, pregabalin, calcitriol, and methotrexate).</p><p><strong>Conclusions: </strong>GPT-4o offers cost-effective drug classification from RWD without violating any terms of service. Using a chain-of-thought prompting technique, GPT-4o can reason about drug dosages that affect the class. The wide accessibility of LLMs gives every research team the ability to classify drugs at scale, a key prerequisite of pharmacoepidemiologic research.</p>","PeriodicalId":73551,"journal":{"name":"JMIR AI","volume":"4 ","pages":"e65481"},"PeriodicalIF":0.0000,"publicationDate":"2025-06-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"JMIR AI","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.2196/65481","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Background: Pharmacoepidemiologic studies, which promote rational drug use and improve health outcomes, often require Anatomical Therapeutic Chemical Classification System (ATC) drug classification within real-world data (RWD) sources. Existing classification tools are expensive, brittle, or have restrictive terms of service, and lack context that may inform classification itself.

Objective: This study sought to establish large language models (LLMs) as an assisting technology in the drug classification task. This included developing artificial intelligence prompts that reason about drugs using RWD and showing that the resulting accuracy, efficiency, and effectiveness are favorable to alternative methods.

Methods: A prompt was constructed to classify aspirin as either an analgesic or antithrombotic and evaluated within 12,294 anonymized daily dose strings from a polychronic population residing in the United States and Canada. The patients used a smart medication dispenser called "spencer" and consented to the use of their data for research. The LLM prompt requested that the best and next-best second-level ATC code be returned, and grading was performed on a 3-point scale. After success in a pilot sample of 20, an inference sample of 200 was taken without replacement. Finite population inference was carried out on the proportion of outputs receiving 1 of the top 2 grades. As a benchmark, Google's Programmable Search Engine was used to query the drug name plus "ATC code" followed by regex-based extraction of ATC codes. All imperfect results were reviewed.

Results: The population consisted of 12,294 daily dose strings from 86.26% (2908/3371) patients residing in Canada and 13.73% (463/3371) residing in the United States. A prompt using the chain-of-thought reasoning was able to distinguish between aspirin's analgesic versus antithrombotic therapeutic uses and performed well in the pilot sample. In the inferential sample, 87.5% (175/200) were graded as perfect, 5% (10/200) had a minor issue, and 7.5% (15/200) had a major issue. The estimate of the proportion of at least mostly correct classification was 92.5% (185/200, 80% CI 90.1%-94.9%). For the search-based algorithm, 82.5% (165/200) were deemed acceptable. The chain-of-thought reasoning was most helpful with supplements (eg, folic acid) when high doses indicated antianemic preparations. The problem formulation of daily dose inputs and multiple ATC outputs was sometimes incompatible with the drug (eg, pregabalin, calcitriol, and methotrexate).

Conclusions: GPT-4o offers cost-effective drug classification from RWD without violating any terms of service. Using a chain-of-thought prompting technique, GPT-4o can reason about drug dosages that affect the class. The wide accessibility of LLMs gives every research team the ability to classify drugs at scale, a key prerequisite of pharmacoepidemiologic research.

用于药物流行病学研究的人工智能药物分类和适应症定位:快速发展和验证。
背景:促进合理用药和改善健康结果的药物流行病学研究通常需要解剖学治疗化学分类系统(ATC)在真实世界数据(RWD)来源中的药物分类。现有的分类工具要么昂贵、脆弱,要么有限制性的服务条款,而且缺乏可能告知分类本身的上下文。目的:本研究寻求建立大型语言模型(LLMs)作为药物分类任务的辅助技术。这包括开发人工智能提示关于使用RWD的药物的原因,并显示结果的准确性,效率和有效性有利于替代方法。方法:构建一个提示,将阿司匹林分类为镇痛药或抗血栓药,并对居住在美国和加拿大的多慢性人群的12,294个匿名日剂量字符串进行评估。患者使用一种名为“斯宾塞”的智能药物分配器,并同意将他们的数据用于研究。LLM提示要求返回最佳和次优的二级ATC代码,并按3分制进行评分。在20个试点样本成功后,抽取200个推理样本而不进行替换。对获得前2个等级中的1个的产出比例进行有限总体推断。作为基准,使用谷歌的可编程搜索引擎查询药物名称加上“ATC代码”,然后基于正则表达式提取ATC代码。对所有不完美的结果进行了审查。结果:该人群包括来自86.26%(2908/3371)居住在加拿大和13.73%(463/3371)居住在美国的患者的12,294个日剂量串。使用思维链推理的提示能够区分阿司匹林的镇痛和抗血栓治疗用途,并在试点样本中表现良好。在推理样本中,87.5%(175/200)被评为完美,5%(10/200)有一个小问题,7.5%(15/200)有一个大问题。至少大部分正确分类的比例估计为92.5% (185/200,80% CI 90.1%-94.9%)。对于基于搜索的算法,82.5%(165/200)被认为是可接受的。当高剂量服用抗贫血制剂时,思维链推理对补充剂(如叶酸)最有帮助。每日剂量输入和多个ATC输出的问题配方有时与药物不相容(例如,普瑞巴林、骨化三醇和甲氨蝶呤)。结论:gpt - 40在不违反任何服务条款的情况下,为RWD提供了具有成本效益的药物分类。使用思维链提示技术,gpt - 40可以推断出影响班级的药物剂量。法学硕士的广泛可及性使每个研究团队都能够大规模地对药物进行分类,这是药物流行病学研究的关键先决条件。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
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学术官方微信