Development of a natural language processing algorithm to extract seizure types and frequencies from the electronic health record

Seizure. 2022 Oct:101:48-51. doi: 10.1016/j.seizure.2022.07.010. Epub 2022 Jul 20.

Abstract

Objective: To develop a natural language processing (NLP) algorithm to abstract seizure types and frequencies from electronic health records (EHR).

Background: Seizure frequency measurement is an epilepsy quality metric. Yet, abstraction of seizure frequency from the EHR is laborious. We present an NLP algorithm to extract seizure data from unstructured text of clinic notes. Algorithm performance was assessed at two epilepsy centers.

Methods: We developed a rules-based NLP algorithm to recognize terms related to seizures and frequency within the text of an outpatient encounter. Algorithm output (e.g. number of seizures of a particular type within a time interval) was compared to seizure data manually annotated by two expert reviewers ("gold standard"). The algorithm was developed from 150 clinic notes from institution #1 (development set), then tested on a separate set of 219 notes from institution #1 (internal test set) with 248 unique seizure frequency elements. The algorithm was separately applied to 100 notes from institution #2 (external test set) with 124 unique seizure frequency elements. Algorithm performance was measured by recall (sensitivity), precision (positive predictive value), and F1 score (geometric mean of precision and recall).

Results: In the internal test set, the algorithm demonstrated 70% recall (173/248), 95% precision (173/182), and 0.82 F1 score compared to manual review. Algorithm performance in the external test set was lower with 22% recall (27/124), 73% precision (27/37), and 0.40 F1 score.

Conclusions: These results suggest NLP extraction of seizure types and frequencies is feasible, though not without challenges in generalizability for large-scale implementation.

Keywords: Automated extraction; Electronic health record; Epilepsy; Natural language processing; Seizure frequency.

MeSH terms

  • Algorithms
  • Electronic Health Records
  • Epilepsy* / drug therapy
  • Humans
  • Natural Language Processing*
  • Seizures