Abstract
Veterinary electronic health records are often stored as unstructured free text, and structuring this information into analyzable formats is essential for downstream research. Natural language processing methods, including rule-based systems, machine learning algorithms, and, more recently, large language models (LLMs), provide tools to achieve this goal. This scoping review follows the PRISMA (Preferred Reporting Items for Systematic reviews and Meta-Analyses) Extension for Scoping Reviews (PRISMA-ScR) guideline to examine how information extraction (IE) has been applied in veterinary medicine and extended to existing LLM approaches in human medicine. Literature research was conducted on 4 databases: PubMed, CAB Abstracts, Web of Science, and ACL Anthology, with stricter criteria limiting human medicine to prompt-based studies. After screening 5796 original research papers, a total of 23 veterinary and 31 human studies were selected for inclusion. In the veterinary literature, larger data sets were more commonly used to train supervised models, whereas human studies increasingly employed prompt-based LLMs, such as LLaMA and GPT, enabling IE with smaller annotated data sets. We developed a practical framework covering data preparation, platform and privacy considerations, and prompt engineering, with a corresponding workflow and prompt example to demonstrate the application of artificial intelligence (AI) in clinical data extraction. This review offers a practical tool to help veterinary researchers effectively integrate AI tools and LLMs into clinical research workflows.
Keywords
Veterinary electronic health records (EHRs) or electronic medical records are often stored in narratives to capture and document complex conditions flexibly. However, clinical research that involves statistical analysis or machine learning (ML) prediction often requires structured data, such as Excel spreadsheets or comma-separated values (CSV) files, for further investigation. Currently, extracting information from free text at scale is a time-consuming and labor-intensive task with no standardized solution.
The task of converting unstructured text into predefined, structured formats is known as information extraction (IE). 44 It is a key task within natural language processing (NLP), a branch of artificial intelligence (AI) focused on enabling computers to process human language. IE is a broad field containing many subtasks. Named entity recognition (NER) is one of the most common subtasks of IE that identifies and labels entities in the text into predefined categories such as breed, age, body weight, and other domain-specific terms. 44 Other subtasks of IE include temporal/event extraction, negation detection, and relation extraction, which identifies relationships between entities such as clinical sign-disease or drug-disease associations.25,44 Aside from IE, other NLP tasks that are widely used in clinical data collection include classification, which systematically categorizes textual data into predefined classes, 74 and information retrieval, which facilitates the extraction of relevant documents from extensive text corpora based on specific queries. 60 Table 1 summarizes the common NLP tasks and examples of their downstream applications in clinical studies.
Examples of natural language processing tasks and their downstream applications in clinical studies.
Models for completing NLP tasks have evolved significantly over time. Early approaches relied on rule-based systems, which were later complemented by statistical and ML models. The emergence of deep learning (DL) brought substantial advances through architectures such as recurrent and convolutional neural networks. 49 More recently, the introduction of the transformer architecture, a form of DL model using attention mechanisms, 70 has opened a new era of AI tools. Particularly, transformer-based models like Bidirectional Encoder Representations from Transformers (BERT) and Generative Pretrained Transformer (GPT) are widely recognized models that are commonly referred to as large language models (LLMs). 81 The common models and the algorithms used for NLP tasks in this review are summarized in Table 2. A detailed breakdown of how these methods are organized into a practical pipeline, from preprocessing and feature extraction to data analysis, is provided in another review by Sim et al. 59
Common models for natural language processing tasks included in this review.
In this review, we defined LLM-based platforms such as ChatGPT, Gemini, Claude, or Grok as prompt-based or interactive LLMs. Users can interact with these models using natural language rather than computational codes, making them accessible and practical tools for clinical researchers with limited coding experience. The procedure of carefully designing and refining inputs (prompts) to LLMs is called prompt engineering. 16 A core principle of this is in-context learning, where the model learns from information provided directly within the prompt itself. 19 There are several strategies of prompt engineering, such as instructional inputs without examples (zero-shot learning), or with a small number of examples (few-shot learning), or being instructed to provide reasoning step by step (chain-of-thought). 7 Another advanced interaction method involves adjusting the LLM’s hyperparameters, with “temperature” being a primary example. This parameter directly controls the randomness of the model’s response; low values produce deterministic outputs, whereas higher values promote creativity at the potential cost of factual accuracy.13,47 While researchers can typically set the temperature (often on a scale of 0–2) through application programming interfaces (APIs) or local deployments, this option is usually fixed or unavailable in standard web interfaces.
The performance of these models is commonly assessed through the following metrics: accuracy, precision (positive predictive value [PPV]), recall (sensitivity), specificity, and F1-scores. The corresponding formulas are shown below:
In human medicine, IE has been broadly reviewed either in the general medical domain15,41,43,45 and within specific domains such as radiology, 52 oncology, 12 and pathology. 8 Most reviews noted the trend of using BERT or BERT variants for IE tasks and subtasks, including NER and relation extraction, with only one review article discussing GPT’s potential in IE. 67 To the best of the authors’ knowledge, reviews on the use of prompt-based LLMs in IE are scarce in human medicine and absent in veterinary medicine. In 2024, Davies et al17,18 reviewed various model frameworks (Table 2) without constraining their analysis to a specific task. Subsequently, in 2025, Stimmer et al 65 focused specifically on NLP in veterinary pathology, providing foundational knowledge on generic model terminology and a historical review of the field, complemented by case studies illustrating NLP applications in education, report generation, and clinical decision-making. Our work extends these foundational reviews by focusing specifically on the application of LLMs for IE, drawing comparisons from both the veterinary and human medical domains.
This scoping review provides an overview of all research articles in human and veterinary medicine on automatic data extraction from EHRs up to June 2025. In the first part of the review, a systematic search was performed on veterinary literature on using AI tools to automatically extract unstructured clinical data to accomplish various NLP tasks, such as IE, classification, and information retrieval. In the second part of the review, we narrowed the scope and focused on human medicine studies using open-source or commercially available LLMs to perform IE. For human medicine publications, we only include research articles that provide prompt examples, so that the approaches can be easily replicated by veterinary researchers with minimal technical requirements.
In this review paper, we asked the main research question: “How are AI tools used to facilitate automated clinical data extraction from unstructured EHRs in veterinary and human medicine?”
Specifically, we wanted to know the following sub-research questions:
What input data are used? ○ What types of clinical records are included (eg, EHRs, pathology reports, or radiology reports)? ○ How many records are fed into the model? ○ What is the source of the data (eg, open database, teaching hospitals, or diagnostic labs)?
What NLP tasks are performed, and what downstream applications do they support?
What models or pipelines are used to extract information?
How are these tools evaluated? ○ What is the ground truth used for evaluation (eg, expert annotation or structured codes)? ○ What are the performance metrics?
Are prompts provided?
Beyond an overview of AI-assisted IE applications in veterinary and human medicine, this review provides a comprehensive framework and practical guidance for veterinary researchers planning to implement automated data extraction for clinical research.
Materials and Methods
We followed the PRISMA (Preferred Reporting Items for Systematic reviews and Meta-Analyses) Extension for Scoping Reviews (PRISMA-ScR) guideline to perform a scoping review on the use of AI-powered tools in automated clinical data extraction. 68 The PRISMA-ScR checklist is provided in the Supplemental Material S1.
Review in Veterinary Medicine
Literature search
Search terms were generated based on the following concepts to cover our areas of interest: (1) the use of AI, (2) the desired data type, and (3) research in the veterinary field. Keywords and synonyms were iteratively developed to capture studies that apply AI tools to extract information from veterinary EHRs (Table 3). The search was performed on June 3, 2025, covering all publications up to that date.
Key concepts and associated search terms for the veterinary medicine literature.
The terms within each concept were connected using Boolean operators “OR,” and concepts were combined using “AND.” The final search strategies were applied across 3 databases: PubMed, CAB Abstracts, and Web of Science. In addition, we included the ACL Anthology as a supplementary database focusing on computational linguistics research. Search strings were customized on each platform depending on its available options. The ACL Anthology does not provide direct export searches on the platform but instead stores all publication metadata as a Python library. A code script was created to perform the search and compile results into the Research Information Systems format and import into the same paper screening tool with the other database search results. As the ACL Anthology database is already NLP-specific by nature, the search terms were solely focused on “veterinary.” The full search strategies are provided in Supplemental Material S2.
Selection process
Paper screening was performed on Covidence, an online review management platform (https://www.covidence.org/). Once search results across all 4 databases were imported into Covidence, duplicates were automatically detected and removed before manual review. The screening was carried out independently by 2 reviewers (YC and CPC). The review process consisted of 2 phases (Fig. 1). In phase I, each reviewer screened independently and was blinded from the other’s assessments. Each title and abstract were examined against the preestablished inclusion and exclusion criteria (Table 4). Once the review was completed, disagreements were resolved through discussion. The selected studies will be advanced to the next phase. In phase II, full texts of selected studies in phase I were retrieved and assessed against the same inclusion criteria (Table 4) to ensure the studies fit our scope. Papers without accessible full texts were excluded. This phase was also conducted independently on Covidence by 2 reviewers (YC and CPC). Disagreements were resolved through discussion.

PRISMA 2020 flow diagram of veterinary medicine paper selection.
Inclusion and exclusion criteria for the veterinary literature.
Abbreviations: NLP, natural language processing; IE, information extraction; NER, named entity recognition; RE, relation extraction; IR, information retrieval; EHR, electronic health record; EMR, electronic medical record.
Data charting
Data charting was performed by one author (YC) using Microsoft Word and was further verified by another author (CPC). Conflicts were resolved through discussion.
Items to be included in the main result table were developed to answer the main and sub-research questions:
Year
Authors
Data set: type, size, source
NLP task
Downstream applications
Ground truth
Model or pipeline
Performance
Prompt availability
The charted data are presented in Supplemental Table S1 and synthesized in the “Results” section by grouping studies into broader categories for descriptive analysis.
Review in Human Medicine
Literature search
For human medicine studies, the search strategy was modified to (1) remove the veterinary-specific terms and (2) add “named entity recognition” and “information extraction” to narrow down the NLP tasks. The search strategies on the same 4 databases (PubMed, CAB Abstracts, Web of Science, and ACL Anthology) can be found in Supplemental Material S2.
Selection process
Independent screening was performed by 2 reviewers (YC and CPC) on Covidence, as described in for the review of the veterinary literature, but with a strict focus on IE using LLMs with prompts. Additional relevant studies that were not captured in the initial literature search were identified by manually reviewing the reference lists of included studies (snowball sampling) and were assessed for eligibility using the same criteria. See Fig. 2 and Table 5 for the full diagram and inclusion and exclusion criteria.

PRISMA 2020 flow diagram of human medicine paper selection. IE, information extraction.
Inclusion and exclusion criteria for human literature.
Abbreviations: NLP, natural language processing; IE, information extraction; NER, named entity recognition; RE, relation extraction; IR, information retrieval; LLM, large language model; EHR, electronic health record; EMR, electronic medical record.
Data charting
The data charting process followed the same approach as previously described, but the charting template was tailored for the human medicine scope. NLP task, downstream application, and prompt availability were handled at the eligibility-screening stage and therefore were not charted. An item documenting data set privacy was added because prompt-based LLMs often require external servers, which raises concerns about data security:
Year
Authors
Data set: type, size, source
Privacy
Ground truth
Model or pipeline
Performance
The charted data are presented in Supplemental Table S2 and synthesized in the “Results” section by grouping studies into broader categories for descriptive analysis.
Results
A total of 5796 original research papers were identified across veterinary and human medicine databases, of which 54 met the inclusion criteria and underwent full-text screening. Specifically, 23 veterinary studies (Fig. 1 and Supplemental Table S1) and 31 human studies (Fig. 2 and Supplemental Table S2) were included. Owing to the diverse objectives and methods of these studies, direct performance comparisons were not feasible, as outcomes were highly task- and data set-dependent. If multiple models were involved, the best-performing models reported in each study are highlighted in bold in the performance columns (Supplemental Tables S1 and S2).
Data Sets
In both domains, some research data came from shared or public databases, while the majority of the included studies utilize institution-specific data sets. In veterinary medicine, research predominantly relied on 3 large data sets, including the Small Animal Veterinary Surveillance Network (SAVSNET) (5/23), VetCompass (6/23), and institutional data sets from Colorado State University (CSU) (4/23). Of these, only SAVSNET (https://www.liverpool.ac.uk/savsnet/) offers publicly available sample data and shares research-ready data upon request. Similarly, a handful of benchmark data sets in human medicine were used more than once, including the Medical Information Mart for Intensive Care (MIMIC) (4/31), the Informatics for Integrating Biology and the Bedside (i2b2) (2/31), MTSamples (2/31), the Vaccine Adverse Event Reporting System (VAERS) (2/31), and The Cancer Genome Atlas (TCGA) (2/31). A significant proportion of included studies in both fields (8/23 in veterinary, 22/31 in human) relied on unique data sets cited only once, suggesting a shared challenge of data isolation. While the primary corpus in both disciplines was EHRs (18/23 in veterinary, 23/31 in human), niche data types, such as pathology and necropsy reports (3/23), oncology records (1/23), and shelter records (1/23), were also utilized in veterinary domain, which was comparable with human studies that used pathology (4/31), radiology (3/31), and echocardiogram reports (1/31).
In veterinary medicine, data sets often spanned from hundreds to millions of records, reflecting reliance on supervised ML methods that require extensive expert annotation (Fig. 3a). By contrast, in human medicine, data set sizes more commonly fell within a modest range of hundreds to thousands of records (Fig. 3b), likely influenced by the recent adoption of prompt-based LLMs, which reduces the need for large volumes of annotated training data.

Distribution of data set sizes in the included veterinary and human medicine studies. The histograms show the number of data sets grouped by size, with the x-axis on a logarithmic scale (powers of 10). (a) In veterinary medicine (N = 22; one study did not report data set size), the distribution is wide, with a primary concentration in the hundreds-to-thousands range and also includes several large-scale data sets with over 1 million records. (b) In human medicine (N = 30; one study did not report data set size), the distribution is more constrained, with data sets predominantly containing hundreds to thousands of records.
Privacy
The use of LLMs in human medicine introduces significant privacy challenges. Due to their immense scale, many state-of-the-art LLMs are difficult to run locally, compelling researchers to rely on commercial APIs or hosted platforms. This dependency introduces the risk of transmitting sensitive patient information outside institutional boundaries. To mitigate this risk, most studies (23/31) employed data deidentification or anonymization, a process that itself demands considerable time and manual effort to ensure accuracy. A smaller subset of studies pursued alternative strategies, either using secure servers like Microsoft Azure or Amazon Web Services (5/31) to create enclosed environments or by running open-source LLMs such as LLaMA locally (3/31). This latter approach avoids sharing data with external providers but requires substantial computational resources to implement.
NLP Tasks and Downstream Application
Across the 23 included veterinary studies, the use of AI for automated clinical data extraction demonstrated considerable methodological diversity. Classification tasks dominated the field (13/23), and their applications ranged from disease coding to mortality prediction and obesity detection. IE (4/23) and NER (3/23) were less common but provided foundations for downstream applications such as surveillance, drug labeling, and resource development. Information retrieval (2/23) and negation/speculation detection (1/23) were rarely reported, suggesting these areas remain underexplored compared with classification-oriented approaches. By contrast, all 31 included human studies focused on IE, as determined by the eligibility criteria.
Ground Truth and Validation
Although some studies adopted labels directly from existing benchmarks, most defined study-specific tasks and therefore developed tailored label sets. In both veterinary and human medicine, ground truth was typically established by 1 to 6 domain experts, though their specific backgrounds (Supplemental Tables S1 and S2) and annotation protocols were inconsistently reported.36,50,72 When reported, the annotation guidelines could be granular and extensive. For example, Vithanage et al 72 published an annotation protocol 83 prior to their LLM-based extraction study, specifying annotator training hours and providing a comprehensive list of 120 dementia and malnutrition-relevant terms to extract. Similarly, Ralevski et al 50 explicitly defined 9 conditions that should be labeled as “unstably housed.” Keloth et al 36 employed a 2-level annotation scheme by first capturing the presence of key factors and then specifying finer-grained attributes such as temporality and assertion status.
Other studies described more general procedures in which 2 reviewers annotated independently, and disagreements were resolved through internal consensus and/or adjudication by an additional expert to finalize the labels. Label quality was most often assessed via interannotator agreement, typically Cohen’s kappa, with reported values ranging from approximately 0.55 to 1.0 (Supplemental Tables S1 and S2). Conventional interpretive thresholds for Cohen’s kappa, according to Landis and Koch, are as follows: 0.00–0.20, slight; 0.21–0.40, fair; 0.41–0.60, moderate; 0.61–0.80, substantial; 0.81–1.00, almost perfect. 39 This range indicates moderate to near-perfect agreement among the included studies. However, comparisons across studies are constrained by differences in task complexity and labels. Although essential for mitigating subjectivity, the reliance on multireviewer consensus creates a significant resource bottleneck in NLP research, particularly for annotation tasks requiring deep domain expertise (eg, oncology or pathology). Apart from human consensus, one study used GPT-4 outputs as an auxiliary reference to flag missed annotations before finalizing the gold standard. 50 In this workflow, the use of an LLM as a quality assurance layer suggests its potential not only to be evaluated but also to assist in the creation of ground truth.
Model Evolution
The evolution of models in veterinary medicine illustrates a trajectory from traditional algorithms to modern neural architectures (Fig. 4). Earlier studies relied on statistical and supervised ML algorithms such as support vector machine, random forest, and logistic regression, which demonstrated moderate performance (F1-scores typically ranging from 60% to 80%).6,46,57 Progressively, DL models like long short-term memory and convolutional neural network architectures were adopted, then transformer-based models such as PetBERT, 21 VetBERT, 32 and PubMedBERT 57 became the dominant approach. In the human medicine studies, while the primary focus was on LLMs, encoder-only architectures such as RoBERTa3,20,27 and BioClinicalBERT20,30,31 were also used as comparative baselines. Decoder-only transformers, more widely known as generative LLMs, represent the current emphasis in literature. In veterinary medicine, 4 studies applied models such as GPT,24,33,76 LLaMA, 33 and VetLLM, 34 exhibiting competitive or superior performance in tasks like overweight detection and drug label extraction. In human medicine, adoption is more widespread, with models from the GPT series appearing in 17 studies and the LLaMA family in 13 studies. The emerging Mistral family and other models like Gemma were also reported (Supplemental Tables S1 and S2).

Trends in model selection for veterinary information extraction by publication year (2017–2025). Each rectangle corresponds to the most advanced model reported in a single study. The darker the color, the more advanced the model. The chart illustrates a clear progression from rule-based and early deep learning models toward the increasing dominance of transformer-based architectures from 2020 onward.
Evaluation Metrics and Performance
The variety of models complicates direct performance comparison and evaluation. Even for the same model, such as LLaMA-2-13B, reported outcomes varied widely, ranging from 0% accuracy in one study 56 to an F1-score of 73% in another, 28 indicating how performance is shaped by individual study design.
Reported metrics are summarized in Supplemental Tables S1 and S2, where we prioritize the F1-score for comparability, although some studies reported only accuracy, precision, or recall. The performance of a model is fundamentally tied to the nature of the information it is tasked to extract. The evaluated data across studies differed significantly and could be broadly grouped into categorical and noncategorical outputs, each presenting distinct evaluation requirements.
Categorical extraction was most common and was typically operationalized as binary, multilabel, or multiclass classification. Many studies framed extraction as a series of yes/no questions, such as the presence or absence of a disease (eg, canine parvovirus, 57 pulmonary embolism), 11 a finding (eg, necrosis, 69 endplate pathology), 84 or a patient attribute (eg, vaccinated, 35 biomarker positive). 55 While for multilabel extraction, a single note could be positive for multiple binary targets simultaneously. A common veterinary example is International Classification of Diseases (ICD) coding, where each disease code is treated as a separate yes/no label and the model may assign more than one disease class per case.9,21,34,46,71,79 Similarly, metastatic site identification can be framed as selecting applicable sites from a fixed list of candidate organs (eg, 12 sites). 23 By contrast, multiclass settings required choosing among more than 2 options. Examples include classifying the primary reason for an actions (eg, antibiotic indication across 52 diseases), 32 selecting among multiple temporal-frequency categories (eg, daily, weekly, and monthly patterns), 28 social variables (eg, marital status categories),27,36,50 imaging progression (worsening, stable, or improving), 23 and histopathology features including laterality, histologic type, and staging.31,55,69
Noncategorical data required extracting values that were not drawn from a closed label set, which presented a greater evaluation challenge. These tasks include numerical outputs (eg, tumor size in mm,23,55 administration frequency, body weight in kg) 33 and free-text fields (eg, breed, patient name, and descriptive tumor-location phrases). 48 Such targets are inherently more difficult to evaluate with strict string matching and are more sensitive to formatting differences.
Given the generative nature of LLMs, this distinction between data types is central to the challenge of evaluation. For categorical data, the model’s output can be directly compared against a finite list of predefined labels (eg, specific disease class). However, for noncategorical data where items cannot be exhaustively listed, exact match becomes overly stringent. Semantically equivalent outputs may differ lexically (eg, “anorexia” vs “decreased appetite”), making performance sensitive to minor variations in tokenization and spelling.
To address this, one study explored Recall-Oriented Understudy for Gisting Evaluation (ROUGE) and Jaccard similarity, which are commonly used in text generation to accommodate semantically similar paraphrases. The authors emphasized that ROUGE and Jaccard are not standard IE evaluation measures, so that their values are not directly comparable with conventional entity-level F1. Supplemental Tables S1 and S2 prioritizes average F1-scores when provided by original studies, which may differ from individual scores reported here. In their results, Jaccard ranged from 0.43 to 0.62, ROUGE from 0.27 to 0.75, and entity-level F1 from 33% to 41% when compared with a board-certified oncologist. 48 Another study even used a novel approach with BERTScore to measure lexical similarity, reporting F1-scores from 64.7% to 89.74%. 72 Two additional studies compared relaxed versus exact approaches, where relaxed matching permits partial overlap between predicted and reference spans and treats partial matches as correct. In one of the studies, relaxed F1-scores ranged from 67.6% to 90.1% and exact match F1-scores ranged from 47.4% to 78.5%. 30 In the other, relaxed F1-scores ranged from 63.7% to 85.4% and exact match F1-scores from 63.6% to 83.1%. 10
At the other end of the spectrum, other studies took exact match to another level by applying it strictly to whole documents. For instance, in one study extracting 42 descriptors from pathology reports, an extraction was only considered correct if all 42 items were correct per morphology group, resulting in exact match rates from 19.57% (Mistral-7B) to 92.24% (Deductive Mistral-7B). 14 Similarly, in the VetTag study, while the per-prediction F1-score was 48.6%–66.2%, the fraction of notes where predicted diagnoses exactly matched the expert diagnoses was only 9.2%–26.2%. 79
Regarding metrics across these varied evaluation approaches, most studies relied on a common set of metrics as summarized in the “Introduction” section. Model outputs could be mapped to standard error categories: correct extraction (true positive), incorrect extraction (false positive, often termed “hallucination” in LLM settings), and missed extraction (false negative). True negatives are only well defined when the label schema explicitly specifies absence (eg, “no” in binary classification or “not mentioned”). The majority of the studies emphasized performance on positive or specific target classes and reported precision and recall, which do not include true negatives.
Beyond metrics, performance is also influenced by the quality of the input text. Ambiguity and inconsistencies commonly produce errors that even human reviewers find difficult to resolve.27,50 This issue was similarly noted in a veterinary study, 76 suggesting that the inherent complexity of EHRs challenges both human assessment and model evaluation.
Finally, the impact of the “temperature” setting in LLMs has been investigated in both fields. Temperature is a parameter controlling randomness in the content generation of LLMs. Jiang et al 34 fixed the setting at 0 to ensure reproducibility. Wulcan et al 76 varied temperature from 0 to 1 and found no significant effect on classification performance, but a temperature of 0 yielded the highest reproducibility and the best compliance with citation instructions. Lower temperatures (eg, 0) were also generally preferred in human medicine to ensure deterministic outputs.28,75 However, a contrasting finding showed that higher values (eg, 0.7) can improve outcomes in tasks requiring inference when explicit answers are absent from the source text. 38
Prompt Engineering
To facilitate the adoption of LLMs for automated data extraction, links to the original prompts from studies in both veterinary and human medicine are provided in Supplemental Material S3. The foundational structure of these prompts typically begins with a task definition, which may be supplemented with input-output examples for zero-, one-, or few-shot learning. The strategy of few-shot prompting was shown to be effective across both domains. In the veterinary field, Hur et al 33 conducted a direct comparison using GPT-4. The accuracy for dose extraction fell from 85% under a few-shot setting to just 24% in a zero-shot setting. In human medicine, few-shot prompts showed similar benefits. In one study, adding examples to GPT improved the microaverage F1-score from 69.9% (no example) to 82.3% with 3-shot prompting. 26 Another study directly compared prompting strategies and found that few-shot yielded a 19% increase in the F1-score and a 17% increase in accuracy over zero-shot. 72 Similarly, a study reported that performance improved as the number of examples increased, with the relaxed-match F1-score for GPT-3.5 on the Vaccine Adverse Event Reporting System data set rising from 43.1% (zero-shot) to 67.6% at its maximum tested 5-shot setting. 30
Apart from example-based prompting, studies in human medicine explored more versatile strategies. Role-playing was occasionally employed to increase the contextual relevance of responses,4,10,14,64,77 and chain-of-thought prompting, which asks the model to generate intermediate reasoning steps, was used to frame outputs by creating self-checkpoints.31,50 Furthermore, as noted in the above, the variable formatting of generative outputs is a challenge for standardized evaluation and consistent extraction. To address this, some studies imposed explicit output constraints, such as fixed templates,29,78 binary yes/no answers, 58 or multiple-choice formats, 77 to improve consistency. The significant impact of structured prompt design was illustrated by Arsenyan et al. 3 They compared a basic prompt against more advanced versions. Their “instruction prompt” employed role-playing (“act as a medical extractor”), while a “guided prompt” enforced strict output constraints, such as a fixed format and a default “I do not know” answer. This evolution from a basic to a guided prompt improved the precision for treatment extraction from 43% to 98%. 3 A similar effort was seen in Fu et al’s 26 study, which focused on extracting social determinants of health from pediatric clinical notes. They compared a single-step approach (extracting all event components at once) against a 2-step question-answering pipeline. They found that GPT-4’s 2-step question-answering prompt slightly improved trigger extraction F1-score from 69.9% to 71.3%. 26
A significant focus was also directed toward reducing hallucination and improving traceability. In human medicine, for example, Huang et al 31 proposed requiring models to provide supporting evidence and indicate confidence levels. Hu et al 30 suggested incorporating error examples identified during iterative prompt refinement to reduce repeated mistakes, while Zhang et al 78 recommended initiating a new conversation for each record to avoid contextual contamination. In a similar effort from the veterinary domain, Wulcan et al 76 enhanced traceability by adding a secondary citation task to the primary goal of classifying clinical signs, ensuring the model’s outputs could be linked back to the source text.
Beyond the prompt content, prompt development is another critical but often underreported aspect. In contrast to the well-defined training and testing phases of supervised ML, many of the reviewed studies did not specify how many records were used to develop or iteratively refine their prompts. Among those that did, the development sets were typically small, ranging from 10 to 78 records, representing 1%–10% of total records.4,31,64
Discussion
This article reviewed 54 studies to address the research questions of how AI tools are used to facilitate automated clinical data extraction from unstructured EHRs in veterinary and human medicine. In these studies, we observed the challenges of the lack of veterinary databases for benchmarking, concerns for patient privacy, and variable performance metrics. Meanwhile, recent works indicate a shift from encoder-based models to generative LLMs, making prompt engineering an essential skill.
In veterinary medicine, 3 main data sets (SAVSNET, VetCompass, and the Colorado State University data sets) have been reused in multiple studies by both the same and different research groups. However, most original publications provide data only for reproducibility, with SAVSNET being the exception available to the broader research community. As of the search date for this review (June 3, 2025), there was no established veterinary NLP benchmark data set. Later in August 2025, PetEVAL was introduced as the first veterinary benchmark. 22 It comprises 17,600 veterinary EHRs that utilize SAVSNET and are annotated with ICD labels, disease tags, and anonymization-related tags. 22 On the contrary, the human medicine domain benefits from a large repository of publicly available benchmarks. Data sets like MIMIC, i2b2, MTSamples, VAERS, and TCGA provide a wide variety of specialties (eg, pathology, nephrology, and cardiology) and clinical settings (eg, intensive care and adverse event reporting). Despite these differences, a common practice in both fields is the predominant use of private data sets unique to the researchers’ institutions, consistent with findings from Spasic and Nenadic’s 63 review, which found that only 25 of 110 included studies used multiple data sources. For supervised, pretrained language models (eg, PetBERT, VetBERT, and VetTag), performance is sensitive to the training data, which can lead to degradation when validated on external unseen data sets. 63 Therefore, the development of more benchmarks is essential for advancing veterinary clinical NLP.
Another challenge for both domains is the protection of data privacy. Most of the included studies achieved this through data deidentification, which is a crucial yet high-cost process. This procedure can be automated using NLP, where it is treated as a specialized NER task. Kovačević et al 37 summarized the predominant approaches, including rule-based systems; traditional ML, DL, and transformer-based architectures; or integrated hybrid systems. This range of options is consistent with those commonly applied in the broader field of IE. Thus, IE can serve as both a preprocessing step for deidentification and a subsequent component for clinical IE. Consequently, errors in the deidentification stage can both degrade downstream extraction performance and threaten patient privacy by potentially exposing protected information.
Evaluating the performance of these competing model architectures requires a set of quantitative metrics, most commonly F1-score, accuracy, precision, and recall, though a few studies also explored semantic similarity measures like ROUGE or BERTScore. Similarly, the review by Vithanage et al 73 echoes our finding that precision, recall, and F1-score are the most common evaluation metrics. The choice of metric is critical, particularly when class imbalance is present (eg, an imbalanced distribution of cases with different diagnostic results). While accuracy is intuitive and commonly reported, it can be misleading. As one study noted, a high accuracy of 94% can be impressive, but it may be inflated by a large number of true negatives, failing to reflect the model’s ability to identify positive cases. 28 The evaluation approach also depends on whether the data are categorical (a finite list of labels) or noncategorical (open-ended). This observation is consistent with other reviews. In MedHELM, they proposed a holistic evaluation framework that links medical task categories to corresponding metric choice, recommending exact-match accuracy for single-token or numeric outputs, micro-F1 for multi-label classification (eg, ICD-10), and LLM-judge for open-ended generation with ROUGE and BERTScore used as secondary overlap-based measures. 5 In Spaanderman et al’s 62 work that contains 6 types of pathology and radiology reports, they used balanced accuracy for categorical variables (eg, tumor presence), accuracy for numeric variables (eg, measurements), cosine similarity for free-text fields (eg, disease type), and symmetric cosine similarity for list-type variables (eg, symptoms). Collectively, these studies share a consensus that evaluation metrics should be selected based on the structural properties of the data being extracted.
To efficiently extract clinical data, multiple model families have been deployed to tackle such a task (Table 2). Veterinary medicine has evolved from statistical models toward transformer-based architectures, with a notable acceleration toward generative models beginning in 2024 (Supplemental Table S1).24,33,34,76 Whereas the human medicine literature, which was shaped by stringent LLM-focused inclusion criteria, reflects a broader and earlier exploration of generative models like the GPT series, LLaMa, and Mistral, most of these human medicine studies also included encoder-based models such as BERT variants for comparison (Supplemental Table S2).
Encoder-based transformers (eg, BERT variants) remain particularly strong for IE tasks such as NER. 52 In contrast, decoder-only models are designed for text generation and treat IE as a generation task. Among studies that compared both architectures, encoder-based models outperformed generative models in 8 studies,20,26,30,33,36,38,51,77 compared with only 4 where generative approaches were superior (Supplemental Tables S1 and S2).1,28,31,34 Notably, the PetEVAL benchmark comparing PetBERT and LLaMA-3.1-8B for ICD coding found that PetBERT achieved a higher weighted average F1-score of 69% compared with LLaMA’s 54%. 22
The shift toward generative models is driven less by architectural fit and more by practical accessibility. Deploying BERT-based models requires domain-specific fine-tuning, labeled data sets, and substantial computational resources, while generative LLMs have chatbot interfaces and API services, making them user-friendly. Furthermore, as demonstrated by Zhou et al’s 82 review, widespread industry investment is driving a rapid scaling of model parameters, from the hundreds of millions in BERT-like models to the tens or hundreds of billions in GPT and PaLM-like architectures. This dynamic means that while smaller, specialized models may offer targeted efficiency, the field is currently dominated by the development of larger, general-purpose generative models. 82
This progression toward generative models is evident in other recent literatures. A review of radiology reports covering 34 studies published between 2018 and 2023 included only BERT-based models, which the authors attributed to their search cut-off date and exclusion of certain repositories like ACL Anthology. 52 Subsequently, other reviews start to capture the beginning of a shift toward generative models. A comprehensive review of clinical IE spanning 2019 to 2023 noted that decoder-only and encoder-decoder models were present in 9.41% of included works (n = 85). 53 This transition became more pronounced in a slightly later scoping review in oncology (2019–2024). While BERT variants still dominated at 75% (n = 18), generative LLMs had grown to represent 25% (n = 6) of the 24 studies. 12 This chronological pattern suggests the growing popularity of generative LLMs in clinical IE, despite their mixed performance advantages.
Finally, prompt engineering is a critical area of focus in this review. A debate on the optimal number of annotated examples remains an open question. Unlike traditional model training, which typically uses the entire data set split into training and validation subsets, prompt engineering often operates on a different principle. As noted by Spaanderman et al, 62 using a small set of high-quality reference annotations reviewed by multiple experts is often sufficient to identify well-performing configurations, especially when experimenting with various prompting strategies on small-to-medium-sized LLMs. Given that manually crafting effective prompts can be time-intensive and require expertise, meta-prompting has been proposed. 80 This approach uses a higher-level prompt to automate the generation of downstream, task-specific base prompts, thereby reducing the manual effort of prompt engineering. 40
Practical Guidelines for Generative Large Language Models in Clinical Information Extraction
To turn findings in this review into actions, and inspired by the structured approach of Tam et al, 66 we propose comprehensive guidelines for adopting LLMs in clinical settings for IE tasks, which include 3 phases: (1) planning phase, (2) adjudication and refinement phase, and (3) testing phase.
Planning phase
Define task objectives: Specify the exact information to be extracted, and whether outputs are categorical (closed label set) or noncategorical (free text or numerical values).
Prepare and characterize data: ○ Input data: Clinical data may exist as PDFs, text files, or structured tables. Text-based formats are recommended to ensure consistent processing, as file conversion (eg, from PDF) can introduce structural artifacts and reduce readability for LLMs. ○ Output schema: Define the desired output structure based on downstream needs. Specify required units (eg, kg) and formatting conventions (eg, standardized date formats) to ensure the extracted data is usable.
Select model and deployment strategy: Choose an approach that balances convenience, security, and required resources. ○ Web interfaces or API calls (eg, ChatGPT and Gemini) offer the most convenient access but pose the greatest data privacy risks, as data may be logged by service providers. Strict anonymization or informed consent is required prior to uploading sensitive data. A list of free LLM inference resources accessible via API maintained by the community: https://github.com/cheahjs/free-llm-api-resources. ○ Health Insurance Portability and Accountability Act (HIPAA)-compliant platforms: Commercial cloud platforms (eg, Azure OpenAI, Amazon Web Services, and Google Cloud) and enterprise-level services (eg, ChatGPT and Gemini) offer access to LLMs (such as GPT-4) that may be used in a HIPAA-compliant manner with appropriate security settings and a signed Business Associate Agreement. ○ Local deployment of open-source models (eg, LLaMA, GPT-2, Phi, and Qwen): Typically available through GitHub or Hugging Face. This is the most secure option, as data remains within local machines, but requires more technical effort and hardware resources. A list of open-source LLMs available for local deployment maintained by the community: https://github.com/eugeneyan/open-llms.
Predefine the evaluation plan: ○ Choice of metrics: • Categorical data: When dealing with imbalanced data sets, avoid relying solely on accuracy. Prioritize metrics like precision, recall, and F1-score. • Noncategorical data: Numerical values (eg, tumor size) can be evaluated by accuracy. For short textual values (eg, breed and drug name), exact string matching is often sufficient. For longer or more descriptive text, automated metrics such as ROUGE or BERTScore can capture semantic similarity, or an LLM-as-a-judge approach and human evaluation can be applied. ○ Target performance thresholds aligned with downstream risk tolerance (eg, minimum acceptable recall for safety-critical screening). If thresholds are not available, justify empirically chosen criteria based on prior literature, pilot experiments, and domain expert input (eg, aiming for ≥0.80 on the primary metric).
Ground truth establishment: ○ Annotator recruitment: Recruit at least 2 domain experts to annotate a subset of the data. Disagreements should be resolved through consensus discussion or adjudication by a third, senior expert. ○ Guideline development: Create detailed annotation guidelines with clear definitions and examples. Provide training to all annotators to ensure high interannotator agreement and consistent label application.
Prompt engineering: ○ Sample size: Based on the practices observed in the literature, a minimum of 10 cases is a common starting point, but we recommend allocating up to 10% of the data set if time and resources permit to ensure robust prompt design and testing. ○ Prompt component: Construct prompts with standardized components to maximize performance and reliability. We recommend including: Task definition: Specify the exact information to extract, including the number of items expected, whether each item should be restricted to predefined options or keywords. Standardize outputs such as converting units (eg, lb to kg) or aligning scoring systems (eg, 5- or 9-point body condition score). Shot setting: We recommend using a minimum of one example (one-shot) for each item to be extracted. The number of examples should be adjusted based on task complexity (eg, inferring tumor staging or drug dosage) and the model’s context window limitations. Role-playing: Frame the model as an expert (eg, “You are a clinical pathologist . . .”) to improve the contextual relevance of its responses. Output format: JSON is the most widely used output format, though formats such as HTML, Excel, or CSV may also be appropriate depending on downstream needs. Hallucination reduction: Instruct the model to cite supporting evidence from the source text or use chain-of-thought reasoning to expose its logic and improve reliability. Guideline adherence: When applicable, instruct the model to follow established clinical guidelines (eg, World Health Organization tumor classifications) for domain-specific inference. Query input: Clearly delineate the prompt instructions from the input text or file to be analyzed (eg, “refer to filename.pdf”).
Adjudication and refinement phase
This phase functions as an iterative cycle to improve performance and increase reliability before scaling to a larger data set. First, evaluate model outputs using the planned metrics and a consistent review process, applying the piloted prompt to the predetermined development set. Next, conduct systematic error analysis to identify recurring failure modes, such as formatting noncompliance, hallucinated outputs, or missed extractions. Use these findings to revise assumptions or specifications set in the planning phase (eg, output schema, label definitions, or matching criteria). Based on the observed error patterns, refine the prompt and, when improvements plateau, consider alternative model choices or pipeline designs. Importantly, this phase also establishes a realistic performance baseline and supports the adjustment of target thresholds and expectations if the predefined objectives prove unachievable due to data quality or task complexity.
Testing phase
Apply the finalized model and prompt to the held-out test set to calculate final performance metrics. If a fully annotated test set is unavailable or infeasible to create, use statistical sampling techniques (eg, stratified sampling based on report type or diagnosis) to select a representative subset for manual annotation and evaluation. Finally, determine whether the model’s performance meets the predefined objectives, ensuring it is accurate and reliable enough for its intended application.
We herein demonstrated a use case by extracting 62 clinical variables from dogs with suspected pancreatitis, following the previously outlined guidelines (Fig. 5). A detailed embedded prompt example, which adheres to the standardized components proposed in the guidelines, is provided as an annotated example in Table 6.

Guidelines of the proposed information extraction framework and the corresponding applications in a canine pancreatitis study. API, application programming interface; HIPAA, Health Insurance Portability and Accountability Act; LLM, large language model.
An annotated example prompt used in a canine pancreatitis study.
Limitations
This review has several limitations. First, our search of the human medicine literature was restricted to studies of prompt-based LLMs and those that published their prompts, a criterion intended to facilitate adoption by veterinary researchers. Therefore, earlier rule-based or traditional ML tools, such as cTAKES 54 or CLAMP, 61 and many BERT-based models specifically developed for IE, were excluded. Although some included studies mentioned BERT variants as baselines, a substantial body of BERT-focused literature was not captured. Also, several studies did not provide full prompts and were excluded, which may have omitted otherwise valuable insights. Second, this review intentionally focused on prompt engineering and did not deeply explore alternative methods such as knowledge graphs, fine-tuning, or retrieval-augmented generation. While a full comparison is beyond our scope, an important direction for future work is to systematically evaluate the trade-offs among these approaches. In general, fine-tuning is the most computationally expensive, followed by retrieval-augmented generation, whereas in-context learning is typically the least resource-intensive, making it a highly accessible entry point for clinical data extraction. 2 Third, only English-language manuscripts and data sets were included, and some potentially relevant non-English studies may have been missed. Finally, given the rapid pace of progress in NLP for medicine, especially with veterinary AI applications emerging, newer articles may be published during manuscript preparation. Readers should consult the most recent literature for the latest advancements.
The proposed guidelines, while grounded in the synthesis of the included literature, may not be applicable in all settings. First, the guidelines emphasize prompt-based LLM workflows and may be less relevant for fine-tuned encoder models, rule-based systems, or hybrid pipelines. Second, several recommendations (eg, 10% of records for prompt development) may be infeasible for resource-limited teams and could introduce practical bottlenecks for large projects. Third, the guidelines do not recommend a single best evaluation strategy. Choices such as exact versus relaxed matching, variable-level versus case-level scoring, and acceptable performance thresholds remain task- and risk-dependent, which may limit comparability across implementations. Finally, because LLM performance is sensitive to model versions and deployment settings, periodic re-validation is likely necessary as models and clinical documentation evolve.
Conclusion
In conclusion, this scoping review synthesized recent AI applications, particularly LLMs, for clinical IE in both veterinary and human medicine. Across both fields, EHRs were the primary input to be extracted. Data set sizes range from only a handful of cases to millions, and LLM-based studies often required fewer annotated examples due to in-context learning. Sources included widely used open databases such as SAVSNET or MIMIC, as well as institution-specific collections. In veterinary medicine, models predominantly emphasized classification using traditional ML or BERT-based approaches, whereas in human medicine, the field has more extensively explored generative LLMs for IE.
To facilitate adoption by veterinary researchers, we propose practical and comprehensive guidelines for data preparation, secure model deployment, and prompt engineering. These guidelines aim to equip researchers with a structured, reproducible approach to use LLMs responsibly and effectively, ultimately accelerating the translation of unstructured clinical information into analyzable, structured data for downstream research.
Supplemental Material
sj-pdf-1-vet-10.1177_03009858261461761 – Supplemental material for Applying artificial intelligence to automate clinical data extraction from veterinary electronic health records: A practical guidance and comparative scoping review
Supplemental material, sj-pdf-1-vet-10.1177_03009858261461761 for Applying artificial intelligence to automate clinical data extraction from veterinary electronic health records: A practical guidance and comparative scoping review by Yumi Chang and Candice P. Chu in Veterinary Pathology
Footnotes
Acknowledgements
Grammarly Desktop (version 1.155.0.0), Gemini 2.5 Pro, GPT-4o, and GPT-5 were used to assist with grammar checking and basic editing of the manuscript. All content was reviewed and verified by the authors. We thank Dr Yasha Hartberg for his helpful suggestions regarding the manuscript structure. We also extend our special thanks to Sanjida Akter and Dr Barbara Gastel for their assistance with editing.
Supplemental material for this article is available online.
Author Contributions
YC and CPC designed the study; YC performed the literature search; YC and CPC performed an independent review; the manuscript was written by YC and CPC.
Declaration of Conflicting Interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
