Putting Things in Context: Community-specific Embedding Projections for Sentiment Analysis

Yi Yang, Jacob Eisenstein

Abstract

Sentiment analysis often fails to capture the nuanced meanings of words that vary across different social contexts. This paper introduces COMMSEM (Community-Specific Embeddings), a framework that utilizes social network structures to identify online communities and apply custom "lenses" to word embeddings. By modeling linguistic homophily—the tendency for socially connected individuals to share language patterns—COMMSEM captures community-specific sentiment shifts (e.g., "sick" as a compliment vs. a symptom). Our results on SemEval Twitter datasets demonstrate that social graphs serve as effective proxies for latent demographic variables, leading to significant improvements in sentiment classification without requiring explicit user metadata.

Introduction: The Challenge of Linguistic Variation

Natural Language Processing (NLP) typically treats language as a monolith, seeking a single "average" meaning for every word. However, sociolinguistics teaches us that language is deeply tied to social identity. A word like "sick" might denote illness in a general context but signify high praise in specific youth or music subcultures.

Figure 1: Illustrating how the sentiment of the word "sick" shifts based on the social community of the speaker.

This variation, known as linguistic homophily, presents a significant hurdle for sentiment analysis. While demographic metadata (age, gender, location) could theoretically resolve these ambiguities, such data is rarely available at scale. This research addresses the problem by using social network structures as a "latent" variable to account for social variation in language.

Methodology: The COMMSEM Framework

The authors propose a "middle ground" between generic global models and hyper-personalized individual models. The COMMSEM approach involves three primary components:

  1. Community Detection: Using the Twitter follower network, users are grouped into communities using modularity optimization algorithms like Fast-Greedy and Multi-Level clustering.
  2. Linguistic Modularity: To validate the approach, the authors introduced a metric to test if social clusters correspond to linguistic clusters. They found that individuals within the same social community are significantly more likely to share vocabulary than random pairings.
  3. The COMMSEM Model: Building on Non-linear Subspace Embedding (NLSE), the model represents words using a shared global matrix for general English and a community-specific matrix to capture local slang and sentiment shifts. This effectively applies a "social filter" to standard word embeddings.

Empirical Evidence for Linguistic Homophily

The core assumption of COMMSEM is that social connections predict linguistic similarity. The authors quantified this through assortativity analysis across different interaction networks (follow, mention, and retweet).

Figure 2: Assortativity of language across different social network types compared to random rewiring, demonstrating that social communities are indeed linguistic communities.

As shown in Figure 2, the original social networks exhibit significantly higher linguistic assortativity than randomly rewired versions. This confirms that "who you follow" is a strong predictor of "how you talk," justifying the use of community-level projections.

Datasets and Network Construction

The study utilized the SemEval Twitter Sentiment Analysis datasets (2013-2015). To overcome the lack of social data in the original sets, the authors crawled the follower links for over 14,000 users, creating an expanded dataset called SEMEVAL+. This process reduced the number of isolated users from 25% to just 5%, providing a dense graph for community detection.

Key Results and Insights

COMMSEM outperformed several state-of-the-art baselines on the SemEval benchmarks:

  • Performance Gains: On the 2014 and 2015 test sets, COMMSEM achieved an average F1 score of 70.67, a significant improvement over the pooled baseline (69.96).
  • Temporal Robustness: The model proved particularly effective on later datasets (2014/2015) that were collected at different times than the training data, suggesting that social context aids in generalization.
  • Sentiment Polarity Shifts: Qualitative analysis revealed that certain communities are defined by specific sentiment markers. For instance, one community might use "blessings" and "glow" as primary positive descriptors, while another uses more aggressive slang.

Conclusion

By leveraging social network structures, COMMSEM provides a scalable way to incorporate social context into NLP. The success of community-specific projections suggests that social graphs are a powerful, often overlooked resource for resolving linguistic ambiguity. Future work may explore dynamic community updates and the application of this framework to other tasks like machine translation or entity recognition.

Summary updated

BibTeX
@article{yang2015putting,
  author = {Yi Yang and Jacob Eisenstein},
  title = {{Putting Things in Context: Community-specific Embedding Projections for Sentiment Analysis}},
  journal = {Trans. Assoc. Comput. Linguistics},
  year = {2015},
}
Figure