Skip to content
Open access

Large-Scale Psychiatric Concept Extraction from Electronic Health Records: A Comparative Study of Encoder-Based Language Models

Aug 2026 · medRxiv · 1 citation
Medicine

TL;DR

General-purpose pre-trained encoders had strong performance for psychiatric concept extraction from Spanish EHRs, and the utility of these relatively lightweight models for scalable, accurate and reproducible detection of psychiatric concepts in Spanish-language EHRs is highlighted.

Abstract

Background: Free-text notes in electronic health records (EHRs) contain fine-grained psychiatric information that is essential for psychiatric research and clinical care, and often absent or under-recorded in structured codes alone. Clinical natural language processing (cNLP) can support extraction of this information from EHR notes, yet Spanish-language cNLP remains under-developed. Moreover, broad evaluations comparing multiple encoder-based language models across extensive, fine-grained psychiatric concept sets remain scarce, and it remains unclear how these models compare with traditional NLP (tNLP) systems and much larger generative large language models (LLMs). In addition, cross-site performance of fine-tuned models is rarely tested, and limited annotated training data remains a major challenge, especially for rare symptoms. Objectives: We aimed to advance scalable, global psychiatric cNLP by fine-tuning multiple encoder-based models with differing architectures and pre-training strategies for detecting fine-grained psychiatric concepts in Spanish EHRs. We further evaluated the impact of augmenting the fine-tuning data with precision-weighted weak labels for less-frequent concepts, and compared the performance of the encoder-based models to that of tNLP and a fine-tuned generative LLM trained on the same data. Finally, we evaluated model cross-site generalizability on an external EHR dataset. Methods: Three encoder-based models (BETO, XLM-RoBERTa-large, and bsc-bio-ehr-es) were fine-tuned on 1,642 clinician-annotated EHR documents from Colombia to detect 110 psychiatric concepts in Spanish text. To address the limited annotated examples available for less-frequent concepts, 12,000 additional documents were weakly-labeled for less-frequent concepts using tNLP, and incorporated into the fine-tuning data with labels weighted by pattern precision. Models were compared with tNLP and a generative LLM, and evaluated on an external EHR dataset from another psychiatric hospital in Colombia. Results: Encoder model performance varied substantially, with macro-F1 ranging from 0.64 to 0.81. BETO achieved the highest macro-F1 (0.81; median F1=0.88 [IQR=0.77-0.96]). Adding precision-weighted weak labels for less-frequent concepts improved BETO's overall macro-F1 to 0.83 and increased mean F1 for the 55 augmented concepts from 0.82 to 0.86. Under matched fine-tuning conditions, fine-tuned BETO and the tNLP method were equivalent in F1, whereas the LLM significantly outperformed BETO in F1. After weak-label augmentation, BETO significantly outperformed tNLP in F1 (PFDR<.001) and narrowed the performance gap with the LLM, although equivalence was not established. Lastly, fine-tuned BETO maintained reasonably strong performance on data from an external hospital not used for model fine-tuning (out-of-domain macro-F1=0.78). Conclusions: General-purpose pre-trained encoders had strong performance for psychiatric concept extraction from Spanish EHRs. Weak-label augmentation improved BETO's performance and strengthened results relative to a tNLP baseline, while reducing, but not eliminating, the performance gap with a much larger fine-tuned generative LLM. These findings highlight the utility of these relatively lightweight models for scalable, accurate and reproducible detection of psychiatric concepts in Spanish-language EHRs.

Read PDF

Similar papers

Open access Sep 2026

Extracting Symptoms of Psychotic Disorders from Clinical Notes using Natural Language Processing.

Evaluating 14 general-purpose LLMs for extracting eight symptoms of schizophrenia from clinical summaries in a severe mental illness cohort indicates that general-purpose LLMs may not be able to extract psychosis-related phenotypes from clinical summaries with the quality required for clinical use but might nevertheles...

S. Lock, J. Boisson, L. M. Evans et al. · 0 citations
Review Sep 2026

Uncoded Clinical Features from Multilingual Electronic Health Records in Catalonia: Development and Validation Study

A privacy-preserving local hybrid framework combining a compact open-weight SLM with regular expression rules achieves high specificity and precision for extracting six uncoded clinical features from multilingual primary care narratives.

D. Ouchi, S. Riudavets, Á. Franquet et al. · 0 citations
Open access Oct 2026

A Deep Learning system for Automated Quality Control of Medical Questionnaire data in Large-Scale Cohort Studies.

Recent advances in natural language processing combined with deep learning have transformed disease prediction, diagnosis, and treatment, yet their application in automated quality control of medical questionnaire data remains largely unexplored. Here, we present an end-to-end system tailored for large-scale cohort int...

Min-Min Cao, Ya-Nan Duan, D. Lang et al. · 0 citations
Review Open access Sep 2026

Modern generative large language models in epilepsy care: a scoping review of current applications, challenges, and future directions

Current evidence suggests a limited role for cautious, clinician-supervised use of generative LLMs in selected text-heavy epilepsy tasks, particularly extraction, summarization, documentation support, and patient education, but falls short of justifying independent or routine clinical deployment.

Shi-Hao Ge, Yue-Qian Sun, Qun Wang · 0 citations
Open access Oct 2026

Low-Resource Automatic ICD Coding for Chinese Electronic Medical Records: An Interpretable Multi-View Linear Framework with Audited Clinical Rules

ICD coding is the backbone of medical-record structuring, insurance payment, and clinical research. Today's best automatic coders are deep models, but they assume tens of thousands of labeled records, GPU servers, and machine-learning engineers. Many hospitals, especially small ones, have none of these. We study Chines...

Y. Xu, J. Yan · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.