Twitter Topic Classification

Dimosthenis Antypas, Asahi Ushio, José Camacho-Collados, Leonardo Neves, Vítor Silva, Francesco Barbieri · DOI

Abstract

Social media platforms generate a continuous stream of unstructured data, making automated content categorization essential for information retrieval and trend analysis. While unsupervised topic modeling has traditionally been used, it often lacks the interpretability and precision of supervised classification. This paper discusses the introduction of TweetTopic, a large-scale dataset designed for supervised topic classification. By evaluating various architectures, researchers demonstrate that domain-specific models and temporal awareness are critical for navigating the unique linguistic landscape of Twitter.

Introduction

Social media is often described as a "firehose" of information. Organizing this content into meaningful categories is a significant challenge for researchers and industry professionals alike. Historically, Latent Dirichlet Allocation (LDA) and other unsupervised topic modeling techniques have been the standard. However, these methods frequently produce word clusters that are difficult for humans to interpret and do not generalize well across disparate datasets.

Supervised topic classification—where models are trained to assign predefined labels such as "Sports" or "Politics"—offers a more reliable alternative. The primary bottleneck for this approach has been the absence of high-quality, human-labeled datasets that reflect the nuances of social media. Most existing benchmarks rely on structured text like news articles, which fail to capture the slang, abbreviations, and rapid trend cycles characteristic of platforms like Twitter.

The TweetTopic Dataset

To address this gap, researchers from Cardiff NLP and Snap Inc. developed TweetTopic. The dataset was constructed using a rigorous pipeline to ensure it remains representative of real-world discourse:

  1. Collection: The team utilized trending topics from Snapchat to query the Twitter API, gathering data from September 2019 to August 2021.
  2. Filtering: A multi-stage pipeline removed non-English tweets, incomplete sentences, and near-duplicates to ensure data quality.
  3. Annotation: Each tweet was labeled by five human annotators via Amazon Mechanical Turk across an initial taxonomy of 23 topics.

Dataset Variants

TweetTopic is released in two primary versions:

  • Multi-label: 11,267 tweets categorized into 19 broad topics, allowing for the inherent overlap found in social media posts.
  • Single-label: A subset of 6,997 tweets grouped into 6 balanced, distinct categories for simplified classification tasks.

Crucially, the dataset includes a temporal split. Training data is drawn from 2019–2020, while testing data comes from 2020–2021. This design allows researchers to measure "concept drift"—the phenomenon where the vocabulary used to discuss a specific topic changes over time.

Experimental Methodology

The researchers evaluated the dataset using a range of architectures, from traditional baselines to state-of-the-art Transformer models:

  • Baselines: SVM and fastText.
  • General Models: BERT and RoBERTa.
  • Domain-Specific Models: BERTweet (trained on Twitter data) and TimeLM (models specifically trained on different temporal slices of Twitter data).

Key Insights and Results

Domain Expertise vs. Model Size

The experiments revealed that domain-specific models (BERTweet, TimeLM) consistently outperformed larger, general-purpose models like BERT-large. This suggests that for social media tasks, an understanding of "Twitter-speak" and platform-specific context is more valuable than raw parameter count.

The Impact of Temporal Decay

Models performed significantly better on a "random split" (where training and testing data share the same time period) than on the "temporal split." This highlights the difficulty of maintaining model accuracy as language evolves. The "Arts & Culture" category experienced the most significant performance drop, likely due to the high turnover of celebrities, memes, and pop-culture events.

Performance Metrics

  • Top Performers: TimeLM-19 and TimeLM-21 achieved the highest scores. In the single-label setting, TimeLM-19 reached an F1-score of 70.0% and an accuracy of 86.4%.
  • Task Complexity: The multi-label task proved more challenging, with the best model (TimeLM-21) reaching an F1-score of 58.8%.
  • Transformer Advantage: Modern Transformer models outperformed traditional SVM methods by over 20 points in F1-score, confirming that contextual embeddings are vital for handling the noise of social media text.

Discussion and Limitations

Error analysis indicated that many misclassifications were due to the natural ambiguity of social media. For instance, a tweet regarding a holiday-themed Google Doodle might be reasonably classified as either "Arts & Culture" or "Daily Life."

However, the study notes several limitations:

  • Language: The current dataset is restricted to English.
  • Scalability: The high cost of human annotation makes it difficult to scale the dataset to millions of samples.
  • Taxonomy Evolution: While 19 topics are comprehensive, social media constantly generates new sub-topics that may eventually fall outside this fixed taxonomy.

Conclusion

The TweetTopic dataset provides a vital benchmark for the NLP community, shifting the focus from unsupervised discovery to robust, supervised classification. The results underscore the necessity of domain-specific pre-training and the ongoing challenge of temporal adaptation in social media environments. Future work will focus on expanding the methodology to other languages and exploring semi-supervised learning to reduce the reliance on expensive human labels.

Summary updated

BibTeX
@inproceedings{antypas2022twitter,
  author = {Dimosthenis Antypas and Asahi Ushio and José Camacho-Collados and Leonardo Neves and Vítor Silva and Francesco Barbieri},
  title = {{Twitter Topic Classification}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2022},
}
Figure