Introduction
Text classification assigns a label to a piece of text: is this email spam? Is this review positive or negative? Which department should handle this support ticket? Which topic is this news article about? Sentiment analysis (positive vs negative, or a 1–5 star rating) is the classic example and a great way to see all the pieces of an NLP model work together.
The pipeline is: text → tokens → IDs → embeddings → sequence model → one vector → classifier. Think of a film critic: they read the review word by word (the sequence model), keep a running impression in their head (the hidden state), and at the end give a thumbs up or down (the classifier).