Back

Automated epilepsy and seizure type phenotyping with pre-trained language models

Chang, E.; Xie, K.; Zhou, D.; Korzun, J.; Conrad, E.; Roth, D.; Ellis, C.; Litt, B.

2026-02-22 neurology
10.64898/2026.02.11.26346003 medRxiv
Show abstract

BackgroundEpilepsy is a common neurologic disorder characterized by recurrent, unprovoked seizures. Epilepsy manifests as different seizure types and epilepsy types, which have important implications for treatment and prognosis. Electronic health record systems containing longitudinal data on large epilepsy cohorts can be valuable resources for clinical research. However, detailed epilepsy phenotypes are poorly captured by structured data such as diagnostic codes and are instead buried in unstructured clinical notes. MethodsWe evaluated two transformer-based language models for automated epilepsy and seizure type phenotyping from clinical notes: a fine-tuned BERT model and a large language model, DeepSeek-R1. A subset of notes was annotated by epileptologists, and model performance was benchmarked against expert agreement. The best-performing model was then deployed across all epilepsy progress notes at a large academic medical center to generate patient-level longitudinal epilepsy and seizure phenotypes. ResultsBoth models achieved performance comparable to expert agreement for classifying epilepsy type as focal, generalized, or unspecified (Matthews correlation coefficient [95% CI]: DeepSeek = 0.85 [0.80-0.90], BERT = 0.73 [0.67-0.80], human = 0.77 [0.70-0.83]) and classifying seizure type as convulsive or non-convulsive (DeepSeek = 0.74 [0.66-0.81], BERT = 0.60 [0.49-0.69], human = 0.49 [0.39-0.59]). For more granular classification tasks, DeepSeek maintained performance comparable to expert agreement, whereas BERT performance declined. Deploying DeepSeek-R1 on 77,049 clinical notes from 18,566 patients revealed system-level clinical patterns, including diagnostic stabilization over time, frequent co-occurrence of seizure types, and variation in seizure outcomes by epilepsy type. ConclusionsBy extracting expert-level epilepsy phenotypes from routine clinical text at scale, this approach transforms unstructured EHR data into a resource for longitudinal, population-informed epilepsy care. Automated phenotyping enables analyses of epilepsy trajectories and treatment outcomes that are not feasible with structured data alone, supporting future clinical and translational research applications.

Matching journals

The top 4 journals account for 50% of the predicted probability mass.

1
Epilepsia
49 papers in training set
Top 0.1%
28.3%
2
Journal of the American Medical Informatics Association
61 papers in training set
Top 0.2%
12.6%
3
Epilepsia Open
14 papers in training set
Top 0.1%
6.5%
4
Annals of Neurology
57 papers in training set
Top 0.2%
6.5%
50% of probability mass above
5
npj Digital Medicine
97 papers in training set
Top 1%
4.1%
6
Annals of Clinical and Translational Neurology
29 papers in training set
Top 0.2%
3.7%
7
Med
38 papers in training set
Top 0.1%
3.7%
8
Scientific Reports
3102 papers in training set
Top 43%
2.8%
9
Brain
154 papers in training set
Top 2%
2.1%
10
The Lancet Digital Health
25 papers in training set
Top 0.3%
1.9%
11
Epilepsy Research
12 papers in training set
Top 0.2%
1.7%
12
Epilepsy & Behavior
12 papers in training set
Top 0.2%
1.4%
13
Nature Medicine
117 papers in training set
Top 3%
1.4%
14
Genome Medicine
154 papers in training set
Top 6%
1.3%
15
Nature Communications
4913 papers in training set
Top 56%
1.3%
16
Neurology
44 papers in training set
Top 1%
1.1%
17
Brain Communications
147 papers in training set
Top 2%
1.0%
18
PLOS ONE
4510 papers in training set
Top 63%
0.9%
19
npj Parkinson's Disease
89 papers in training set
Top 0.9%
0.9%
20
Journal of Neurology, Neurosurgery & Psychiatry
29 papers in training set
Top 1%
0.9%
21
BMC Medicine
163 papers in training set
Top 6%
0.8%
22
Communications Medicine
85 papers in training set
Top 1%
0.8%
23
eBioMedicine
130 papers in training set
Top 4%
0.7%
24
Science Translational Medicine
111 papers in training set
Top 7%
0.7%
25
Journal of Medical Internet Research
85 papers in training set
Top 5%
0.7%
26
Neurology Genetics
14 papers in training set
Top 0.4%
0.5%
27
Proceedings of the National Academy of Sciences
2130 papers in training set
Top 48%
0.5%