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.
A low-maths introduction to classifying text with Naive Bayes, one of the most seminal methods for the job.
Video 16minWorks through a collection of movie reviews, using Naive Bayes to decide whether each review is positive or negative.
Video 58minContinues the sentiment task, covering Bayes theorem, the derivation of Naive Bayes, and logistic regression as an alternative.
Video 51minExplains the metrics used to evaluate a classifier, from the confusion matrix to accuracy, precision, recall and the F1 score.
Video 2minA 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