Beginner level · Module 4: Tokenization and Text Normalization · Lesson 2 of 3
Stop Words, Stemming and Lemmatisation
Learners reduce vocabulary with stop-word removal and lemmatisation, and see when these steps help a classifier and when they remove meaning.
In this lesson you will
- Remove stop words and lemmatise tokens
- Judge when normalisation helps or harms
Key concepts
stop wordsstemminglemmatisationtoken.lemma_vocabulary size
The lesson
Stop words are very common words (the, is, to) that carry little topic information. Removing them shrinks the vocabulary. But 'not' is often on stop-word lists, and removing it turns 'not paid' into 'paid', which reverses the meaning for complaints.
Stemming chops word endings with rules ('payments' → 'payment', but also 'university' → 'univers'). Lemmatisation uses a dictionary and grammar to find the base form ('paid' → 'pay', 'children' → 'child'). spaCy provides token.lemma_ for English.
Measure the effect: count the vocabulary before and after, and later compare classifier accuracy with and without each step. Keep the step only if it helps the task.
Step by step
- Remove spaCy's stop words from 20 messages and print the result.
- Remove 'not' and 'no' from the stop list and compare.
- Lemmatise the tokens and print before/after pairs.
- Record the vocabulary size at each stage.
Practice activity
Produce a normalisation comparison table for the project data: vocabulary size and three example messages at each stage.
Expected result: A table that shows the vocabulary shrinking and identifies any meaning lost.
Check your understanding
-
Why can removing stop words harm complaint analysis?
Show answer
Words like 'not' are often stop words, and removing them can reverse meaning.
-
What is the difference between stemming and lemmatisation?
Show answer
Stemming cuts endings by rules; lemmatisation finds the dictionary base form.
Further learning
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.