Skip to main content
QUICK REVIEW

[Paper Review] TweetNLP: Cutting-Edge Natural Language Processing for Social Media

José Camacho-Collados, Kiamehr Rezaee|arXiv (Cornell University)|Jun 29, 2022
Hate Speech and Cyberbullying DetectionComputer Science14 citations
TL;DR

TweetNLP is a lightweight, accessible NLP platform specializing in Twitter text, leveraging fine-tuned RoBERTa- and XLM-R-based models for tasks like sentiment analysis, offensive language detection, and emoji prediction. It enables efficient inference on standard hardware and offers a Python library, online demo, and tutorial, with its tweet-embedding model achieving 26.7% accuracy on tweet-reply retrieval—outperforming larger baselines in-domain.

ABSTRACT

In this paper we present TweetNLP, an integrated platform for Natural Language Processing (NLP) in social media. TweetNLP supports a diverse set of NLP tasks, including generic focus areas such as sentiment analysis and named entity recognition, as well as social media-specific tasks such as emoji prediction and offensive language identification. Task-specific systems are powered by reasonably-sized Transformer-based language models specialized on social media text (in particular, Twitter) which can be run without the need for dedicated hardware or cloud services. The main contributions of TweetNLP are: (1) an integrated Python library for a modern toolkit supporting social media analysis using our various task-specific models adapted to the social domain; (2) an interactive online demo for codeless experimentation using our models; and (3) a tutorial covering a wide variety of typical social media applications.

Motivation & Objective

  • To address the limitations of general-purpose NLP models when applied to noisy, informal social media text like Twitter.
  • To democratize access to high-performing, task-specific NLP models for social media by enabling inference on standard hardware without cloud dependency.
  • To provide a unified, user-friendly platform integrating state-of-the-art models, an interactive demo, and educational resources for non-experts.
  • To support model transparency and bias inspection by enabling codeless and visual exploration of model behavior.
  • To extend beyond classification tasks by planning future support for low-level NLP tasks (e.g., POS tagging, parsing) and additional platforms (e.g., Reddit, Instagram) and languages.

Proposed method

  • Fine-tuning RoBERTa-base and XLM-R-base language models on large-scale Twitter corpora to create domain-specialized models.
  • Developing task-specific heads for downstream NLP tasks such as sentiment analysis, named entity recognition, and offensive language identification.
  • Creating a lightweight, efficient inference pipeline using distilled, base-sized models to ensure compatibility with standard CPUs and free cloud services.
  • Implementing a Python library for programmatic access to models, enabling integration into research and production workflows.
  • Building an interactive web-based demo for non-programmers to test models and perform real-time analysis without coding.
  • Generating tweet-level embeddings via contrastive pre-training on tweet-reply pairs to improve performance on retrieval and similarity tasks.

Experimental results

Research questions

  • RQ1Can lightweight, domain-adapted Transformer models outperform general-purpose models on social media NLP tasks without requiring specialized hardware?
  • RQ2How effective are in-domain pre-trained embeddings for capturing semantic and syntactic nuances in informal, noisy Twitter text?
  • RQ3To what extent can a unified platform with a Python API, online demo, and tutorial lower the barrier to entry for researchers and practitioners in social media NLP?
  • RQ4How do model performance and robustness compare across diverse social media tasks, including those specific to Twitter such as emoji prediction and offensive language detection?
  • RQ5Can fine-tuned, small-sized models still achieve state-of-the-art results on benchmark tasks like TweetEval while remaining accessible to non-experts?

Key findings

  • The TweetNLP platform achieved 26.7% accuracy on tweet-reply retrieval, significantly outperforming the all-mpnet-base-v2 baseline (15.8%) despite being smaller and more efficient.
  • TweetNLP's tweet-embeddings model achieved a Spearman correlation of 70.7 on the STS-benchmark, demonstrating competitive performance on sentence similarity despite being trained on in-domain Twitter data.
  • The sentiment analysis model became the most downloaded model on Hugging Face in January 2022, with over 15 million downloads, indicating strong community adoption.
  • The TweetEval benchmark, used to evaluate task-specific models, was the second most downloaded dataset on Hugging Face in April 2022, with over 150,000 downloads.
  • TweetNLP's pre-trained fastText-style embeddings outperformed standard pre-trained fastText on two of four evaluation datasets (WS-Sim and MEN), especially in relatedness tasks.
  • The platform enables real-time inference on standard hardware, with no need for dedicated GPUs or cloud infrastructure, making it accessible to a broad user base.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.