Alleviating Data Sparsity for Twitter Sentiment Analysis

Hassan Saif, Yulan He, Harith Alani#MSM 2012

Introduction

Sentiment analysis on Twitter presents unique challenges compared to traditional long-form text. Tweets are inherently short, often limited to 140 characters, and are characterized by an informal style rich in slang, typos, and a vast array of infrequent named entities. This research addresses the "data sparsity" problem—a phenomenon where the vocabulary is enormous, but the majority of words appear too rarely for machine learning models to identify robust patterns.

The Data Sparsity Challenge

In a standard bag-of-words representation, the sparsity of Twitter data is extreme. The authors observe that approximately 93% of the words in their Twitter dataset occur fewer than 10 times. This distribution makes it difficult for classifiers like Naïve Bayes to generalize effectively, as they lack sufficient examples of rare features to determine their sentiment polarity.

Figure 1: Comparison of word frequency distributions between Tweets and Movie Reviews, highlighting the extreme sparsity in Twitter data.

Proposed Methodology

To mitigate this sparsity, the authors propose two novel feature engineering techniques designed to group related words into denser, more informative features.

1. Semantic Features via Interpolation

Rather than treating every unique product or person as an isolated feature, the authors leverage external NLP tools to map named entities to broader semantic concepts. For instance, specific terms like "iPad" or "iPhone" are mapped to the concept "Product/Apple."

Figure 2: Mapping specific vocabulary terms to broader semantic concepts to create denser feature sets.

However, the authors found that simple replacement (swapping the word for the concept) actually decreased accuracy by 4% because it discarded granular information. To solve this, they introduced semantic interpolation. This method mathematically combines the standard unigram language model with the generative probability of words given their semantic concepts during the training of a Naïve Bayes (NB) classifier.

2. Sentiment-Topic Augmentation

The second approach utilizes a Joint Sentiment-Topic (JST) model to automatically extract latent topics and their associated sentiments from unlabelled text. By clustering words like "headache" and "sick" under a negative "health" topic, the model creates high-level features. These inferred sentiment-topics are appended to the original bag-of-words, providing the classifier with dense, thematic information.

Evaluation and Results

The methods were evaluated using the standard Stanford Twitter Sentiment dataset and a custom 1,000-tweet test set annotated via a web-based tool called "Tweenator."

  • State-of-the-Art Performance: On the original Stanford test set, the sentiment-topic augmentation achieved 86.3% accuracy, outperforming previous benchmarks (83%–84.7%) despite using a significantly smaller training subset (60,000 vs. 1.6 million tweets).
  • Feature Efficiency: The sentiment-topic approach proved remarkably efficient, reaching over 80% accuracy using only ~500 features, whereas a standard unigram model requires tens of thousands of features to achieve comparable results.
  • Impact of Pre-processing: Aggressive normalization (e.g., converting usernames to "USER" and URLs to "URL") reduced the vocabulary size by 61%, serving as a critical first step in reducing sparsity.

Conclusion

By clustering rare words into semantic concepts and latent topics, this research demonstrates that data sparsity in short-text social media can be effectively managed. While semantic interpolation performed best on the larger custom test set, sentiment-topic features yielded the highest accuracy on the standard benchmark. Future work will focus on selective statistical replacement and applying learned weights to augmented features to further refine classification accuracy.

Summary updated

BibTeX
@inproceedings{saif2012alleviating,
  author = {Hassan Saif and Yulan He and Harith Alani},
  title = {{Alleviating Data Sparsity for Twitter Sentiment Analysis}},
  booktitle = {\#MSM},
  year = {2012},
}
Figure