Sentiment as an Ordinal Latent Variable

Niklas Stoehr, Ryan Cotterell, Aaron ScheinEACL 2023

Introduction

Sentiment analysis is a cornerstone of natural language processing, yet it frequently relies on a fragmented ecosystem of sentiment dictionaries. These resources—lists of words mapped to sentiment values—suffer from three primary issues: inconsistent scales (binary vs. continuous), a lack of nuance regarding the ordinal nature of human emotion (e.g., "excellent" > "good"), and low individual word coverage.

Presented at ACL 2023, this research introduces ORDSCALE, a Bayesian generative model that treats sentiment as an ordinal latent variable. By unifying disparate dictionaries into a single, ordered scale, the authors provide a method to leverage the collective intelligence of existing resources while respecting the inherent ranking of sentiment.

Methodology: A Bayesian Approach to Sentiment

The core innovation lies in modeling sentiment not as a nominal category or a precise cardinal number, but as an ordered sequence of latent classes.

The Bayesian generative model for OrdScale, unifying continuous and discrete sentiment dictionaries through a latent ordinal variable $z_v$.

The model assumes that for every word $v$, there exists a hidden sentiment class $z_v$. To enforce an explicit ordering (e.g., Class 1 < Class 2 < ... < Class K), the authors utilize an OrderedNormal distribution. This framework allows the model to "digest" mixed data types simultaneously:

  • Continuous dictionaries (e.g., SenticNet, Vader) are modeled using Beta distributions.
  • Discrete/Binary dictionaries (e.g., General Inquirer, Hu-Liu) are modeled using Binomial distributions.

By applying constraints to the parameters of these distributions—such as ensuring the mode of the Beta distribution for a higher class is greater than that of a lower class—the model guarantees that the latent classes maintain a meaningful sentiment gradient. Inference is performed using Markov Chain Monte Carlo (MCMC) via the Pyro library.

Key Results and Evaluation

The authors evaluated ORDSCALE across six diverse sentiment classification datasets, ranging from academic paper reviews (ACL, ICLR) to movie reviews (IMDB) and restaurant ratings (Yelp).

F1 Score comparison across six sentiment classification datasets, demonstrating the robust performance of OrdScale + LR compared to individual dictionary baselines.

Optimal Granularity and Coverage

Through cross-validation, the researchers found that a 5-class scale (resembling a standard Likert scale) provided the best fit for the data. One of the model's greatest strengths is its ability to perform data imputation. If a word is missing from one dictionary but present in another, ORDSCALE can accurately predict the missing value by mapping it to the latent ordinal variable.

Robust Performance

As shown in the evaluation results, while ORDSCALE + Logistic Regression (LR) does not always outperform specialized state-of-the-art models on every single task, it consistently provides the most reliable performance across all domains. It avoids the "boom or bust" variability seen when using individual dictionaries, which may perform well in one domain but fail in another due to limited vocabulary or scale mismatch.

Insights and Implications

Beyond classification accuracy, the Bayesian nature of ORDSCALE provides meaningful uncertainty estimates. Instead of a single point estimate, the model produces a credible interval for each word's sentiment. High uncertainty indicates words that are rare or where dictionaries significantly disagree, providing a valuable signal for downstream applications.

Furthermore, the model successfully addresses the "label switching" problem common in mixture models. By baking the ordinal meaning into the priors, the clusters remain stable and interpretable across different training runs.

Limitations and Future Work

While powerful, the model's performance is sensitive to the configuration of its ordering transformations. Currently limited to English, future work could expand this to multilingual contexts. Additionally, while the word-level model is efficient, document-level extensions like Ordered LDA are computationally intensive, requiring significant GPU resources.

Conclusion

By reframing sentiment as an ordinal latent variable, this work provides a principled way to unify the fragmented landscape of sentiment lexicons. ORDSCALE offers a robust, interpretable, and high-coverage tool that respects the nuanced, ranking-based nature of human language.

Summary updated

BibTeX
@inproceedings{stoehr2023sentiment,
  author = {Niklas Stoehr and Ryan Cotterell and Aaron Schein},
  title = {{Sentiment as an Ordinal Latent Variable}},
  booktitle = {EACL},
  year = {2023},
  doi = {10.18653/v1/2023.eacl-main.8},
}
Figure