Reading aphasia severity out of a stroke note

The NIHSS language item compresses every way a person can lose language into a 0–3 score, and most hospital records never carry it. The same encounter does leave several hundred words of narrative. Type or edit a note below and watch the model score it, with the phrases that drove each decision highlighted.

Admission note

Synthetic text. These examples were written for this demo in clinical register. They are not real notes and contain no patient information.

What the model actually reads

…in context

Click any highlighted phrase to knock it out of the model's input and watch the prediction move.
toward no aphasia toward mild–moderate toward severe  ·  stronger shading = larger weight

Predicted NIHSS-9 (best language)

What counts as a feature

The number on each chip above is that phrase's length. Longer n-grams carry the negation that single words lose: dysarthria alone says nothing about direction, while without dysarthria and speech without dysarthria point the opposite way from speech with dysarthria.

Why "intact" and not "comprehension intact"

Because the second phrase barely exists in these notes. Across the 1,227 admission notes, intact appears in 86%, but the word before it is almost always sensation (704), grossly (663), fields (590) or movements (176) — not a language term. comprehension appears in 4% of notes, naming and repetition in 2%, and when comprehension is described it reads "comprehension was intact", so the two words are never adjacent for a bigram to catch. The words aphasia and aphasic are deleted from every note before training, because a note saying "global aphasia" is simply restating the label.

So the model is not reading the language exam — it mostly cannot, because the language exam is rarely written down. It is reading the general neurological exam, where thoroughness and normality covary with language status. That is the finding, not a limitation of the highlighting.

How this works

One L2-regularised logistic regression per severity level, over TF-IDF n-grams of one to three words, trained on 1,227 admission notes from 1,173 acute-stroke patients and validated with patient-grouped 5-fold cross-validation (ROC-AUC 0.80 / 0.75 / 0.86). Templated NIHSS scoring grids were stripped from the notes first, so the model reads narrative only. A length-only baseline sits near chance at 0.55 / 0.52 / 0.54.