Applied Sciences (Apr 2021)

Examining Attention Mechanisms in Deep Learning Models for Sentiment Analysis

  • Spyridon Kardakis,
  • Isidoros Perikos,
  • Foteini Grivokostopoulou,
  • Ioannis Hatzilygeroudis

DOI
https://doi.org/10.3390/app11093883
Journal volume & issue
Vol. 11, no. 9
p. 3883

Abstract

Read online

Attention-based methods for deep neural networks constitute a technique that has attracted increased interest in recent years. Attention mechanisms can focus on important parts of a sequence and, as a result, enhance the performance of neural networks in a variety of tasks, including sentiment analysis, emotion recognition, machine translation and speech recognition. In this work, we study attention-based models built on recurrent neural networks (RNNs) and examine their performance in various contexts of sentiment analysis. Self-attention, global-attention and hierarchical-attention methods are examined under various deep neural models, training methods and hyperparameters. Even though attention mechanisms are a powerful recent concept in the field of deep learning, their exact effectiveness in sentiment analysis is yet to be thoroughly assessed. A comparative analysis is performed in a text sentiment classification task where baseline models are compared with and without the use of attention for every experiment. The experimental study additionally examines the proposed models’ ability in recognizing opinions and emotions in movie reviews. The results indicate that attention-based models lead to great improvements in the performance of deep neural models showcasing up to a 3.5% improvement in their accuracy.

Keywords