NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Improving Document-Level Sentiment Analysis with User and Product Context

Chenyang Lyu, Jennifer Foster, Yvette Graham

TL;DR

This paper tackles the challenge of accurately predicting sentiment in product reviews by going beyond just the text of the current review. The authors propose a novel neural architecture that leverages all historical reviews from a given user and for a given product, significantly improving state-of-the-art sentiment analysis performance.

What Problem Does This Paper Address?

Document-level sentiment analysis aims to determine the overall sentiment (positive, negative, neutral) expressed in a piece of text, often product reviews. While previous work has shown the benefit of incorporating user and product information (e.g., user IDs, product IDs) into sentiment models, these approaches typically only consider the current review's text. This is a limitation because a user's writing style or a product's typical reception might be better understood by looking at their broader history. For instance, a user might use positive words sarcastically, or a product might have a mixed reputation that's only apparent across multiple reviews. The paper addresses the gap of effectively utilizing this rich historical context to enhance sentiment prediction accuracy.

Methods

The core of the proposed method, named IUPC (Incorporating User-Product Context), lies in its innovative way of representing users and products. Instead of relying solely on learned embedding vectors for user and product IDs, IUPC uses the text of all historical reviews associated with a user and a product to create richer representations.

Here's a breakdown of the key techniques:

  • BERT Encoder: The current review's text is first processed by a BERT encoder to generate a document representation.
  • Stacked Multi-Head Attention: To inject user and product context, the authors employ stacked multi-head attention. The user's historical reviews and the product's historical reviews are used as keys and values, while the current document representation acts as the query. This allows the model to selectively attend to relevant parts of the historical review text.
  • User-Product Biased Document Representation: The attention outputs for user and product are combined with the document representation to create a "biased" document representation. This bias is controlled by gating mechanisms that learn the importance of user-specific and product-specific information.
  • Incremental Update: A crucial aspect is how user and product representations are updated. Instead of recomputing everything from scratch for each new sample, IUPC incrementally stores and updates representations of reviews for a given user and product. This makes the process computationally feasible.
  • Hierarchical Architecture Dropped: Unlike some prior work that uses hierarchical structures (e.g., sentence-level then document-level), IUPC allows words in the text to directly attend to each other, simplifying the architecture.

Datasets

The paper evaluates its approach on three widely used benchmark datasets for sentiment analysis:

  • IMDB: A dataset of movie reviews.
  • Yelp 2013: A dataset of Yelp reviews.
  • Yelp 2014: Another dataset of Yelp reviews.

The authors do not introduce new datasets but focus on demonstrating the effectiveness of their method on existing, challenging benchmarks.

Key Insights and Ideas

  • Historical Context is King: The most significant insight is that leveraging the full history of a user's reviews and a product's reviews provides a substantial boost in sentiment prediction accuracy, especially for "cold-start" scenarios (users/products with few reviews).
  • Beyond Simple Embeddings: Simply learning user and product ID embeddings is insufficient. The content of past interactions is what truly unlocks better context.
  • Incremental Updates are Practical: The proposed incremental update mechanism is key to making the computationally intensive task of processing all historical reviews feasible for training.
  • Sarcasm and Mixed Sentiment are Hard: The analysis highlights that even with this advanced context, accurately predicting sentiment in cases of sarcasm or mixed sentiment (where different aspects of a product receive different ratings) remains a challenge.

Key Results

The IUPC model consistently outperforms baseline models and achieves state-of-the-art results on the evaluated datasets.

  • Overall Improvement: The paper reports improvements of more than 2 percentage points in accuracy in the best cases.
  • Specific Gains:
    • On Yelp-2013, IUPC achieved a 1.5 accuracy and 0.042 RMSE improvement over previous state-of-the-art.
  • On Yelp-2014, it achieved a 2.1 accuracy and 0.029 RMSE improvement.
  • On IMDB, it achieved a 0.01 RMSE improvement.
  • Baseline Comparison: IUPC significantly outperforms its own baselines: "BERT VANILLA" (BERT without user/product context) and "IUPC W/O UPDATE" (IUPC without incremental updates).
  • Cold-Start Performance: The model shows particular strength when users or products have fewer reviews, outperforming the "IUPC W/O UPDATE" baseline in these lower-resource scenarios.

Limitations and Future Work

  • IMDB Document Length: The authors note that their model's accuracy on IMDB is slightly lower than some previous models. They suspect this is because BERT struggles with very long documents, and the average IMDB review length is greater than the other datasets. However, they emphasize that their model still achieves the lowest RMSE on IMDB, indicating more accurate predictions overall.
  • Sarcasm and Mixed Sentiment: The analysis of misclassified cases reveals that sarcasm and reviews with mixed sentiment (e.g., "good food, bad ambiance") are difficult to handle.
  • Future Directions: The authors suggest that aspect-based sentiment analysis (ABSA) could be a promising avenue for future work to address the challenges of mixed sentiment by identifying sentiment towards specific product features. They also make their code publicly available for community use.

Summary updated

BibTeX
@inproceedings{lyu2020improving,
  author = {Chenyang Lyu and Jennifer Foster and Yvette Graham},
  title = {{Improving Document-Level Sentiment Analysis with User and Product Context}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2020},
}
Figure