The Five Stages of NLP
A sentence is checked five times on its way to being understood. The useful way to learn them is not by their definitions but by what each one throws out.
1The five stages
A sentence is checked five times on its way to being understood, and each stage throws out a different kind of nonsense.
Identifying the structure of the input words — dividing a large chunk of words into paragraphs, sentences and words.
A lexicon is the collection of words and phrases a language uses. This stage splits the text up into them.
The order is fixed and it is asked about: Lexical is always the first stage, and Pragmatic is always the last.
2What each stage rejects
| # | Stage | It throws out |
|---|---|---|
| 1 | Lexical Analysis | Nothing yet — it breaks the text into paragraphs, sentences and words |
| 2 | Syntactic Analysis | Sentences whose grammar is wrong |
| 3 | Semantic Analysis | Sentences that are grammatical but meaningless — “hot ice cream” |
| 4 | Discourse Integration | Sentences that do not connect to the ones around them |
| 5 | Pragmatic Analysis | The literal meaning, in favour of the intended one |
Five teachers marking the same essay
3Why pragmatic analysis is last
Pragmatic means practical or logical. This stage needs knowledge of the intent in a sentence, and it discards the literal meaning that semantic analysis arrived at in favour of the intended one.
4From the board papers
(a) Semantic Analysis (b) Pragmatic Analysis (c) Lexical Analysis (d) Syntactic AnalysisClass X handbook, Quiz Time
▶Show the answer
(c) Lexical Analysis. Nothing can be checked until the text has been broken into words, so this is always first.
(a) Identifying individual words (b) Forming a coherent story within a sentence (c) Establishing relationships between preceding and succeeding sentences (d) Applying punctuation and grammar rulesClass X handbook, Quiz Time
▶Show the answer
(c) Establishing relationships between preceding and succeeding sentences. Note how close (b) is — it says within a sentence, and discourse integration is about the sentences around it.
▶Show the answer
Semantic Analysis. Meaning is semantics. Grammar would be syntactic analysis.
5Check yourself
Which stage checks the grammar of a sentence?
Which stage would reject the phrase 'hot ice cream'?
What is a lexicon?
Which stage is concerned with the intended meaning rather than the literal one?