30% off every book in our site-wide sale. Shop the sale

The End-to-End Pipeline: Your Map for the Rest of the Book

The End-to-End Pipeline: Your Map for the Rest of the Book

TL;DR: You will be able to walk any NLP application through the four phases, Input, Processing, Understanding, Generation, and sketch the pipeline for a problem of your own.

This article is one Wisdom Nugget from What Is Natural Language Processing? by Trevor Stephenson.

Imagine you receive a handwritten note from a friend. It says: ‘Can’t make dinner tonight, stuck at work, raincheck tomorrow? Let me know!’ You read it, understand the situation, feel a little disappointment, and decide what to do next, maybe text back ‘No worries, tomorrow works!’ That whole process, from seeing ink on paper to taking action, happens in a second, without conscious effort. Now imagine a computer receiving the same note as a digital message. For the computer, it is not a note from a friend. It is a string of characters. To get from that string to a useful action, it needs to go through a journey. That journey is what we call the NLP pipeline.

By the end of this Nugget you will be able to walk the sentence ‘Book a table for two at 7pm tonight at L’Artusi’ through the whole pipeline, name the four phases and what each does, and explain how sentiment analysis, machine translation, and a voice assistant each adapt the same pipeline differently.

The core idea

The pipeline is not a single step, but a sequence of stages, each one transforming the text a little closer to something the machine can act on. Each stage builds on the previous one. In real-world systems, the pipeline is not always strictly linear: modern large language models can do many of these steps implicitly inside one large model. But conceptually, the same work still happens: cleaning, breaking into pieces, representing meaning, understanding intent and entities, maintaining context, and generating a response. Holding this journey overview in your mind is powerful. Whenever you encounter a new NLP application, sentiment analysis, translation, summarisation, you can ask: where does it start with raw text? What cleaning and tokenisation does it need? What understanding does it extract? What action or output does it produce? That simple set of questions turns a mysterious black box into a series of understandable steps. Chapter 4’s pipeline is your map for the rest of the book.

How it works

Section 1 (Figure 4.1) gives the journey overview with the restaurant booking example and the kitchen analogy. Section 2 (Figure 4.2) gives the four phases in detail: Input, Processing (normalisation, tokenisation, stemming and lemmatisation), Understanding (representation via embeddings, syntactic and semantic analysis, intent and context, sentiment analysis and classification), Generation (structured meaning to natural language, blurred by LLMs that do both in one system). Section 3 (Figure 4.3) gives the three adaptations: sentiment analysis emphasises understanding, translation emphasises generation, voice assistants add speech steps at both ends.

The tools

Tool 1: Walk the whole journey with one example. Raw text in: ‘Book a table for two at 7pm tonight at L’Artusi.’ First, make the text machine-readable: clean and normalise, lowercasing where appropriate, handling punctuation, recognising that ‘L’Artusi’ is a proper name with an apostrophe that should be kept together, not split apart. Next, break it into tokens: [‘book’, ‘a’, ‘table’, ‘for’, ‘two’, ‘at’, ‘7pm’, ‘tonight’, ‘at’, ‘L’Artusi’]. Notice that ‘7pm’ is kept as one meaningful token, not ‘7’ and ‘pm’ separately, because together they represent a time. Then add understanding: ‘Book’ here is not a noun meaning a physical book; it is a verb meaning to reserve. Identify entities: ‘two’ refers to number of people, ‘7pm’ and ‘tonight’ refer to time, ‘L’Artusi’ refers to a restaurant name. Then infer intent: the overall intent is to make a reservation, classified as book_table. Finally, generate a response or action: check availability, make the booking, and produce a confirmation: ‘Done! I have booked a table for two at L’Artusi tonight at 7pm. You will get a confirmation shortly.’ From raw text to action. That is the pipeline in miniature.

Step by step

The end-of-chapter exercise as a numbered protocol, in order.

  1. Sketch the full pipeline for query Book a table for two at 7pm tonight at L’Artusi, label Input, Processing, Understanding, Generation, and note tokenisation and entity decisions.
  2. Adapt the pipeline for two applications, sentiment analysis dashboard and machine translation, saying which phases are emphasised and which are minimal.
  3. Failure diagnosis: if the system splits L’Artusi into L and Artusi, which phase fails and what is the downstream impact?
  4. Design a pipeline for voice assistant Set an alarm for 6 am tomorrow, including speech-to-text before input and text-to-speech after generation, plus how tomorrow is resolved. No time is stated in the book for this exercise.

Worked example

The book’s worked example is the full pipeline walk for ‘Book a table for two at 7pm tonight at L’Artusi’: cleaning keeps the apostrophe in L’Artusi; tokenisation keeps ‘7pm’ as one time token; understanding reads ‘book’ as a reservation verb, extracts party size two, time 7pm, date tonight, restaurant L’Artusi; intent is classified as book_table; generation checks availability and confirms ‘Done! I have booked a table for two at L’Artusi tonight at 7pm.’ The case study adds the failure diagnosis: bad tokenisation split L’Artusi into L and Artusi, causing an entity miss, and fixing tokenisation improved accuracy 18 percent.

