Module 6 of 13

Text Classification

Lessons

About This Module

Text classification is the task of assigning a label to a piece of text: spam or not spam, positive or negative, one topic out of many. It is one of the most common real-world uses of NLP, and it is where the representations from the earlier modules are first put to work.

The lessons start with Naive Bayes, a simple probabilistic classifier that works well on word counts, and apply it to sentiment analysis of movie reviews. You then see logistic regression as an alternative, and build a working classifier in Python with scikit-learn.

Building a classifier is only half the job, so one lesson covers how to judge it with the confusion matrix, precision, recall and F1. The module closes with a first look at fine-tuning BERT, a preview of the pretrained models covered later in the course. Watch the lessons in order, then continue on to Sequence Labeling.

Lessons

6 videos
01

Text Classification Using Naive Bayes

A low-maths introduction to classifying text with Naive Bayes, one of the most seminal methods for the job.

Video 16min
02

Sentiment Classification with Naive Bayes (NLP Video 4)

Works through a collection of movie reviews, using Naive Bayes to decide whether each review is positive or negative.

Video 58min
03

Sentiment Classification with Naive Bayes & Logistic Regression, contd. (NLP Video 5)

Continues the sentiment task, covering Bayes theorem, the derivation of Naive Bayes, and logistic regression as an alternative.

Video 51min
04

Confusion Matrix, Accuracy, Precision, Recall & F1 Score Explained

Explains the metrics used to evaluate a classifier, from the confusion matrix to accuracy, precision, recall and the F1 score.

Video 2min
05

Fine-Tune BERT for ANY Text Classification Task: Explained With Code

A preview of where the field has moved: fine-tuning a pretrained BERT model on a custom text classification task with Hugging Face Transformers.

Video 11min