Font Size: a A A

Research On Sentiment Analysis Method Based On Transformer

Posted on:2022-11-29Degree:MasterType:Thesis
Country:ChinaCandidate:S Y ZhangFull Text:PDF
GTID:2518306749472124Subject:Automation Technology
Abstract/Summary:PDF Full Text Request
As a social platform with a large number of participants and a large amount of information,Weibo will play a key role in the management and control of network security by doing emotional sorting of its data.Sentiment analysis is a common method to deal with this task.Considering that sentiment analysis methods based on traditional dictionaries and machine learning rely too much on manual construction of dictionaries and selection of features,this thesis chooses a deep learning method with stronger generalization ability,which can efficiently process large amounts of data and automatically extract features to construct a model.The microblog texts with emotional color are sorted and analyzed,and eight kinds of emotional classifications of the texts are finally obtained.On the basis of choosing a deep learning model as the research target,considering that convolutional neural networks and recurrent neural networks and their variants have many problems in dealing with sentiment analysis problems,for example,it is difficult to achieve a high accuracy rate by using a single model,giving equal weight to words,etc.Starting from their structure,advantages and disadvantages,the main research work of this paper is as follows:(1)For text sentiment analysis,which focuses on the positive and negative binary sentiment classification of texts,this thesis divides Weibo texts into eight categories of sentiments,namely: like,happy,sad,disgusting,angry,shocked,scared,and indifferent.Emotion,a mo re detailed classification of Weibo emotions to achieve more targeted application effects.(2)Using the self-attention mechanism for the deep learning model Transformer can better pay attention to the contextual semantics of the text,but ignore the local feature information.TextCNN can extract local semantic features well,but its ability to extract longdistance information is weak.The model designed in this thesis uses the self-attention mechanism in the Transformer to simulate the human brain nervous system to extract the features of the microblog text and then input it into the TextCNN layer,convolve the word vectors to obtain the time series information between adjacent word vectors,and then the model is optimized by activation function,and finally the temporal attention weights obtained by the convolutional layers are applied to text classification.This thesis designs different model comparison experiments.The experimental results show that the proposed emotion classification models Transformer+TextCNN(Tanh)and Transformer+TextCNN(ReLU)combined with Transformer and TextCNN have a greater improvement than the machine learning model,and the accuracy rate is higher than that of Transformer.The model has 0.38% optimization.(3)For the Transformer+TextCNN sentiment classification model proposed in this thesis,different parameter comparison experiments are designed,including Batchsize value,Epoch value and Dropout value.The experimental results show that the experimental effect is the best when the Batchsize parameter is set to 48,the Epoch parameter is set to 20,and the Dropout parameter is set to 0.5.
Keywords/Search Tags:Text sentiment analysis, Microblog, Transformer, Self-attention mechanism, TextCNN
PDF Full Text Request
Related items