Skip to content
SamplePreview build: teacher profiles, ratings, reviews and lesson counts are sample data.
All tutors

Text classification from baseline to transformer

Build text classifiers step by step, starting with a strong simple baseline and honest metrics

By Nadia Haddad Beginner Machine learning NLP 4.3(4) 74 lessons taught Sample

Your first 3 replies from the tutor are free. Then you can continue the lesson for $5 from your credit.

A taste of a lesson

One question and the answer, as this tutor gives it.

Text classification from baseline to transformer AI tutor following Nadia Haddad's plan
Student:

My ticket classifier has 94 percent accuracy, but managers say it misses urgent tickets. How can both be true?

Tutor:

Accuracy counts every ticket equally, so if urgent tickets are rare, the model can score highly by labelling almost everything as normal. Check the per class numbers: recall for the urgent class tells you what share of truly urgent tickets it catches. If that is low, try class weights during training, collect more urgent examples, or lower the decision threshold for urgent so it flags more, accepting some false alarms. Then read the urgent tickets it missed to see what they have in common. Quick exercise: if there are 40 urgent tickets and the model catches 18, what is its urgent recall?

Written by the teacher as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong.

What you will be able to do

  • Write label definitions and guidelines that people can apply consistently
  • Build and evaluate a TF-IDF plus logistic regression baseline
  • Compare embeddings, fine tuned encoders and LLM prompting on cost and accuracy
  • Read a confusion matrix and report per class precision and recall
  • Run an error analysis that tells you what to fix next

Lesson plan

6 lessons. Pick one to start there.

  1. 1 Defining labels people agree on Turn a vague sorting task into clear categories with written guidelines. Start
  2. 2 A strong simple baseline Build a TF-IDF plus logistic regression classifier and measure it properly. Start
  3. 3 Metrics that tell the truth Use per class metrics and a confusion matrix instead of overall accuracy. Start
  4. 4 Embeddings and fine tuned encoders Decide when stronger representations are worth the extra effort. Start
  5. 5 Zero and few shot with an LLM Classify with prompts and measure the result like any other model. Start
  6. 6 Error analysis and maintenance Find out why the classifier fails and keep it working as text changes. Start

Try asking

Tap a question to start a lesson with it.

About this tutor

For beginners who need to sort text into categories, such as support tickets, reviews or documents, and want to do it properly. You begin with the part most people skip: defining labels and writing guidelines so people agree. Then you build a TF-IDF plus logistic regression baseline, try embeddings with a simple classifier, consider fine tuning a small transformer encoder, and compare with zero and few shot classification by a large language model. Throughout, you read a confusion matrix, report per class precision and recall, handle rare classes and do error analysis. Coding is optional; the tutor explains each step in plain terms.

Reviews

4.3

4 ratingsSample

  • Lin Y.Sample

    Error analysis by cause was new to me. Half our 'model errors' were inconsistent labels.

  • Carmen V.Sample

    The baseline lesson was humbling. Our TF-IDF model came within two points of the expensive one we had been planning to buy.

  • Patrick N.Sample

    Very practical. The label guidelines lesson felt slow at first but it turned out to be where most of our problems were.

  • Bruno T.Sample

    Solid fundamentals. I hoped for more on multi label setups, which is my real problem, but the metrics part was useful.

About the teacher

Nadia Haddad

Practical NLP: from tokens and embeddings to classification, translation and speech

9 tutors 4.5(22) 470 lessons taught Sample

I teach natural language processing as a craft: turning messy text in many languages into something a model can use, and checking honestly whether the result works. I grew up switching between Arabic, French and English, and my work has been on text and speech systems that had to serve speakers of more than one language, so I notice quickly...

See Nadia's profile and tutors