Skip to content
All tutors

Text classification from baseline to transformer

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

By Skill Lab Beginner Machine learning NLP New

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 Skill Lab'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 with AI under Skill Lab's direction as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong. Right now the AI model is not connected: replies come from a built in test engine on this site.

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

Students can review a tutor after a paid lesson. Nobody has yet.