A real example from the book

Case Study – Chapter 4: The Pipeline in Action: BookATable Startup. No person age is given. BookATable startup wants to build voice-enabled booking: Book a table for two at 7pm tonight at L’Artusi. The team sketches the Chapter 4 pipeline. Input phase: raw audio from noisy restaurant street plus typed text with typo 7pn. Processing: speech-to-text with error correction, normalisation keeping L’Artusi apostrophe, tokenisation keeping 7pm as one time token, not 7 and pm. Understanding: representation via embeddings recognising book as reservation verb not noun, intent classification as book_table, entity extraction party_size two, time 7pm, date tonight resolved to 2026-10-28, restaurant L’Artusi. Dialogue state tracks Soho location from previous turn. Generation phase: check availability via API, produce confirmation You are all set! Table for two at L’Artusi tonight at 7pm.

Mistakes to avoid

  • Treating the pipeline as strictly linear in every system. Correction: modern LLMs do many steps implicitly inside one large model, but conceptually the same work still happens.
  • Splitting meaningful tokens apart, like ‘L’Artusi’ into ‘L’ and ‘Artusi’ or ‘7pm’ into ‘7’ and ‘pm’. Correction: keep meaningful units together or entity recognition fails downstream.
  • Grouping word forms when tense matters. Correction: for sentiment analysis grouping ‘loved’ and ‘loving’ helps, but for precise information extraction tense might matter.
  • Expecting generation from every system. Correction: some systems just understand and then take a non-linguistic action, like flagging spam.

What not to do

  • Do NOT split meaningful tokens like L’Artusi or 7pm apart.
  • Do NOT assume the pipeline is strictly linear in modern LLMs.
  • Do NOT group word forms when tense matters for the task.
  • Do NOT expect every NLP system to generate language.
  • Do NOT evaluate a tool without sketching its pipeline first.
  • Do NOT ignore messy input when estimating difficulty.

Low-energy mode

Sketch the four phases for one query you typed today: Input, Processing, Understanding, Generation, one line each. That counts.

If you freelance

This is one way to apply the idea, not a passage from the book. A freelancer can sketch the pipeline for a client request before quoting: name the input, the cleaning needed, the understanding to extract, and the action or output, so the quote covers the hard phases instead of only the visible output.

How to know it worked

You sketched the full pipeline for Book a table for two at 7pm tonight at L’Artusi with all four phases labelled and tokenisation and entity decisions noted. You adapted it for a sentiment dashboard and for translation, naming which phases are emphasised and which are minimal. You diagnosed the L’Artusi split and its downstream impact. You designed a voice assistant pipeline with speech-to-text before input and text-to-speech after generation.

Key takeaways

  • Think of the pipeline like a kitchen that turns raw ingredients into a finished meal.
  • From raw text to action. That is the pipeline in miniature.
  • The pipeline does not solve everything, but it gives you a map.
  • Once you see the four phases, you stop seeing NLP as a collection of unrelated magic tricks and start seeing it as a coherent workflow.

Try it today

Do Exercise – Chapter 4: End-to-End Pipeline today (no time stated in the book, see Exercise).

End of Chapter Exercise – Chapter 4: End-to-End Pipeline. No time stated in the book.

  1. Sketch the full pipeline for query Book a table for two at 7pm tonight at L’Artusi, label Input, Processing, Understanding, Generation and note tokenisation and entity decisions.
  2. Adapt the pipeline for two applications: sentiment analysis dashboard and machine translation, which phases emphasised, which minimal?
  3. Failure diagnosis: if the system splits L’Artusi into L and Artusi, which phase fails and what downstream impact?
  4. Design the pipeline for voice assistant Set an alarm for 6 am tomorrow, include speech-to-text before input and text-to-speech after generation, plus how tomorrow is resolved.

Frequently asked questions

Why does trying harder not work here?
Trying harder to understand each NLP application as a separate magic trick fails here, because the chapter’s own point is that most NLP applications are variations on the same theme.

How do I know it worked?
You sketched the full pipeline for Book a table for two at 7pm tonight at L’Artusi with all four phases labelled and tokenisation and entity decisions noted. You adapted it for a sentiment dashboard and for translation, naming which phases are emphasised and which are minimal. You diagnosed the L’Artusi split and its downstream impact.

What if it does not work?
If entity recognition fails, then check tokenisation first: did it split a meaningful token like L’Artusi or 7pm? If the booking is wrong, then check whether ‘tonight’ was resolved to today’s date. If a sentiment dashboard looks wrong, then check whether processing kept emojis and negations, since ‘not good’ must stay a single sentiment unit.

Get the book

Google Play eBookGoogle Play AudiobookBarnes & Noble

More from What Is Natural Language Processing?