S2SAN: A sentence-to-sentence attention network for sentiment analysis of online reviews

https://doi.org/10.1016/j.dss.2021.113603Get rights and content

Highlights

  • Introduce a sentence-level attention mechanism “sentence-to-sentence attention”.

  • Proposed S2SAN outperforms baselines in domain-specific, cross- and multi-domain sentiment analysis tasks.

  • Some classifiers yield better accuracy when embedded into a sentence-to-sentence attention framework.

Abstract

Many existing attention-based deep learning approaches to sentiment analysis have focused on words and represent an entire review text as a word sequence. However, these approaches overlook the differences in the importance of each sentence to the complete text. To solve this problem, some work has been performed to calculate sentence-level attention, but these studies use the same approach that is applied to word-level attention, which leads to unnecessary sequential structures and increased complexity of sentence representation. Therefore, in this paper, we propose a sentence-to-sentence attention network1 (S2SAN) using multihead self-attention. We conducted several domain-specific, cross-domain and multidomain sentiment analysis experiments with real-world datasets. The experimental results show that S2SAN outperforms other state-of-the-art models. Some classical sentiment classifiers [e.g., convolutional neural network (CNN), recurrent neural network (RNN), and long short-term memory (LSTM) models] achieve better accuracies when they are reconfigured to include sentence-to-sentence attention.

Introduction

The rise of the e-commerce industry has caused substantial changes in business models between merchants and consumers, which has enabled exponential proliferation in the number of online reviews [[1], [2], [3]]. Websites such as Amazon and Jingdong provide customers with a platform for sharing their perspectives and opinions on various products and services [4]. Rich sentiment information exists in online reviews that directly reflect the positive, negative or neutral sentiment polarity of users [5,6]. Note that reviews of products and services in online platforms offer value from a variety of perspectives. The ‘Electronic Word of Mouth’, which is a collection of reviews, is a key driver in decision-making [7,8]. On the other hand, reviews offer clues to users' latent demands and motivations, which render them conducive for improving online merchants' products and service quality [9,10]. Moreover, the potential user interests and preferences revealed in reviews provide reference information for making personalized recommendations [11]. However, the vast number of online reviews hinder the ability of both users and merchants to comprehensively extract and analyze public opinions [12]. To fully utilize the immense value of online reviews, there is a pressing need for a sentiment analysis model that can convert the overloaded sentiment information contained in reviews into a more easily understandable form.

Sentiment analysis, which is also known as opinion mining [13], is dedicated to classifying the sentiment polarity in individual review texts in our work. Previous approaches to sentiment analysis include labeling corpora that are intended for sentiment classification tasks [14,15], building sentiment lexicons [16,17], and training domain-specific sentiment classifiers [15,18,19], all of which have laid a solid foundation for sentiment analysis research. With the increasing computational ability of computers and the continual development of deep learning technology, methods that combine language models and neural networks have become mainstream approaches for solving sentiment analysis problems. These approaches are superior to traditional machine learning classifier models in terms of text representation and deep semantic understanding [12,20,21] and have greatly improved the sentiment analysis performance.

In recent years, attention-based neural network models have achieved remarkable results in many natural language processing (NLP) tasks. Additionally, a large number of studies have applied attention mechanisms to sentiment analysis. The attention mechanism in deep learning is a simulation of the visual attention of human beings [22]. Human beings always ignore information irrelevant to the target task and allocate more attention resources to important information. The attention mechanism helps improve the robustness of deep learning models by extracting useful information from a large number of inputs and allocating more attention weights to this useful information. In this regard, attention mechanisms have made satisfactory progress. Generally, attention mechanism can tell how important every entity is in an entity sequence. An illustration of the case where the entities are words is presented in Section 3.2.1.

