Text normalisation
“The TAP is broken!!!” and “the tap is broken” — to a computer, these share almost nothing. Until you clean them.
- Take text through all the steps of normalisation
- Clean real suggestion slips in Python
- Tell stemming from lemmatisation
Text normalisation
“The TAP is broken!!!” and “the tap is broken” — to a computer, these share almost nothing. Until you clean them.
- Take text through all the steps of normalisation
- Clean real suggestion slips in Python
- Tell stemming from lemmatisation
Story
Learn it
To a computer, "The TAP is broken!!!" and "tap broken" share almost nothing: different capitals, different punctuation, and lots of tiny words like the. Before a machine can count or compare text, it must be normalised: cleaned down to a simpler, shared form. CBSE sets this out as a chain of steps, from splitting the text up to cutting each word to its root.
Words to know
the whole collection of text you are working with, like all the suggestion slips.
cleaning text into a simpler form a machine can count and compare.
splitting the corpus into sentences.
splitting each sentence into tokens: every word, number and symbol is one token.
very common words that carry little meaning: the, a, is, of, to, and.
usually lowercase, so Tap, TAP and tap become one word.
chopping endings off fast, even if the result is not a real word: studies → studi.
reducing a word to its real dictionary form, the lemma: studies → study. Slower, but always a real word.
Step by step: normalising one slip
"The light in Room 4 is NOT working. Lights flicker!"
- Sentence segmentation: "The light in Room 4 is NOT working." · "Lights flicker!"
- Tokenisation: The · light · in · Room · 4 · is · NOT · working · . · Lights · flicker · !
- Remove stop words, symbols and numbers: light · Room · NOT · working · Lights · flicker. (Keep 4? It tells us which room, so this job might need it.)
- Common case: light · room · not · working · lights · flicker
- Lemmatisation: light · room · not · work · light · flicker. Now light appears twice: the real complaint shows.
Stem or lemma? running → run both ways; better → better (stem) but good (lemma); children → children (stem) but child (lemma).
Careful: stop words are not wrong words. They are the commonest words, and for counting topics they add noise. And tokens are not always words: numbers and symbols are tokens too, until you choose to remove them.
Your missions
programs/normalise.py · datasets/suggestions.txtBy hand
8 minin pairs- 1
Take this slip: "The tap near the ground is broken. Please fix the tap."
- 2
Do each step on paper, one line per step: sentences → tokens → without stop words and full stops → lowercase. How many tokens are left at the end?
Let Python do it
10 min- 3
Copy
normalise.pynext tosuggestions.txtand open it in Thonny. Find the line that makes the text lowercase, the line that splits it into tokens, and the line that drops stop words. - 4
Predict: what will it print for the third slip? Compare with your paper answer.
Only you can see this - 5
Run it. Were you right?
- 6
Change it: add
"break"to the stop words. Predict, run, and decide: was that a good idea?
Stem or lemma?
5 min- 7
For each word, write its stem and its lemma: studies, running, better, flies, happily, children. Where do they differ?
Add a line that removes a final s from every token, as a crude stemmer. Run
it. Which words does it help — and which does it wreck?
No laptop today?
Everyone gets one slip on paper and normalises it by hand, step by step, then reads out their final tokens. The class writes the shared tokens on the board and tallies them — the counting that Lesson 5.4 does in Python.
Debate it
A stop-word list is a choice somebody makes. For some jobs, removing "not" would reverse the meaning of a sentence.
- Find a sentence where removing a "stop word" changes its meaning completely.
- Who should choose the stop words for a system that reads complaints from the public?
Check yourself · practice, not a test
In the app, students answer these one at a time and each answer is checked straight away. It's practice, never a mark — anything they miss comes back later for another go.
1.Put CBSE's steps of text normalisation in order:
- 1Tokenisation
- 2Converting to a common case
- 3Removing stop words, special characters and numbers
- 4Sentence segmentation
- 5Stemming or lemmatisation
2.Which of these is most likely a stop word?
- Atap
- Bbroken
- Cthe
- Dlibrary
3.The whole collection of text being processed is called the ______.
4.Match each word to what it becomes:
- studies by stemming
- studies by lemmatisation
- study
- studi
5.Lemmatisation always produces a real word, but it takes longer than stemming.
TrueFalse
Clean the text before you count it — or you'll count "the".
Typing practice
Skill: a list of short words (5 min)
-
On typing.com: the symbols lessons.
-
Type three times, eyes on the screen:
stop_words = ["the", "a", "is", "of", "to", "and"] -
Goal this term: 38–44 WPM at 95%.
Written and designed by Faizan Ayoub. © 2026 Faizan Ayoub. All rights reserved.