Open-domain dialog system is an important research area in natural language processing with a wide range of application prospects.Perceiving emotions of users as well as generating responses with emotions are of great significance for open-domain dialog systems.Most of the prior work in emotional dialogue response generation is based on the Seq2Seq architecture,while large-scale pre-trained models based on the Transformer architecture have become the mainstream approach in natural language processing.Therefore,this thesis investigates emotional dialogue response generation based on pre-trained models,and proposes two approaches to incorporate emotions,including emotional embedding and multi-task learning.The detailed contents are as follows.(1)We propose EmoDialoGPT,an emotional response generation model based on emotion embedding.This model introduces emotion embedding and emotion prediction loss based on the pre-trained model DialoGPT,and designs three different emotion embedding methods,including a separate emotion embedding layer,a special emotion tag attached to the beginning of the source utterance,and a special emotion tag attached to the end of the source utterance.To obtain a large-scale dialogue dataset with emotion labels to train the EmoDialoGPT model,a textual emotion classifier is first learned to automatically label the large-scale dialogue dataset with emotion labels.We apply the model to the generation of emotional responses in both English and Chinese,respectively,and evaluate the model in three aspects:accuracy of emotional expression,automatic evaluation of response quality,and manual evaluation of response quality.The experimental results show that the EmoDialoGPT model can well generate responses expressing the specified emotions and outperform the baseline models in most metrics.Moreover,a separate emotion embedding layer achieves the best performance among the three emotion embedding methods.(2)We propose EmoDialogBART,an emotional response generation model based on multi-task learning.This model incorporates response generation and emotion recognition as two tasks into the framework of multi-task learning,so that the response generation model can perceive emotions by sharing parameters.The number of tasks in multitask learning can be controlled according to the different granularities of emotions.The model is evaluated in terms of three aspects:emotion recognition,automatic evaluation of response quality,and manual evaluation of response quality.The experimental results show that the EmoDialogBART model can well perceive the emotions of source utterances and generate responses with appropriate emotions,and outperform baseline models in most metrics.The comparison experiments on the datasets DailyDialog and OpenSubtitles show that a high-quality dialogue dataset can significantly improve the quality of the generated responses. |