| Dialogue generation has always been an important research task in the field of artificial intelligence,as it has wide-ranging applications and high value.Incorporating emotions into dialogue can play an important role in improving the naturalness and fluency of dialogue responses.Currently,there are various ways to inject emotions,such as introducing emotional information into the input or encoding part of the model,or using external emotional dictionaries to encourage more attention to emotional information during the decoding process.However,existing research has mostly focused on generating responses based on specified emotional categories,leading to the need for continuous human input to judge and specify emotional categories in practical applications.In addition,most existing models cannot adjust emotional intensity well during the dialogue process,leading to an imbalance between emotional and content focus,and potentially causing problems such as unnatural emotional transitions or low-quality responses.To address these issues,this paper conducted multiple research works using deep learning techniques,as follows:(1)A multi-turn dialogue emotion recognition model based on Ro BERTa was proposed to address the problem of dialogue models lacking emotional perception and prediction capabilities.First,the Ro BERTa pre-training model with stronger text feature extraction capabilities was used as the encoder to obtain information encoding vectors.Secondly,since each round of dialogue is processed separately during the encoding process,it cannot capture the time-series relationship between different rounds of dialogue.Therefore,the encoding vectors corresponding to the <cls> character of each round of dialogue were input in chronological order into the GRU model structure.Finally,the fusion module and classification module were used to obtain the final emotion probability label vector.This model was experimentally evaluated on four datasets,including MELD,Daily Dialog,IEMOCAP,and Emory NLP.Through comparative experimental analysis,the proposed model achieved better results,indicating its superior ability in emotion recognition tasks.(2)To address the problem of imbalance between emotional and content focus in the dialogue generation process,a dynamic emotion-changing dialogue generation model based on the above emotion recognition model was proposed.The emotion vector was obtained using the above emotion recognition model.However,the above model used the argmax function to obtain a single emotional category as the emotional embedding,while a sentence often contains complex and diverse emotions,possibly involving multiple different emotions.Therefore,an emotion embedding module was proposed,which multiplied the probability matrix of emotions with a matrix containing different emotional meanings to obtain an emotion vector.At the same time,sentence-level attention mechanism was used to encode text feature vectors,and dynamic emotion control decoder was used to control the emotional intensity at different time steps,to balance emotional and content information.The model was trained end-to-end,and emotional loss function and content loss function were designed to guide the generation of responses containing correct emotions.Experimental results showed that on the MELD and Daily Dialog datasets,the proposed model outperformed other comparison models in both automatic and human evaluations.This verifies that the proposed model can better balance emotions and content during the emotional dialogue generation process,generating responses with better fluency,relevance,and diversity. |