Targeted Sentiment Classification with Attentional Encoder Network

Youwei Song, Jiahai Wang, Tao Jiang, Zhiyue Liu, Yanghui Rao

TL;DR

This paper introduces the Attentional Encoder Network (AEN), a novel model for targeted sentiment classification that replaces recurrent neural networks (RNNs) with attention-based encoders for improved parallelization and efficiency. It also addresses the challenge of unreliable "neutral" sentiment labels by incorporating label smoothing regularization and achieves state-of-the-art results by fine-tuning pre-trained BERT models.

What Problem Does This Paper Address?

Targeted sentiment classification (TSC) is a nuanced task that goes beyond general sentiment analysis by identifying the sentiment expressed towards specific entities or aspects within a sentence. For example, in "I hated their service, but their food was great," we need to determine that "service" is negative and "food" is positive. Traditional approaches often rely on Recurrent Neural Networks (RNNs) like LSTMs, which, despite their expressiveness, suffer from difficulties in parallelization and can struggle to capture long-term dependencies due to truncated backpropagation. Furthermore, the inherent ambiguity of "neutral" sentiment labels in training data poses a significant challenge, leading to unreliable training signals.

Methods

The core innovation of this paper is the Attentional Encoder Network (AEN). Instead of RNNs, AEN utilizes attention mechanisms to model the interactions between target words and their surrounding context. The model comprises:

  • Embedding Layer: Supports both pre-trained GloVe embeddings and BERT embeddings.
  • Attentional Encoder Layer: This is the key departure from prior work. It uses:
  • Multi-Head Attention (MHA): Applied in two ways:
  • Intra-MHA: For modeling context words introspectively (self-attention on context).
  • Inter-MHA: For modeling target words based on context (attention from target to context).
  • Point-wise Convolution Transformation (PCT): A lightweight convolutional layer applied after MHA to further refine contextual information.
  • Target-specific Attention Layer: Another MHA layer to generate a target-specific context representation.
  • Output Layer: A fully connected layer with softmax to predict sentiment polarity.

To tackle the issue of label unreliability, the authors introduce Label Smoothing Regularization (LSR). Instead of assigning a hard 0 or 1 to labels, LSR encourages the model to be less confident by distributing a small probability mass across all labels, particularly for the ambiguous "neutral" class. They also explore fine-tuning a pre-trained BERT model for this task, creating an AEN-BERT variant.

Datasets

The experiments were conducted on three benchmark datasets:

  • SemEval 2014 Task 4: This dataset includes two subsets: Restaurant reviews and Laptop reviews.
  • ACL 14 Twitter dataset: A dataset of tweets.

All datasets are labeled with three sentiment polarities: positive, neutral, and negative.

Key Insights and Ideas

  • Attention as a Replacement for Recurrence: The paper demonstrates that attention mechanisms, when structured as in AEN, can effectively replace RNNs for TSC, offering significant advantages in parallelization and potentially memory efficiency.
  • The "Neutral" Label Problem is Real: The authors explicitly identify and address the unreliability of neutral sentiment labels, showing that label smoothing regularization significantly improves performance, especially on datasets with a substantial neutral class. This highlights a critical, often overlooked, aspect of sentiment analysis datasets.
  • BERT's Power and the Need for Customization: Fine-tuning a pre-trained BERT model (AEN-BERT) yields substantial improvements, underscoring BERT's general language understanding capabilities. However, a custom downstream network like AEN built on top of BERT further enhances performance, suggesting that task-specific architectures are still crucial for maximizing the benefits of large pre-trained models.
  • Lightweight and Effective: The proposed AEN-GloVe model is shown to be not only effective but also significantly lighter in terms of model size and memory footprint compared to many RNN-based alternatives, making it more practical for deployment.

Key Results

  • State-of-the-Art Performance: The AEN-BERT model achieves new state-of-the-art results on the evaluated datasets, outperforming both baseline models and the basic BERT-SPC approach.
  • AEN-GloVe Competitiveness: The AEN-GloVe model also demonstrates competitive performance, often surpassing other attention-based RNN models, especially on the Restaurant dataset.
  • Impact of Label Smoothing: Ablation studies show that removing LSR leads to a significant drop in accuracy across all datasets, confirming its importance for handling unreliable neutral labels.
  • Model Size Advantage: Table 3 highlights that AEN-GloVe has a considerably smaller model size (1.16M parameters, 11.04MB memory) compared to many RNN-based models like ATAE-LSTM (2.53M parameters, 16.61MB) and RAM (6.13M parameters, 31.18MB), and even AEN-BERT (112.93M parameters, 451.84MB), while maintaining strong performance.

Limitations and Future Work

  • Model Size of AEN-BERT: While AEN-BERT achieves SOTA, its large model size is a limitation compared to AEN-GloVe.
  • Further Exploration of Label Smoothing: The paper suggests that further research into label smoothing techniques could be beneficial.
  • Domain Adaptation: The authors mention that pre-trained BERT's general knowledge might not be perfectly suited for every specific domain, implying that domain-specific fine-tuning or adaptation could be a future direction.
  • Lightweight Alternatives: The paper positions AEN-GloVe as a lightweight alternative, suggesting that further research into even more efficient architectures for TSC is warranted.

Summary updated

BibTeX
@inproceedings{song2019targeted,
  author = {Youwei Song and Jiahai Wang and Tao Jiang and Zhiyue Liu and Yanghui Rao},
  title = {{Targeted Sentiment Classification with Attentional Encoder Network}},
  booktitle = {ICANN},
  year = {2019},
  doi = {10.1007/978-3-030-30490-4\_9},
}
Figure