← Natural Language Processing learning path
Natural Language Processing · Module 4 of 10

Text classification

Sort text into categories like spam or sentiment.

📖 Key ideas

  1. Examples: spam detection, sentiment, topic labelling, intent detection.
  2. Classic: TF-IDF + logistic regression or Naive Bayes.
  3. Modern: fine-tune BERT-like models.
  4. Metrics: accuracy, precision, recall, F1.
  5. Imbalanced classes need careful evaluation.
💡 Real-life example: Text classification is a postman sorting letters into the right bins by reading them.
Spam filterClassifies emails as spam or not
Naive BayesSimple probabilistic classifier
Intent detectionFinding what a user wants
F1 scoreBalance of precision and recall