However, to the best of our knowledge, existing attention-based neural network models focus on words [[23], [24], [25]] by representing the entire text as a word sequence. The attention weights of different words are calculated based on their similarity in a word attention layer. However, in our research, we suggest that each sentence in a text expresses a unique semantic meaning; thus, the attention weights of different sentences should be calculated individually. Although some works (such as the hierarchical attention network (HAN) proposed by Yang et al. [26]) consider sentence-level attention, most studies calculate sentence-level attention in the same way as word-level attention. However, we suggest that the approaches that directly transplant word-encoding methods into sentence-encoding have a defect: no apparent sequence-structure relationship exists between the sentences in a review, as a result, representing sentences in a review using a sequence model adds unnecessary complexity. To fill this gap, we introduce a novel sentence-to-sentence structure where self-attention is used to calculate relation weights of every two sentences. Compared with the original attention mechanism, self-attention can provide a matrix where the relations of any two entities are represented. An illustration of the case where the entities are sentences is presented in Section 3.2.2.

Our research objectives are three-fold. The first objective is to design the sentence-to-sentence attention network (S2SAN). In S2SAN, the most suitable word encoder and sentence encoder for online review texts should be figured out. The second objective is to certify whether the S2SAN is superior to the sequence of sentences network (HAN) in terms of the classification accuracy and model training time in domain-specific, cross-domain, multidomain sentiment analysis tasks. We suggest that the proposed sentence-to-sentence attention model has excellent compatibility with different word encoders. Therefore, our third objective is to verify whether some extensively applied word encoders can achieve better accuracies with the reconfiguration of sentence-to-sentence attention.

Overall, our contributions are summarized as follows:

  • To the best of our knowledge, this is the first method that uses sentence-to-sentence attention to realize the sentence-level attention mechanism. This approach disregards sentence positional information and reduces the complexity involved in building sentence sequences.

  • Aimed at online reviews, S2SAN achieves excellent results in domain-specific, cross-domain and multidomain sentiment analysis experiments. The proposed model increases accuracy by 0.8% to 2.1% and reduces the training time by an average of 25% compared to another hierarchical model (HAN).

  • In several parallel experiments, we verify that after optimization with a hierarchical structure and the sentence-to-sentence attention framework, the accuracies of some classical sentiment classifiers (e.g., convolutional neural network (CNN), recurrent neural network (RNN), and long short-term memory (LSTM) models) increase by 1.9% to 8%.

The remainder of this paper is organized as follows: Section 2 outlines the most relevant related research regarding sentiment analysis of online reviews and attention mechanisms. The sentence-to-sentence attention model is presented in Section 3. Section 4 reports the experimental results, which are derived from multiple review datasets. The experimental results are discussed in Section 5. Section 6 provides the conclusions, limitations, and suggested directions for future work.

Section snippets

Related works

Our study focuses on online reviews in e-commerce platforms and aims to detect the sentiment of review texts using a novel attention architecture. In this section, we review sentiment analysis methods of online reviews and attention mechanisms that have been reported in works on related NLP tasks.

Proposed approach: S2SAN

In this section, we present the S2SAN. The goal is to calculate sentence-level attention weights in online reviews.

Experiments and evaluation

In this section, we conduct four groups of experiments to validate whether S2SAN can yield better accuracy in domain-specific, cross-domain, and multidomain sentiment analysis tasks and whether the sentence-to-sentence attention framework is compatible with mainstream word encoders, including CNN, DNN, RNN, and LSTM.

Discussion

In this study, we conducted several groups of experiments on four data sets. The first group of experiments involved a typical domain-specific sentiment analysis task. In this group of experiments, the S2SAN model not only slightly improves the accuracy but also reduces the training time. We discovered that the two hierarchical document-representation models (HAN and S2SAN) require less training time than the general sequence models. The second experiment involved cross-domain sentiment

Conclusions

Online reviews contain a vast amount of sentiment information and have substantial value. Sentiment analysis of online reviews is a popular topic in the field of NLP. In addition, calculating the attention weights of different words in the review text using an attention mechanism has become a mainstream approach that has achieved considerable success. However, the semantics of each sentence in an online review text are individual rather than sequential, and less work has been performed on

Funding

This work was supported by the National Natural Science Foundation of China [No. 72074171] and [No. 71774121].

Acknowledgements

The numerical calculations in this paper were conducted on the supercomputing system in the Supercomputing Center of Wuhan University.

