[Paper Review] Enhanced Twitter Sentiment Classification Using Contextual Information
This paper proposes a Bayesian sentiment classifier for Twitter that integrates contextual metadata—such as time, location, author, and day of week—with standard n-gram features to improve sentiment classification accuracy. By leveraging distant supervision to label millions of geo-tagged tweets, the model achieves 86.2% accuracy, a 10% relative improvement over baseline n-gram models, demonstrating that contextual information significantly enhances performance in low-resource, short-text sentiment analysis.
The rise in popularity and ubiquity of Twitter has made sentiment analysis of tweets an important and well-covered area of research. However, the 140 character limit imposed on tweets makes it hard to use standard linguistic methods for sentiment classification. On the other hand, what tweets lack in structure they make up with sheer volume and rich metadata. This metadata includes geolocation, temporal and author information. We hypothesize that sentiment is dependent on all these contextual factors. Different locations, times and authors have different emotional valences. In this paper, we explored this hypothesis by utilizing distant supervision to collect millions of labelled tweets from different locations, times and authors. We used this data to analyse the variation of tweet sentiments across different authors, times and locations. Once we explored and understood the relationship between these variables and sentiment, we used a Bayesian approach to combine these variables with more standard linguistic features such as n-grams to create a Twitter sentiment classifier. This combined classifier outperforms the purely linguistic classifier, showing that integrating the rich contextual information available on Twitter into sentiment classification is a promising direction of research.
Motivation & Objective
- To improve Twitter sentiment classification by incorporating contextual metadata such as geolocation, time, and author identity, which are often overlooked in standard linguistic approaches.
- To investigate whether sentiment varies systematically across different spatial, temporal, and authorial contexts on Twitter.
- To develop a scalable, data-driven method for estimating prior sentiment probabilities in diverse contextual categories using distant supervision.
- To integrate contextual priors with traditional n-gram models via Bayesian inference to improve classification robustness and accuracy.
- To evaluate the performance of the contextual model against state-of-the-art distant-supervised classifiers, particularly in low-resource settings.
Proposed method
- Distant supervision was applied to millions of geo-tagged, timestamped, and author-tagged tweets from 2012–2014 to automatically label sentiment using external sentiment lexicons.
- Prior sentiment probabilities were estimated for each context category (state, hour, day of week, month, author) using aggregated sentiment scores from labeled tweets.
- A Bayesian framework combined these context-specific priors with standard bigram language models to produce a hybrid sentiment classifier.
- The model used 5-fold cross-validation to train and evaluate performance, ensuring no data leakage between folds.
- Sentiment priors were recalculated periodically to account for temporal shifts in public sentiment, such as seasonal or socioeconomic changes.
- The final classifier used all contextual variables (state, hour, day, month, author) in a single model to maximize predictive power.
Experimental results
Research questions
- RQ1Does sentiment expression on Twitter vary systematically across different geographic locations, times of day, days of the week, months, and individual authors?
- RQ2Can context-specific sentiment priors derived from large-scale, automatically labeled data improve the performance of standard n-gram sentiment classifiers?
- RQ3To what extent does integrating spatial, temporal, and author-based metadata enhance sentiment classification accuracy on short, noisy Twitter texts?
- RQ4How does the performance of a context-aware Bayesian classifier compare to purely linguistic models and existing distant-supervised approaches?
- RQ5Can the model generalize to non-geo-tagged tweets by relying on time, author, and other available metadata?
Key findings
- The contextual classifier achieved 86.2% accuracy, representing a 10% relative and 8% absolute improvement over the baseline bigram model.
- The state-based prior contributed most to performance, achieving 84.9% accuracy when used alone, highlighting the strong influence of geographic location on sentiment.
- The hour of day was the most predictive temporal feature, improving accuracy to 82.1% when used independently.
- The author-based prior yielded 82.9% accuracy, indicating that individual users exhibit stable sentiment baselines over time.
- Even without state information, the model achieved 84.3% accuracy, demonstrating strong performance using only time, author, and temporal metadata.
- The full contextual model outperformed the prior state-of-the-art distant-supervised classifier by more than 3 percentage points in absolute accuracy.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.