Text Classification

Problem Description and Data

The Text Classification problem uses the Twitter Sentiment dataset, which can be downloaded here. Save the dataset in a folder and let’s start coding.

Check also here for a presentation on this problem.

Problem Solution

Solution using Fully Connected Neural Network

Solution using Convolutional Neural Network

Solution using Recurrent Neural Network (LSTM)

Exercise

Can we perform the same analysis for multi-class Text Classification?

Use the excerpt from the BBC news dataset that is available here and can be loaded using this script.

Try this before you check the solution (training, trained model and vocabulary, and testing) and the CNN solution (training, trained model, and testing) and the LSTM solution (training, trained model, and testing).


Previous section:
Next section: