Text classification using the AG News dataset – 
a comparative study
The AG News dataset is a collection of more than 1 million news articles, collected from over 2,000 news sources by a news search engine called ComeToMyHead. The dataset is distributed across four categories – namely, world, sports, business, and science and technology – and it is available on TensorFlow Datasets (TFDS). The dataset is made up of 120,000 training samples (30,000 from each category), and the test set contains 7,600 examples.
Note
This experiment may take about an hour to run, due to the size of the dataset and the number of models; hence, it is important to ensure your notebook is GPU-enabled. Again, you could take a smaller subset to ensure your experiments run much faster.
Let’s start building our model:
- We will begin by loading the necessary libraries for this experiment:
import pandas as pd
import tensorflow_datasets as tfds
import tensorflow as...