Natural Language Processing: The Complete Course
How computers read text, from characters and regular expressions to word vectors, transformers and large language models, measured on one real-shaped inbox from the first lesson to the last.
You build one thing: a service that reads the customer inbox of Tidewell Cycles, a bike shop and repair workshop in Bristol that started delivering to Germany, Spain and France in July. It cleans each message, pulls out the order number, product and date, routes the message to the right person in four languages, suggests the right help-centre article, summarises long threads and tells the owner each Monday what customers are unhappy about. Every method in the course, from a regular expression to a hosted language model, is scored on the same 80 hand-written messages, so you end with one honest comparison of accuracy, speed and cost. Tidewell is fictional and its data is simulated; every lesson also opens with a real, cited case.
Who this course is for
You can write basic Python: variables, loops, functions, lists and dictionaries, and running a notebook. You do not need any machine learning or NLP background.
| You are... | Start at |
|---|---|
| New to NLP | Module 1, and go in order |
| New to Python | The Python course first |
| Comfortable with regex and text cleaning | Module 2, or Module 4 if you know tokenisers |
| A data scientist who has trained text classifiers | Module 5 (evaluation), then Modules 6 and 7 |
| An engineer who mostly calls LLM APIs | Module 4, Module 5, then Module 10 to see where a cheaper model wins |
| Working on multilingual text | Module 9, after Modules 4 to 6 |
Every module's README lists what you need to know before starting it, so you can check whether it is safe to skip the one before.
What you need
- A Google account, to run code in Google Colab. Nothing to install.
- Nothing else for Modules 1 to 9: every model there runs inside the notebook, with no key.
- For Module 10 and a few optional calls before it, one free API key from Groq or Google Gemini, or no key at all if you run a model on your own computer with Ollama.
- For Module 7's fine-tuning, Colab's free T4 GPU helps; there is a CPU path too.
Setup takes about ten minutes: course-guide/02-setup-colab-and-llm-providers.md.
The modules
| # | Module | What you add to the inbox service | Needs first |
|---|---|---|---|
| 1 | Text as Data and Rules | The shared data, text cleaning, order numbers, dates and prices found with regular expressions, redaction, and the rule router every later model must beat | Python |
| 2 | Tokenisation and Word Normalisation | Word, sentence and subword tokenisers, stop words, stemming and lemmatisation, measured on the router | Module 1 |
| 3 | Linguistic Structure: Tags, Parses and Entities | A spaCy pipeline and an entity extractor for products, order numbers, dates and money, scored at entity level | Module 2 |
| 4 | Text as Vectors and Classification | Bag of words, n-grams and TF-IDF, and the first trained intent classifiers (naive Bayes, logistic regression) | Modules 1 and 2 |
| 5 | Evaluation, Sentiment and Topics | One evaluation report for every model, tuning without leakage, abstaining, sentiment and topics over time for the Monday report | Module 4 |
| 6 | Word and Sentence Embeddings | word2vec and fastText, sentence embeddings, and help-centre search with BM25, dense vectors and FAISS | Modules 4 and 5 |
| 7 | Sequence Models and Transformers with Hugging Face | Pipelines, tokenisers, zero-shot classification and a fine-tuned DistilBERT intent model | Modules 4 to 6 |
| 8 | Extraction, Question Answering and Summarisation | Repair-booking records validated with pydantic, a help-centre answer finder, thread summaries | Modules 3, 6 and 7 |
| 9 | Translation, Multilingual NLP and Evaluating Generation | Language identification, MarianMT translation, multilingual routing, BLEU, chrF and ROUGE | Modules 5 to 8 |
| 10 | LLMs for NLP, and Responsible NLP | One client for three providers, LLM classification and extraction, the bake-off with a cost table, a hybrid router and a name-swap fairness check | Modules 4, 5 and 7 |
| 11 | Capstone | The whole service end to end in one of three tracks, with shared evidence: scores on the hand-written test set, a cost table, a fairness check, a model card and tests | The modules your track builds on |
36 lessons, 240 topics (185 Essential, 48 Recommended, 7 Optional). Each taught module ends with a lab and an incident file.
How each lesson works
Every lesson is a walk through one Tidewell example, one picture at a time:
- The situation: a specific problem in the inbox.
- A real case, first: something that really happened, from a published paper, write-up or report, cited.
- The idea: fifteen to thirty figures, one idea each, one running example.
- Run it: code with a walkthrough of every line.
- Break it: a failure you cause on purpose.
- In production: what teams do with this at scale.
- Check yourself: questions, one exercise, key terms and sources.
Each module ends with a lab (a guided piece of the inbox service) and an incident file (a real, published failure replayed in the Tidewell inbox and fixed). Every output shown in the course comes from a real run. More detail: course-guide/01-how-this-course-works.md.
The tools you will use
Python throughout, everything open source apart from the hosted model services. Plain Python and regex and ftfy for text; NLTK and spaCy for tokens, tags, parses and entities; scikit-learn for vectors, classifiers and metrics; gensim for topics and word vectors; sentence-transformers, rank_bm25 and FAISS for search; Hugging Face transformers and datasets for pretrained and fine-tuned models; pydantic for records; sacreBLEU and rouge-score for generated text; LangChain in Module 10 to call Groq, Gemini or Ollama with the same code. Each mechanism is built by hand first, then with the library.
Course guide
| File | Read it when |
|---|---|
| 01-how-this-course-works.md | Before your first lesson |
| 02-setup-colab-and-llm-providers.md | Before you run any code; also the pinned libraries and the run-locally steps |
| 03-the-tidewell-inbox.md | To meet the shop, the people, the products, the policy, the dates and the five jobs |
| 06-shared-data.md | To see the Tidewell data every module reuses, and the code that makes it |
| 04-style-guide.md | Only if you are writing or editing lessons |
| 05-image-style-guide.md | Only if you are drawing the course figures |
Where other courses go deeper
This course uses transformers and language models as tools for text jobs. For depth elsewhere:
- How a transformer works inside, layer by layer: the Transformers course.
- Prompting, structured outputs, evaluation and running language models in production: the Large Language Models course.
- Retrieval pipelines (chunking, vector stores, hybrid search, reranking): the RAG course. Module 6 here covers search over 24 articles only.
- NLP inside a wider AI application, with web services and deployment: Module 5 of the AI Engineering course.
The one measure
Which method does each job well enough, at what cost, and how do you know? Almost everything in this course exists to answer that with numbers from the same 80 hand-written messages.