Ping Wang, associate professor, he is working at School of Information Management, Wuhan University, Wuhan, China, 430072. He will be able to contact at [email protected] if you have any questions. His research interests focus on data mining and data analysis, governmental information management, social media.

References (67)

  • S. Deng et al.

    Adapting sentiment lexicons to domain-specific social media texts

    Decis. Support. Syst.

    (2017)
  • Z. Yuan et al.

    Domain attention model for multi-domain sentiment classification

    Knowl.-Based Syst.

    (2018)
  • J.S. Deshmukh et al.

    Entropy based classifier for cross-domain opinion mining

    Appl. Comput. Inform.

    (2018)
  • J. Qiu et al.

    Leveraging sentiment analysis at the aspects level to predict ratings of reviews

    Inf. Sci.

    (2018)
  • G. Pergola et al.

    TDAM: a topic-dependent attention model for sentiment analysis

    Inf. Process. Manag.

    (2019)
  • M. Sigala

    E-service quality and web 2.0: expanding quality models to include customer participation and inter-customer support

    Serv. Ind. J.

    (2009)
  • S. Mudambi et al.

    What makes a helpful online review? A study of customer reviews on amazon.com

    MIS Q.

    (2010)
  • B. Liu

    Sentiment analysis and subjectivity

  • B. Pang et al.

    Opinion mining and sentiment analysis

    Found. Trends Inf. Retr.

    (2008)
  • X. Li et al.

    Self selection and information role of online product reviews

    Inf. Syst. Res.

    (2008)
  • L. Zhang et al.

    Sentiment analysis and opinion mining

  • M. Hu et al.

    Mining opinion features in customer reviews

  • B. Pang et al.

    Thumbs up? Sentiment classification using machine learning techniques

  • Y. Jiajun et al.

    The creation of a Chinese emotion ontology based on hownet

    Eng. Lett.

    (2008)
  • R.M. Tong

    An operational system for detecting and tracking opinions in on-line discussion

  • H. Kanayama et al.

    Deeper sentiment analysis using machine translation technology

  • B. Pang et al.

    A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts

  • D. Tang et al.

    Sentiment embeddings with applications to sentiment analysis

    IEEE Trans. Knowl. Data Eng.

    (2016)
  • V. Mnih et al.

    Recurrent models of visual attention

  • Z. Lin et al.

    A structured self-attentive sentence embedding

  • Y. Wang et al.

    Attention-based LSTM for aspect-level sentiment classification

  • Z. Yang et al.

    Hierarchical attention networks for document classification

  • D. Garcia et al.

    Emotions in product reviews--empirics and models

  • Cited by (23)

    • Enhanced Elman spike neural network based sentiment analysis of online product recommendation

      2023, Applied Soft Computing
      Citation Excerpt :

      Where, every product reviews are summarized and sentiments are categorized [14]. SA assesses the opinions of people about products, companies, services, and organization [15,16]. The connections amid the SA and product design have remained relatively unremarked despite rapid advances in SA in other fields [17].

    • Target-level sentiment analysis for news articles

      2022, Knowledge-Based Systems
      Citation Excerpt :

      Comparable results are obtained by a combination of different LSTM models (e.g., [45,46]), which achieve around 80% accuracy on different datasets. Recently in this field, Wang et al. [47] used a sentence-attention model to predict the sentiment of a whole document. Lastly, the comparison of approaches is done for aspect-level sentiment analysis (sometimes also confusingly referred to an entity- or target-level analysis [48]).

    View all citing articles on Scopus

    Ping Wang, associate professor, he is working at School of Information Management, Wuhan University, Wuhan, China, 430072. He will be able to contact at [email protected] if you have any questions. His research interests focus on data mining and data analysis, governmental information management, social media.

    Jiangnan Li, master student, she is studying at School of Information Management, Wuhan University, Wuhan, China, 430072. She will be able to contact at [email protected] if you have any questions. Her research interests focus on data mining, sentiment analysis, social media.

    Jingrui Hou, master student, he is studying at School of Information Management, Wuhan University, Wuhan, China, 430072, he will be able to contact at [email protected] if you have any questions. His research interests focus on natural language processing, sentiment analysis, deep learning.

    View full text