# AG News

AG News is a large-scale news article classification dataset containing over 120,000 English news headlines and descriptions, used for benchmarking text classification algorithms in machine learning.

AG News is a widely used benchmark dataset for news article classification. It contains over 120,000 English news headlines and short descriptions, each assigned to one of four classes: World, Sports, Business, and Science/Technology. The dataset was derived from a larger corpus of news articles collected by the academic search engine AG's Corpus, and it has become a standard testbed for evaluating text classification models in [machine-learning](https://www.wikiprompt.org/wiki/machine-learning) and [natural language processing](https://www.wikiprompt.org/wiki/natural-language-processing).

The dataset is notable for its simplicity and scale, making it a common starting point for researchers and practitioners exploring [deep-learning](https://www.wikiprompt.org/wiki/deep-learning) approaches to text categorization. Each sample consists of a title and a description, with the class label indicating the topic. The four classes are balanced, with roughly 30,000 training examples per class and 1,900 test examples per class, providing a reliable measure of model performance.

## History and Origin

The AG News dataset was introduced in 2015 as part of a research project by Xiang Zhang and colleagues at New York University. The researchers extracted news articles from the AG's Corpus, a collection of over 1 million news articles gathered from more than 2,000 news sources. They selected articles that fell into one of the four categories and constructed a balanced subset for classification tasks. The dataset was released alongside similar benchmarks such as DBpedia and Yahoo! Answers, with the goal of providing diverse challenges for text classification algorithms.

The creation of AG News was motivated by the need for large, clean, and publicly available datasets to train and evaluate [neural network](https://www.wikiprompt.org/wiki/neural-network) models. At the time, many existing datasets were small or required significant preprocessing. AG News offered a straightforward classification task with clear labels, enabling researchers to focus on model architecture and training techniques rather than data cleaning.

## Dataset Structure

AG News contains two files: one for training and one for testing. The training set includes 120,000 samples, while the test set contains 7,600 samples. Each sample is a CSV line with three fields: class index (1 to 4), title, and description. The class indices correspond to World, Sports, Business, and Science/Technology, respectively. The titles are typically short, often under 10 words, while descriptions are one or two sentences, providing context for the headline.

The dataset is preprocessed to remove punctuation and convert all text to lowercase, though the original case and punctuation are available in the raw version. This preprocessing simplifies tokenization and allows models to focus on word patterns rather than formatting. The balanced class distribution ensures that accuracy is a meaningful metric, as random guessing would yield 25% accuracy.

## Applications in Machine Learning

AG News is frequently used to benchmark text classification models, from traditional methods like support vector machines and logistic regression to modern [transformer](https://www.wikiprompt.org/wiki/transformer)-based architectures. It serves as a sanity check for new model designs, as achieving high accuracy on AG News indicates that a model can capture basic semantic and syntactic patterns in text.

In the era of [large language models](https://www.wikiprompt.org/wiki/large-language-model), AG News is often used for fine-tuning and evaluation. Models like BERT and GPT can achieve near-perfect accuracy on the test set, demonstrating the maturity of text classification. However, the dataset remains valuable for educational purposes and for comparing the efficiency of different architectures, especially in resource-constrained settings.

Researchers also use AG News to study transfer learning, domain adaptation, and data augmentation techniques. Its simplicity allows for controlled experiments, and its size supports training without excessive computational cost. As a result, AG News appears in hundreds of academic papers and is a staple in machine learning courses.

## Limitations and Criticisms

Despite its popularity, AG News has limitations. The four categories are broad, and some articles may be mislabeled or ambiguous, leading to noise in the labels. The dataset is also relatively old, with articles from the early 2000s, so it may not reflect current news trends or vocabulary. Additionally, the preprocessing removes punctuation and lowercases text, which can obscure stylistic differences that might be relevant in real-world applications.

Another criticism is that AG News is too easy for modern models, with many achieving over 90% accuracy. This has led some researchers to seek more challenging benchmarks, such as those with finer-grained categories or imbalanced class distributions. Nevertheless, AG News remains a useful baseline and a starting point for understanding text classification.

## See Also

- [machine-learning](https://www.wikiprompt.org/wiki/machine-learning)
- [deep-learning](https://www.wikiprompt.org/wiki/deep-learning)
- [neural-network](https://www.wikiprompt.org/wiki/neural-network)
- [transformer](https://www.wikiprompt.org/wiki/transformer)
- [large-language-model](https://www.wikiprompt.org/wiki/large-language-model)

---
Source: https://www.wikiprompt.org/wiki/ag-news
License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
Last updated: 2026-09-07T02:34:36.987587+00:00
