Beginner level · Module 1: Introduction to Natural Language Processing · Lesson 2 of 3
The NLP Pipeline
A walk through the stages most NLP systems share (collecting text, cleaning, tokenising, representing, modelling and evaluating), using an SMS enquiry system as the running example.
In this lesson you will
- Name the stages of an NLP pipeline in order
- Explain why each stage matters for the final result
Key concepts
pipelinepreprocessingrepresentation (features)modelevaluation
The lesson
An NLP system is usually a pipeline: collect the text; clean it (remove noise, mask private details); split it into tokens; turn the tokens into numbers the computer can work with; apply a model or rules; and evaluate the output against examples labelled by people.
Each stage affects the next. If phone numbers are not masked, a model may learn that messages with numbers are spam. If the tokeniser splits 'Wau-based' badly, word counts are wrong. Most real problems in NLP projects come from data and preprocessing, not from the model.
Evaluation closes the loop. Without a test set of messages that people have labelled, there is no way to know whether the pipeline works, or for which kinds of messages it fails.
Step by step
- Draw the six pipeline stages as boxes.
- Under each, write what happens to one example SMS.
- Mark one thing that could go wrong at each stage.
- Mark where a person checks the result.
Practice activity
Draw a labelled pipeline diagram for a college's SMS enquiry system, with one risk per stage.
Expected result: A clear six-stage diagram that follows one message through the pipeline and names a realistic risk at each stage.
Check your understanding
-
Why does the pipeline need a labelled test set?
Show answer
To measure whether the outputs are correct and where the system fails.
-
Give one way preprocessing can mislead a model.
Show answer
For example, unmasked phone numbers can become a false signal for spam.
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.