DEV Community

Divyakush Punjabi
Divyakush Punjabi

Posted on

The stop-word that quietly breaks every voice smart-home

Every NLP tutorial tells you to strip stop-words. Do that in a voice-controlled home and you just deleted the command.

Standard English stop-word lists throw away tiny, "meaningless" words — including on, off, and all. In ordinary text they're noise. In "turn on light two" they are the entire instruction. Filter them out and "turn on" and "turn off" collapse to the same tokens, so every light command becomes a coin flip.

Picture the fix from the outside: nobody would ever guess it. You'd stare at a system that transcribes speech perfectly and still toggles the wrong switch, because the bug isn't in the microphone or the model — it's in a default someone imported without reading.

The whole repair is one line: remove on, off, and all from the stop-word set before you filter. That's it. I leaned on this in HomeSense, a voice assistant that turns speech into physical actions — NLTK classifies the intent locally, then sends a single byte down a serial line to an Arduino.

The broader point: your libraries encode someone else's assumptions. When you know your domain better than the default does, override it — and the smallest override can be the thing the whole system depends on.


More of my projects and write-ups → www.divyakush.com

Top comments (0)