Researchnpj Digital Medicine · Aug 11, 2026

Automated epilepsy and seizure type phenotyping with transformer-based language models

Chang E, Xie K, Zhou DJ, Korzun J, Conrad EC, Roth D, et al
Digital Health & AINeurologyAdult
Read the full paper free at PubMed Central ↗

Abstract

Epilepsy is a common neurologic disorder characterized by recurrent, unprovoked seizures, and detailed phenotypes are essential for treatment selection, prognostication, and outcomes research. Although electronic health records provide rich longitudinal data, structured fields such as diagnostic codes fail to capture these phenotypes, which remain buried in free-text clinical notes. We developed and evaluated two transformer-based language models for automated epilepsy and seizure type phenotyping at an academic epilepsy center: a fine-tuned masked language model (BERT) and a reasoning-optimized large language model (DeepSeek-R1), benchmarked against pairwise inter-rater agreement among board-certified epileptologists. For coarser tasks, both models matched expert agreement: classifying epilepsy type as focal, generalized, or other (Matthews correlation coefficient: DeepSeek = 0.85, BERT = 0.73, human = 0.77) and seizure type as convulsive or non-convulsive (DeepSeek = 0.74, BERT = 0.60, human = 0.49). For more granular tasks, DeepSeek maintained expert-level performance, whereas BERT declined. Deploying DeepSeek-R1 on 77,049 notes from 18,566 patients yielded patient-level phenotypes consistent with expected clinical patterns, including diagnostic stabilization, seizure type co-occurrence, and outcome differences by epilepsy type. Transformer-based models can extract expert-level epilepsy phenotypes at health-system scale, demonstrating the feasibility of automated phenotyping for large-scale epilepsy research and, with prospective validation, for future clinical decision support.

More on this topic

Epilepsy and seizures

DOI: 10.1038/s41746-026-03103-5 · PubMed: 43086327

Headline, design, result, key points, caveat and citation as plain text.

Cite this article

Chang E, Xie K, Zhou DJ, et al. Automated epilepsy and seizure type phenotyping with transformer-based language models. NPJ Digit Med. 2026;9(1). doi:10.1038/s41746-026-03103-5

RIS (EndNote, Zotero, Mendeley)BibTeX

Spotted a mistake? Suggest a correction

Top Digital Health & AI studies every Monday

The week’s key trials and guidelines, free to read, in one short email. No account; unsubscribe in one click.

Choose specialties and topics

More in Digital Health & AI

Systematic review n = 29 · J Med Internet Res · Nov 26, 2026 · All ages · Digital Health & AI, Psychiatry & Mental Health

AI chatbots often give generic support but struggle to assess suicide risk

Research · J Med Internet Res · Nov 26, 2026 · Digital Health & AI, Infectious Disease

Integrating Multidimensional Clinical Data to Develop a Visual Nomogram for Individualized Prediction of Postinfectious Bone Loss in Patients With Spinal Infection: Retrospective Cohort Study

Meta-analysis n = 2,485 · J Med Internet Res · Nov 26, 2026 · Digital Health & AI, Oncology

AI models showed higher sensitivity than radiologists for detecting lymph node metastasis in esophageal cancer

Research · J Med Internet Res · Nov 26, 2026 · Digital Health & AI, Infectious Disease

Behavioral data from 6 European countries linked to SARS-CoV-2 vaccination dynamics

Research · BMC Palliat Care · Nov 26, 2026 · Palliative Care, Digital Health & AI

Emergency department entry linked to higher odds of death in palliative care episodes