Text Classification and Routing: Send Each Message to the Right Place
Send every support message to the right team, with a priority, in English and French. Compare rules, classical models, embeddings, a fine-tuned encoder, zero-shot models and LLMs on one test set and one cost table, send the unsure messages to a person, and run the router as a small service.
Read every lesson as a guest, or sign in to enroll and track your progress.
Enroll to save the lessons that you complete. It is free.
You are enrolled. From now on, the lessons that you complete are saved.
To get your certificate, mark every knowledge check as matching. These lessons have checks to finish:
Is this the right course for you?What this course covers and does not cover, and 4 courses to take for other needs.
This course teaches text classification as a business system: labels and labelling guidelines, rules, TF-IDF models, sentence embeddings, a small fine-tuned encoder, zero-shot models and LLM classifiers compared on the same messages and the same costs, decision models, cascades and distillation, rare classes and messages with two labels, confidence zones with a person in the loop, and a routing service that watches for new topics. It does not teach how transformers work inside, how to build an LLM application from the start, or how to build an evaluation platform.
Turn a routing need into a labelling scheme (teams, topics, priority, multi-label or hierarchy) with written guidelines, and state the cost of each kind of mistake.
Build and compare rules, classical models, embedding models, a fine-tuned small encoder, zero-shot models and LLM classifiers on the same data, and explain why each wins or loses.
Choose a method or a cascade by business cost: accuracy by class, cost per 1,000 messages, speed, privacy and maintenance.
Handle real label problems: class imbalance, rare classes, noisy labels and few labels (active learning and LLM-assisted labelling with review).
Use confidence to decide automatically, ask for review or send to a person, and measure the work this saves and creates.
Run a classifier in production: version labels and models, find drift and new topics, and retrain or add a label safely.
About this course
A customer asked for a refund. The message went to the product team’s queue, where nobody answers refunds, and it waited three days. The customer did not wait: they left. Larkfield’s inbox gets messages by email, chat and social media, in English and French, and each one must reach the right team.
In this course, you follow Priya, Larkfield’s data scientist, as she builds the router with Grace, who runs the support teams, and Chloé, who labels the messages. You start with the labels and the cost of each mistake. Then you compare keyword rules, classical models, embeddings, a small model fine-tuned on a laptop, zero-shot models and large language models, on the same messages and the same cost table. Sometimes the old method wins, and you learn why.
Then you use confidence. The router decides when it is sure, asks for a review when it is not, and sends some messages straight to a person. You finish with a small routing service that keeps versions, writes a review queue and finds a new topic when Omar launches a new product.
The Larkfield inbox is synthetic: we made it for this course, with the problems that real messages have. Every model answer that needs an account was recorded once, so you need no key and no money. Every notebook runs on a laptop CPU or on free Colab.
Before you start
You completed Machine Learning, From Problem to Reliable Model, or you have the same skills. You can read and change Python code in a notebook, you can read JSON, and you know train, validation and test sets, precision and recall, and thresholds. The LLM API, deep learning and evaluation courses help but are not required. You need a free Google or Kaggle account for the notebooks, or Python 3.12 on your computer. You need no key and no money.
ML and AI engineers, data scientists and backend developers who must sort incoming text, such as support messages, emails, chat messages, forms or reviews, into teams, topics, priorities or actions.
How we made this course
Experienced AI practitioners designed this course. AI helped us draft the content; people chose the teaching approach and the examples, and reviewed every lesson. The outputs that you see are the actual results of running the code. How we make our courses
Inside the course
Module 1The routing problem and its cost
4 lessons
The routing problem and its cost. Follow a refund request that waited three days in the wrong queue, design the labels, put a cost on each kind of mistake, and open the Larkfield inbox and the comparison table.
Labels you can trust. Write labelling guidelines, measure how often two people agree, find the labels that are probably wrong, and label well when you have few labels.
Baselines. Keyword rules and regular expressions, text as TF-IDF numbers, Naive Bayes, logistic regression and a linear SVM, and rules and a model that work together.
Embeddings and small fine-tuned models. Sentence embeddings with a simple classifier, few labels, a small encoder fine-tuned on a laptop CPU, newer embedding models, and zero-shot models that need no LLM.
LLMs as classifiers. Zero-shot and few-shot classification with a hosted LLM, a small local model, a reasoning model for the hard cases only, and the cost of each per 1,000 messages.
Module 6Decision models, cascades and distillation
4 lessons
Decision models, cascades and distillation. Get a label and a true probability from a language model, judge a new model's claims, let a cheap model decide when it is sure, and let an LLM teach a cheap model.
Confidence and people in the loop. Check if a confidence is true, split messages into decide, review and send to a person, and learn from the corrections people make.
Run it in production. A small routing service with versions and a review queue, drift and a new topic in the month of a product launch, and a safe release of a new label.
Four end-to-end case studies on real open data. Banking questions, requests that a bot cannot handle, requests in English and French with few labels, and research papers with many labels. Complete at least one for the certificate; each one is a portfolio piece.
Complete at least one case study for the certificate. The others are optional. What each one covers
Realistic projects from start to finish, on real data, with every output explained. Each one makes a portfolio piece. Complete at least one for the certificate; the others are optional.
Detect out-of-scope requests and send them to a person, on an intent dataset with an out-of-scope set, and measure how many wrong automatic answers this prevents.
Start with 20 labels per intent on real open requests in English and French, add labels with active learning and LLM-assisted labelling with review, and show the learning curve and the labelling cost.