A Lexicon-Based Supervised Attention Model for Neural Sentiment Analysis

Yicheng Zou, Tao Gui, Qi Zhang, Xuanjing Huang

Introduction

In modern sentiment analysis, deep learning models—particularly those employing attention mechanisms—have become the standard. Attention is designed to allow a model to focus on the most relevant parts of an input sequence. However, unsupervised attention often picks up "noise"—domain-specific terms that happen to correlate with sentiment in a specific training set but do not generalize well. For instance, in movie reviews, a specific actor's name might receive high attention because their films are generally well-received, despite the name itself carrying no inherent sentiment.

To address this, we present Lexicon-Based Supervised Attention (LBSA), a method that bridges the gap between traditional linguistic resources and modern neural architectures. By using sentiment lexicons to "supervise" the attention mechanism, LBSA forces the model to focus on known sentiment-carrying words, improving both predictive performance and model interpretability.

Methodology

The LBSA model is built upon a hierarchical BiLSTM architecture, which processes text at both the word and sentence levels. The core innovation lies in the supervision of the attention weights.

Sentiment Degree and Gold Attention

The authors define a "sentiment degree" for words by aggregating four major lexicons: SentimentWordNet 3.0, MPQA, Stanford Sentiment Treebank (SST), and Hownet (HKD). This combined resource covers over 156,000 tokens. The sentiment degree is the absolute value of a word's sentiment score, capturing its intensity regardless of polarity (e.g., "excellent" and "terrible" both have high degrees). These degrees are used to construct "gold" attention distributions that represent the ideal focus of the model according to linguistic theory.

Multi-Task Learning

Unlike standard models that optimize solely for classification accuracy, LBSA employs a multi-task loss function:

  1. Classification Loss: Standard cross-entropy loss for sentiment prediction (e.g., star ratings).
  2. Attention Loss: A measure of the discrepancy between the model's learned attention weights and the "gold" lexicon-based weights.

This supervision occurs at two levels: the word level (identifying important words within a sentence) and the sentence level (identifying important sentences within a document).

The hierarchical architecture of the LBSA model, showing the integration of word and sentence encoders with supervised attention layers.

Experimental Setup

The model was evaluated on three large-scale document-level review datasets:

  • IMDB: 67,426 training samples across 10 classes.
  • Yelp 2013: 62,522 training samples across 5 classes.
  • Yelp 2014: 183,019 training samples across 5 classes.

These datasets provide a rigorous testing ground for document-level sentiment classification, where identifying key sentences is as crucial as identifying key words.

Results and Discussion

LBSA consistently outperformed both traditional lexicon-based methods and state-of-the-art unsupervised attention models across all metrics.

Quantitative Performance

As shown in the results table, LBSA achieved superior accuracy and lower Root Mean Squared Error (RMSE) compared to standard Hierarchical LSTMs and BiLSTMs. On the IMDB dataset, the H-BiLSTM + LBSA variant reached an accuracy of 0.494, a significant improvement over the base H-BiLSTM (0.484).

Experimental results comparing LBSA variants against various baselines on IMDB and Yelp datasets.

Interpretability and Robustness

A key advantage of LBSA is its reduced sensitivity to domain bias. By anchoring attention to a general-purpose lexicon, the model learns to ignore entities like "Leonardo DiCaprio" and instead focus on descriptive adjectives like "charismatic." Qualitative visualizations confirm that LBSA produces "cleaner" attention heatmaps that align more closely with human intuition, pinpointing the specific modifiers that drive sentiment.

Conclusion

LBSA demonstrates that explicit supervision of internal neural components using prior linguistic knowledge is a powerful technique for NLP. While the model's performance is tied to the coverage of the underlying lexicons, it offers a more robust and interpretable alternative to purely unsupervised attention mechanisms. Future work may involve semi-supervised lexicon expansion to further improve coverage in niche domains.

Summary updated

BibTeX
@inproceedings{zou2018lexicon,
  author = {Yicheng Zou and Tao Gui and Qi Zhang and Xuanjing Huang},
  title = {{A Lexicon-Based Supervised Attention Model for Neural Sentiment Analysis}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2018},
}
Figure