Sentiment Analysis of Hybrid Network Model Based on Attention

Sentiment Analysis of Hybrid Network Model Based on Attention

Wenqian Shang, Hongzhan Zhen, Wanyu Zhang
Copyright: © 2023 |Pages: 17
DOI: 10.4018/IJSI.327364
Article PDF Download
Open access articles are freely available for download


The existing text sentiment analysis models based on deep learning and neural network usually have problems such as incomplete text feature extraction and failure to consider the impact of key information on text sentiment tendency. Based on the parallel hybrid network and the two-way attention mechanism, an improved text sentiment analysis model is proposed. The model first takes the word vector trained by the BERT language model as the input, and then extracts the global and local features of the context simultaneously through the parallel hybrid neural network constructed by the Convolution Neural Network (CNN) and The Bidirectional Gated Recurrent Unit (BiGRU), so as to improve the feature extraction ability of the model. It also integrates the dual-way attention mechanism to strengthen the key information in the global feature and local feature, and the feature vectors obtained by feature fusion are used for sentiment analysis.
Article Preview


With the rapid development of the Internet, the era of big data has arrived. More and more people express their opinions and share their feelings online, resulting in massive data. Because of the text creator’s position and preferences, the created text will have different emotional colors, showing different positive or negative attitudes. Making full use of and analyzing the user comments on such software, digging into the text content, and extracting deep information from the text will play a certain guiding role in the consumption choice of users, the decision-making of businesses and enterprises, and the monitoring of public opinions.

Sentiment analysis in the field of natural language processing (NLP) is an important branch, which is the application of natural language processing and text mining technology. Sentiment analysis emphasizes the subjectivity of color with emotional text analysis, processing, and extraction (Pang et al., 2008). It is used for feature extraction of text content, so as to help users quickly understand the emotional tendency of corresponding text. There are two kinds of sentiment analysis techniques widely used at present. The first one is the sentiment analysis of the sequence based on a pre-prepared sentiment dictionary (Zhang et al., 2018). According to the sentiment dictionary, different sentiment scores are assigned to the word segmentation results of the text content. Finally, the corresponding sentiment categories are output according to the scores. This method is relatively simple, but it requires a large sentiment dictionary and too much domain knowledge, and the data is difficult to collect and does not have good mobility. Thus, the effect is not very good. The second one is to use the traditional machine learning (2019) method to carry out a sentiment analysis of the text. This method needs to collect and label the features manually and then use machine learning algorithms such as decision trees and support vector machines for sentiment analysis. Although machine learning algorithms show good performance in sentiment analysis tasks, it is impractical to collect, process and label large texts manually. Therefore, it has become an urgent demand for people to use computers to automatically process and analyze data and quickly obtain valuable content. The development of deep learning has made it possible to use machines to automatically extract text features without having to annotate them manually. Compared with traditional machine learning, deep learning can spontaneously capture the deep information of text at the level of natural language, which significantly improves the accuracy and efficiency of text sentiment analysis.

With the wide application of deep learning in the field of sentiment analysis, many new neural network models have been proposed and improved, which show good results in the task of sentiment analysis. In recent years, some scholars have proposed the mechanism of Attention and applied it to the task of text sentiment analysis (Niu et al., 2021). The attention mechanism mimics the biological visual system, being able first to notice the most valuable features of data and extract the more critical information about the data. In order to capture the more emotionally inclined words in the text, this paper introduces the attention mechanism into the sentiment analysis task.

The innovations and contributions of this paper are as follows:

  • A hybrid neural network sentiment analysis model (BCBA) based on the attention mechanism was constructed. In the text preprocessing stage, the BERT model is used to input the text word vector output produced by the BERT model into the hybrid neural network of CNN and BiGRU and integrate this vector into the attention mechanism. The model can better extract the features of the text and explore the emotional attributes.

  • The corresponding benchmark model is established. In order to compare and analyze the mixed network model in this paper, the relevant benchmark model is set up. The language models used in the text preprocessing stage of model training are all BERT models, and the benchmark models are as follows: the CNN-fully connected-attention, CNN-BiGRU, CNN-BiLSTM-attention, CNN-attention, and BiGRU-attention models. We provide comparative experiments for the models in this paper.

Complete Article List

Search this Journal:
Volume 12: 1 Issue (2024)
Volume 11: 1 Issue (2023)
Volume 10: 4 Issues (2022): 2 Released, 2 Forthcoming
Volume 9: 4 Issues (2021)
Volume 8: 4 Issues (2020)
Volume 7: 4 Issues (2019)
Volume 6: 4 Issues (2018)
Volume 5: 4 Issues (2017)
Volume 4: 4 Issues (2016)
Volume 3: 4 Issues (2015)
Volume 2: 4 Issues (2014)
Volume 1: 4 Issues (2013)
View Complete Journal Contents Listing