Menu

NLP #1: What Is a Word?
📰

NLP #1: What Is a Word?

DEV Community: nlp·GradientGym·15 days ago
#C0gUqehR
#devtonlp#devto#dev#word#words
Reading 0:00
15s threshold

Originally published on almoghagbi.com , where the figures are interactive.

I'm taking an introductory natural language processing (NLP) course this

semester. This series is me learning it in public. My course follows

Speech and Language Processing

by Jurafsky & Martin: the 3rd edition draft (January 2026 version), which

is free online. The authors update the draft occasionally, so a newer version may

number its sections differently. Any version works if you want to follow

along.

This first post covers sections 2.1–2.2. Before a model can read text, someone has to decide what

a "word" is. That decision is the first step of every NLP system, from a

spam filter to ChatGPT.

Each post has three parts: Intuition (no math needed), The math

(definitions and key equations), and Exercises (to check yourself).

Intuition

Counting words is a choice

Take one sentence, our running example for the whole post:

The bakery's cinnamon rolls were so good, I bought more rolls for the road.

How many words?…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.