| Text sentiment analysis is one of the important research directions of natural language processing.Dialogic sentiment analysis is a new research field of text sentiment analysis,which refers to analyzing the sentiment of each sentence in the context of multiple rounds of dialogue.This research may better help the machine understand the real-world communication,and promote the development of many fields such as data mining,human-computer interaction and so on.Although there have been many outstanding achievements in the field of text sentiment analysis,there are still many problems to be solved in the context of dialogue.This paper mainly focuses on the following points:1)the same dialogue text will convey different emotions in different contexts;2)when the number of dialogue rounds is large,the current research can not get the information interaction between dialogues well;3)different from the traditional sentiment classification of short texts or documents,the scale of sentiment database in dialogue scenes is generally small;4)The current model does not consider the information interaction between the dialogue subjects,but the information of the dialogue subjects is very important in the emotional analysis of the dialogue scene.In order to solve the above problems,this paper proposes a hierarchical framework to deal with the task of sentiment analysis in dialogue scenes,using a two-layer model to model single sentence features and information interaction between sentences respectively.This paper proposes two models based on this structure:the hierarchical text CNN model(Convolution neural network,CNN)and the hierarchical transformer model.The main structure of the hierarchical text CNN model is divided into two layers:the convolutional neural network model is used to model the information interaction between words in the segment,so as to obtain the single segment coding;the attention mechanism is used to model the information interaction between different segments in the dialogue process.In addition,the hierarchical text CNN model performs well in terms of both the data evaluation index of the experimental results and the visualization effect,which proves the effectiveness of the model.Furthermore,this paper improves the data input source of the hierarchical text CNN model,uses the more powerful feature extraction model transformer to replace the convolution neural network and attention mechanism in the hierarchical text CNN model,and then proposes the hierarchical transformer model.To solve the problem of small data scale,we use the pre training model Bert as the specific implementation of the underlying transformer,which is equivalent to the introduction of external data,to a certain extent to alleviate the problem of small-scale database.In order to solve the problem of information interaction between speakers,we first added the speaker embedding,which makes our model capture the information interaction between the speakers.On three standard data sets(friends,emotionpush,emorynlp),the hierarchical transformer model proposed in this paper is excellent in macro F1 and other indicators,which proves the validity of the proposed model.Finally,based on the model proposed in this paper,the dialogue scene sentiment analysis system is designed and implemented,and the system function and performance test are completed. |