A method and system for generating emotions of a dialogue system in a dialogue scenario

By modeling the relationship between personality, emotion and emotion in the dialogue system, and using dialogue information and personality information to perform emotional state reasoning, the problem of insufficient anthropomorphism of emotional responses in the existing technology is solved, and higher anthropomorphic emotional expression and User satisfaction.

CN118036745BActive Publication Date: 2024-09-24INNER MONGOLIA UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410174004.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-07
Publication Date
2024-09-24
Estimated Expiration
2044-02-07

AI Technical Summary

Technical Problem

Existing dialogue systems ignore the subjectivity of emotions and different personality characteristics when generating artificial emotions, resulting in emotional responses that are not anthropomorphic enough and affect user satisfaction and anthropomorphism.

Method used

By modeling the relationship between 'personality', 'emotion' and 'emotion' in the dialogue system, the limited dialogue information and personality information are used to achieve the emotional state inference generation of the specified personality, and the user's personality emotion information and emotional reasoning information at the current moment are calculated. and emotional memory elements, combining the emotional flow control value and the time flow control value to calculate the emotional state of the dialogue system.

Benefits of technology

It improves the anthropomorphism of emotional expression, makes the dialogue system closer to the user's personalized characteristics when generating emotions, and improves user satisfaction and the anthropomorphism of the dialogue system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118036745B
    Figure CN118036745B
Patent Text Reader

Abstract

The present invention discloses an emotion generation method and system of a dialogue system in a dialogue scene, which relates to the field of artificial intelligence technology, including obtaining the current emotional state, the short-term emotional memory of the previous moment, and the specified personality characteristics, calculating the emotional information input amount, emotional reasoning information, and candidate emotional memory elements; obtaining the medium-term emotional memory, short-term emotional memory, and the emotional state of the current moment from the previous moment, and calculating the emotional flow control value; calculating the emotional memory state of the current moment according to the short-term emotional memory of the previous moment, the emotional information input amount, the candidate emotional memory element, and the emotional flow control value; calculating the time flow control value according to the short-term emotional memory, long-term emotional memory, and emotional memory element of the previous moment; and multiplying the emotional reasoning information with the time flow control value to obtain the emotional state of the dialogue system. The present invention models the relationship between "personality", "emotion", and "emotion" in the dialogue, and improves the anthropomorphism of the emotional expression of the dialogue system to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and more specifically to a method and system for generating emotions in a dialogue system in a dialogue scenario. Background Art

[0002] At present, open-domain dialogue generation models have been widely studied and developed. In order to improve the anthropomorphism and empathy of the dialogue system, the system needs to correctly understand the user's emotions and make appropriate emotional responses. Early emotional dialogue generation models did not have the ability to reason about emotions, but instead took specified emotion labels as input to generate emotional dialogue responses. However, in real dialogue scenarios, direct emotion labels are often not provided, but the dialogue system is required to perceive the user's emotions based on the dialogue content and then generate empathetic responses. Therefore, the task of artificial emotion generation is derived from the emotion generation task. The goal is to combine the relevant influencing factors of emotion generation and decide on appropriate artificial emotions to guide the generation of dialogue responses.

[0003] Current artificial emotion generation methods mostly follow the paradigm of multi-task learning, and achieve generation with emotional constraints by jointly training an emotion prediction task and a dialogue generation task. Most of these methods improve the generation of emotional responses from two aspects. One type of method focuses on improving the prediction accuracy of emotions by introducing external knowledge, exploring the causes of emotions, and modeling more fine-grained emotional information; the other type of method focuses on improving the generation strategy, based on reinforcement learning, hybrid expert models, simulating speaker emotions, etc. However, existing methods mostly focus on modeling emotions and semantics, while ignoring the subjectivity of emotions. People with different personality traits will have different emotions in the same situation. The possibility of having the same emotional response to users with different personalities is not conducive to improving user satisfaction and anthropomorphism of the dialogue system.

[0004] Therefore, how to make the generated artificial emotions more humanized is a problem that technical personnel in this field urgently need to solve. Summary of the invention

[0005] In view of this, the present invention provides an emotion generation method and system for a dialogue system in a dialogue scenario. The present invention models the relationship between "personality", "emotion" and "emotion" in the dialogue, and uses limited dialogue information and personality information to achieve inference and generation of the emotional state of a specified personality, thereby improving the anthropomorphism of emotional expression to a certain extent.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] A method for generating emotions of a dialogue system in a dialogue scenario, comprising:

[0008] Obtain the user's current emotional state, the previous short-term emotional memory, and the specified personality characteristics, and calculate the user's current personality emotional information input, emotional reasoning information, and candidate emotional memory elements;

[0009] Obtaining the medium-term emotional memory of the user's emotional tendency at the last moment, the short-term emotional memory at the last moment, and the emotional state of the user at the current moment, and calculating the emotional flow control value through the emotional perception cells;

[0010] Calculating the emotion memory element according to the short-term emotion memory at the previous moment, the amount of personality emotion information input at the current moment, the candidate emotion memory element, and the emotion flow control value, and further calculating the emotion memory state at the current moment;

[0011] Calculating a time flow control value through timing perception cells according to the short-term emotional memory of the previous moment, the long-term emotional memory from the personality of the previous moment, and the emotional memory element;

[0012] The emotional state of the dialogue system at the current moment is obtained by multiplying the emotional inference information with the time flow control value.

[0013] Preferably, the calculation of the user's current personality emotion information input amount, emotion reasoning information, and candidate emotion memory elements specifically includes:

[0014]

[0015]

[0016] Among them, i T is the amount of personality and emotional information input by the user at time T, h T-1 is the short-term emotional memory at time T-1, is the user's emotional state at time T, P S is the specified user's Big Five personality traits, W and b are the trainable network model weights and bias values, respectively, o T is the emotional reasoning information at time T, m T is the candidate emotion memory element at time T.

[0017] Preferably, the calculating of the emotion flow control value specifically includes:

[0018]

[0019] Among them, s T-1 is the medium-term emotional memory from emotional tendency at time T-1, e EAC Control value for the emotion flow.

[0020] Preferably, the calculation of the emotional memory state at the current moment specifically includes:

[0021] N T =e EAC *s T-1 +i T *M T ;

[0022] c T =e EAC *c T-1 +i T *M T ;

[0023] Among them, c T-1 is the long-term emotional memory from personality at time T-1, N T is the emotional memory element, c T is the emotional memory state at time T.

[0024] Preferably, the calculation of the time flow control value specifically includes:

[0025] R T =TAC(h T-1 ,N T ,c T-1 );

[0026] Among them, R T is the time flow control value.

[0027] Preferably, obtaining the emotional state of the dialogue system at the current moment specifically includes:

[0028]

[0029] in, is the emotional state of the dialogue system at time T.

[0030] An emotion generation system for a dialogue system in a dialogue scenario, comprising:

[0031] A calculation module, which obtains the user's current emotional state, the previous short-term emotional memory and the specified personality characteristics, and calculates the user's current personality emotional information input, emotional reasoning information and candidate emotional memory elements;

[0032] The emotion flow control value module obtains the medium-term emotion memory of the emotion tendency of the user at the previous moment, the short-term emotion memory at the previous moment and the emotion state of the user at the current moment, and calculates the emotion flow control value through the emotion perception cells;

[0033] The emotional memory state module calculates the emotional memory element according to the short-term emotional memory at the previous moment, the amount of personality emotional information input at the current moment, the candidate emotional memory element, and the emotional flow control value, and further calculates the emotional memory state at the current moment;

[0034] A time control value module, which calculates a time flow control value through a timing perception cell according to the short-term emotional memory of the previous moment, the long-term emotional memory from the personality of the previous moment and the emotional memory element;

[0035] The system emotional state module multiplies the emotional reasoning information by the time flow control value to obtain the emotional state of the dialogue system at the current moment.

[0036] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a method and system for generating emotions in a dialogue system in a dialogue scenario. The present invention models the relationship between "personality", "emotion" and "emotion" in the dialogue, and uses limited dialogue information and personality information to realize the inference generation of the emotional state of a specified personality, thereby improving the humanization of emotional expression to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0038] Figure 1 The accompanying drawing is a schematic diagram of the method steps provided by the present invention;

[0039] Figure 2 The accompanying drawing is a schematic diagram of emotional reasoning for a specified personality provided by the present invention;

[0040] Figure 3 The accompanying drawing is a diagram of the structure of emotion perception cells provided by the present invention;

[0041] Figure 4 The accompanying drawing is a diagram of the structure of timing sensing cells provided by the present invention;

[0042] Figure 5 The accompanying drawing is a schematic diagram of the model training accuracy provided by the present invention;

[0043] Figure 6 The accompanying drawing is a schematic diagram of the model training loss value provided by the present invention. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] The embodiment of the present invention discloses a method for generating emotions of a dialogue system in a dialogue scene, such as Figure 1 As shown, including:

[0046] S1: Obtain the user's current emotional state, the previous short-term emotional memory and the specified personality characteristics, and calculate the user's current personality emotional information input, emotional reasoning information and candidate emotional memory elements;

[0047] S2: Obtain the medium-term emotional memory of the user's emotional tendency at the previous moment, the short-term emotional memory at the previous moment, and the user's current emotional state, and calculate the emotional flow control value through the emotional perception cells;

[0048] S3: Calculate the emotion memory element based on the short-term emotion memory of the previous moment, the amount of personality emotion information input at the current moment, the candidate emotion memory element, and the emotion flow control value, and further calculate the emotion memory state at the current moment;

[0049] S4: Calculate the time flow control value through timing perception cells based on the short-term emotional memory of the previous moment, the long-term emotional memory from the personality of the previous moment, and the emotional memory element;

[0050] S5: Multiply the emotional reasoning information by the time flow control value to obtain the emotional state of the dialogue system at the current moment.

[0051] In a specific embodiment, calculating the current moment personality emotion information input amount, emotion reasoning information, and candidate emotion memory elements of the user specifically includes:

[0052]

[0053]

[0054] Among them, i T is the amount of personality and emotional information input by the user at time T, h T-1 is the short-term emotional memory at time T-1, is the user's emotional state at time T, P S is the specified user's Big Five personality traits, W and b are the trainable network model weights and bias values, respectively, o T is the emotional reasoning information at time T, m T is the candidate emotion memory element at time T.

[0055] In a specific embodiment, calculating the emotion flow control value specifically includes:

[0056]

[0057] Among them, s T-1is the medium-term emotional memory from emotional tendency at time T-1, e EAC Control value for the emotion flow.

[0058] In a specific embodiment, the emotion flow control value is calculated by the emotion perception cell EAC, such as Figure 3 As shown, specifically including:

[0059] EAC is based on the short-term emotional memory h at time T-1. T-1 , the medium-term emotional memory from emotional tendency at time T-1, the emotional state of the user at time T e T U is the input, and the corresponding emotional flow control value e EAC As cell output, it realizes the coherence control of emotions from the emotional memory stream. EAC can be formally defined as follows, and its calculation process is obtained by formulas (1-2) to (1-5).

[0060]

[0061] Input feature hidden state The hidden state h at time T-1 is represented by the aggregation of the dialogue history features T-1 The attention operation is calculated once. The calculation process is as shown in formula (1-2). EAC intermediate state h EAC Calculated by formula (1-3), where h TAC It is the intermediate state of the process of time-series perception cell TAC. The final output result of EAC is e EAC As shown in formula (1-4), Attenion(·) is the attention operation; is a vector multiplication operation; is the vector concatenation operation; ⊙ is the Hadamard product; softmax and FC are the softmax activation function and the fully connected operation respectively.

[0062]

[0063]

[0064] The optimization objective function of EAC is as shown in formula (1-5); and the control performance of the model is improved by minimizing the cross entropy loss function (see formulas (1-6) to (1-7)).

[0065]

[0066] where y c is the indicator variable of the loss function; p c is the probability that the emotional state inferred at the current moment is c; e is the actual emotional state of the current response.

[0067] In a specific embodiment, calculating the emotional memory state at the current moment specifically includes:

[0068] N T =e EAC *s T-1 +i T *M T ;

[0069] c T =e EAC *c T-1 +i T *M T ;

[0070] Among them, c T-1 is the long-term emotional memory from personality at time T-1, N T is the emotional memory element, c T is the emotional memory state at time T.

[0071] In a specific embodiment, calculating the time flow control value specifically includes:

[0072] R T =TAC(h T-1 ,N T ,c T-1 );

[0073] Among them, R T is the time flow control value.

[0074] Among them, EAC controls the rationality of generating emotions from the emotional sequence flow, while the timing perception cell TAC controls the emotions from the time sequence flow. Figure 4 Inspired by the good performance of the BERT model in time series prediction tasks, TAC is also implemented using the Transformer encoder structure, and EAC uses the emotion memory element N t As input, the emotional memory state c is introduced in the two TRM module processes T-1 and the short-term emotional memory h at time T-1 T-1 The consistency of emotion transition in the dialogue sequence flow is achieved, and the rationality of generated emotions is enhanced. TAC can be formally defined as formula (1-8), and its calculation process can be expressed by formulas (1-9) to (1-12).

[0075] e TAC =TAC(h T-1 ,N T ,c T-1 ) (1-8)

[0076] Input feature hidden state The short-term emotional memory h at time T-1 is represented by the aggregation of the dialogue history features. T-1 Perform a self-attention mechanism and feedforward network calculation of the Transformer encoder Trm as shown in formula (1-10). The intermediate state h of TAC TAC Calculated by formula (1-11). The final output of TAC is e TAC Calculated by formula (1-12) to (1-13). Where h tmp A temporary state variable.

[0077]

[0078] h tmp =Trm(h TAC ) (1-11)

[0079] e TAC =softmax(h tmp ) (1-12)

[0080] The objective optimization function and loss function of TAC are the same as those of EAC. It still uses probability optimization and minimization of cross entropy function to improve model performance (see formulas 1-13 to 1-15).

[0081]

[0082] where y c is the indicator variable of the loss function; p c is the probability that the emotional state inferred at the current moment is c; e is the actual emotional state of the current response.

[0083] In a specific embodiment, obtaining the emotional state of the dialogue system at the current moment specifically includes:

[0084]

[0085] in, is the emotional state of the dialogue system at time T.

[0086] Emotional state of the dialogue system at time T The detailed calculation process is shown in formulas (1-16) to (1-24).

[0087]

[0088] N T =e EAC *s T-1 +i T *m T (1-19)

[0089] c T =eEAC *c T-1 +i T *m T (1-20)

[0090] R T =TAC(h T-1 ,N T ,c T-1 ) (1-21)

[0091]

[0092] r T =σ(W T *h T +b r ) (1-23)

[0093] s T =r T *N T (1-24)

[0094] In the above formula, σ and tanh represent the sigmoid and tanh activation functions respectively; W and b are the trainable network model weights and bias values, P S is the value specified by the user's Big Five personality traits; T-1 It refers to the user's medium-term emotional memory from emotional tendency at time T-1; h T is the short-term emotional memory at time T; c T It is the long-term emotional memory from the personality at time T; is the emotional state of the dialogue system at time T, is the user's emotional state at time T; T is the emotional reasoning information at time T; U represents the user.

[0095] In one embodiment, the method of the present invention is modeled as follows: Figure 2 As shown in the figure, during the SPEIU model training phase, conversation history, personality traits, and sentiment sequences and emotion sequences of multiple rounds of conversations are used as model inputs to participate in the training process, and the accuracy of model generation is optimized by minimizing the cross entropy loss function.

[0096] The objective function and loss function of model training are shown in formulas (2-1) to (2-3).

[0097]

[0098]

[0099] In the above formula, y ic is an intermediate indicator variable. If the generated emotional state c is different from the real emotional state ei If the pair is consistent, its value is 1, otherwise it is 0; ic is the probability of generating the emotional state c of the current reply sentence i, L(·) refers to the loss function of model training, where y ic is the intermediate indicator variable, p ic is the probability of generating the current response sentence i with emotional state c. Formula 2-1 is the objective function of model training, M is the total number of dialogue rounds, P() is the conditional probability, is the set of emotional states (happy, like, frustrated, sad, happy, none) of the generated dialogue system, is the user’s input up to the mth round, P n For the user's Big Five personality, is the set of emotional (positive, negative, neutral) states of user U and dialogue system R up to m rounds, is the set of emotional states of user U and dialogue system R at the end of round m. The goal of this model is to find the probability of each emotional state (happy, like, depressed, sad, happy, nothing) of the dialogue system at time m, and select the emotional state with the highest probability as the final generated result.

[0100] The iterative update algorithm during the training process is shown in Table 1, where θ is the trained network model parameter.

[0101] Table 1 SPEIU training algorithm

[0102]

[0103] For the specified personality emotional state generation experiment, the model of the present invention is compared with the current mainstream time series deep neural network prediction models, including LSTM, Bi-LSTM, Bi-LSTM+ATT, GRU, Transformer, IDS-EC and PET-BERT. The Chinese word list size used in the experiment is 11021, the English word list size is 40000, and the same hyperparameters are used for LSTM, LSTM, Bi-LSTM, Bi-LSTM+ATT, GRU and SPEIU with similar model structures; the embedding dimension is set to 128, the number of network layers is 2, the drop rate is 0.5, the hidden dimension is 256, and the Adam optimizer is used, and the batch size and learning rate are 128 and 0.001 respectively; the Transformer hyperparameters use the default parameters, and the hyperparameters of IDS-EC are: embedding dimension 64, hidden dimension 256, drop rate 0.2, network layer number 1, maximum sequence length 64, batch size and learning rate are consistent with LSTM. All models were trained for 50 rounds on a Nvidia-RTX2060 Super computing card under the Pytorch framework.

[0104] The experiment of generating emotional states of a specified personality can be conducted by evaluating the accuracy of the proposed unit in generating emotions. However, due to the subjectivity of emotions themselves, a combination of automatic and manual evaluation is used to conduct experimental evaluation.

[0105] Automatic evaluation indicators

[0106] Precision (P): Precision refers to the ratio of the number of correctly classified positive samples to the number of samples determined as positive samples by the classifier, which is the precision rate.

[0107]

[0108] Recall (R): Recall refers to the ratio of the number of correctly classified positive samples to the number of true positive samples, which can be regarded as the recall rate.

[0109]

[0110] F1 value (F1, F): It is the harmonic mean of precision and recall, which is the combination of the results of the two. All three values ​​are between 0 and 1. The higher the value, the higher the precision.

[0111]

[0112] Accuracy (A): It indicates the accuracy, that is, the ratio of the same samples between the judgment sample and the true sample to the total number of samples.

[0113]

[0114] Among them, S true is the number of correctly classified positive sample emotional states, is the number of samples that the model considers to be positive; S all is the number of true positive samples; S num-all The total number of samples, S num-true The model generates the same number of state emotions as the real samples.

[0115] Manual evaluation indicators

[0116] Due to the subjectivity of emotions, there is no good automatic evaluation index at this stage. Therefore, this paper conducts manual evaluation from two aspects: matching degree and appropriateness. Five reviewers are selected from the research team to score the samples generated by the model from the above two aspects.

[0117] Matching Degree is used to evaluate the matching degree between the generated emotional state and the current personality (i.e. the uniqueness of the emotion). Very matching: 2, matching: 1, mismatch: 0;

[0118] Appropriateness is used to evaluate whether the generated emotional state is appropriate. Very appropriate: 2, appropriate: 1, inappropriate: 0. The final result is normalized to the average.

[0119] The training process is carried out on the emotional state generation dataset CPEGD, and the convergence is as follows Figure 5 As shown in the figure, the accuracy of the model first increases and then stabilizes, indicating that the model can improve the model effect as the number of training rounds increases, reflecting that the model is effective in the emotion generation task. Figure 6 It can be seen that after 50 rounds of iterative training, the loss of the model tends to decrease and remain stable, indicating that the model can converge.

[0120] (1) The comparison experiment of generating specified personality emotions is as follows:

[0121] The comparison experiment of emotion generation for specified personality was conducted on SPEIU and multiple baseline models on the constructed data test set, and the comprehensive reasoning performance of the model on various emotional states under the specified personality was reported. The experiment verified and evaluated the accuracy of emotion generation of each method from two levels: fine-grained and coarse-grained (emotional level and sentimental level) through four evaluation indicators: precision, recall, F1 and accuracy. See Table 2 and Table 3 for details.

[0122] Table 2 Emotion level comparison experiment

[0123]

[0124]

[0125] Table 2 Emotional level comparison experiment (continued)

[0126]

[0127] Table 3 Emotional level comparison experimental results

[0128]

[0129] Overall, it can be seen from Tables 2 and 3 that IDS-EC outperforms other LSTM, Bi-LSTM, Bi-LSTM-Attn, GRU and Transformer models that do not contain personality information in terms of P, F, R and A, indicating its modeling ability of interactive dual-state models based on the characteristics of emotional propagation; and the PET-BERT and SPEIU models with personality information are better than the IDS-EC model overall, indicating that personality information can help generate emotional states. At the same time, compared with the PET-BERT model, the results of SPEIU at the emotional and affective levels are improved by an average of 2.02%, 2.27%, 1.29%, 1.64% and 1.62%, 1.28%, 1.26%, 2.22%. This is because SPEIU considers three factors (personality, emotion, and mood) that affect emotional states in multi-round conversations. PET-BERT does not consider these, which also shows that the SPEIU model is effective in the task of generating emotional states.

[0130] To further analyze the differences between emotion categories in the data, Table 2 summarizes the performance of the models on each emotion category. SPEIU achieved the best results in most emotion categories. PET-BERT's R value for "happy", P value for "neutral" and A value for "disgusted" are slightly higher than SPEIU's 0.452, 0.511 and 0.507. This may be because PET-BERT is affected by BERT's powerful modeling ability, which enables it to have better generation performance in emotional states with a large proportion of training samples. From the emotional level, Table 3 shows that SPEIU's overall results are better than other baseline models, but the R value is slightly lower than PET-BERT in positive emotional states. Similarly, this chapter believes that this improvement is also brought about by BERT's modeling ability. But overall, although the model performs poorly in some emotional states, it is still higher than the probability of random guessing. Similarly, compared with other baseline models, the SPEIU model achieved the best results overall, verifying the superiority of the model.

[0131] In addition, the imbalance of data has a significant impact on the results. The model performs significantly better on categories with more training samples than on categories with fewer training samples. For example, the results on "neutral", "disgusted" and "liked" are better than other categories, and the results on "negative" are better than "positive" and "neutral", which is consistent with the emotional state distribution of the dataset.

[0132] In order to further verify the effectiveness of the SPEIU model, this chapter also conducted a control experiment on the PELD dataset. Due to the differences in emotional states between the two datasets, only the emotion-level emotional state generation reasoning experiment was conducted. The experimental results are shown in Table 4.

[0133] As can be seen from Table 4, the results of the three categories of SPEIU on the CPEGD dataset are 16.22%, 18.99%, 20.39% and 19.51% higher than those on the PELD dataset on average. This chapter believes that there are two reasons for this situation: on the one hand, it is affected by the fact that PELD has fewer dialogue turns than CPEGD, which causes it to contain insufficient temporal emotional information. On the other hand, PELD has fewer dialogue tuples than CPEGD, and does not have an advantage in the amount of modeling data. This is another reason why the effect on PELD is worse than that on CPEGD. In addition, although SPEIU's performance on PELD is not high in terms of numerical value, it is still higher than the probability of random guessing (0.34), which further illustrates the effectiveness of the SPEIU model.

[0134] Table 4 Comparative experiments on emotional state generation of different datasets

[0135]

[0136] (4) Manual evaluation experiment

[0137] During the manual evaluation, 100 groups of multi-round dialogue samples extracted from the test set were used to generate emotions for the specified personality, and 5 reviewers were invited to manually score from the perspectives of appropriateness and matching. The final normalized evaluation results are shown in Table 5.

[0138] Table 5 Manual evaluation experiment

[0139]

[0140] In terms of appropriateness, PET-BERT and SPEIU are significantly ahead of other baseline models that do not use personality information, indicating that it is easier to generate satisfactory emotions using personality information. At the same time, SPEIU is improved by 0.4% compared to the PET-BERT model, indicating that the SPEIU proposed in this chapter has an advantage in generating emotions for specified personalities.

[0141] In terms of matching, the w / o Personality group is lower than 0.18 overall, which indicates that models without personality modeling may have better general emotional capabilities, but lack emotional uniqueness. In the withPersonality group, PET-BERT achieved the best results, with an improvement of 0.7% compared to SPEIU. This shows that PET-BERT based on VAD space has better emotional matching ability in terms of personality information when the amount of data is not abundant.

[0142] In summary, SPEIU not only ensures the ability to generate specific personality emotions, but also achieves appropriate emotion generation to a certain extent. Compared with multiple baseline models, this model has the best overall performance in the emotion state generation task, which verifies the effectiveness and superiority of the method proposed in this chapter.

[0143] An emotion generation system for a dialogue system in a dialogue scenario, comprising:

[0144] A calculation module, which obtains the user's current emotional state, the previous short-term emotional memory and the specified personality characteristics, and calculates the user's current personality emotional information input, emotional reasoning information and candidate emotional memory elements;

[0145] The emotion flow control value module obtains the medium-term emotion memory of the user's emotion tendency at the previous moment, the short-term emotion memory at the previous moment, and the user's current emotion state, and calculates the emotion flow control value through the emotion perception cells;

[0146] The emotional memory state module calculates the emotional memory element based on the short-term emotional memory of the previous moment, the amount of personality emotional information input at the current moment, the candidate emotional memory element, and the emotional flow control value, and further infers the emotional memory state at the current moment;

[0147] The time control value module calculates the time flow control value through the timing perception cells according to the short-term emotional memory of the previous moment, the long-term emotional memory from the personality of the previous moment, and the emotional memory element;

[0148] The system emotional state module multiplies the emotional reasoning information with the time flow control value to obtain the emotional state of the dialogue system at the current moment.

[0149] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0150] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating emotions in a dialogue system in a dialogue scenario, characterized in that: include: Obtain the user's current emotional state, the previous short-term emotional memory, and the specified personality characteristics, and calculate the user's current personality emotional information input, emotional reasoning information, and candidate emotional memory elements; Obtaining the medium-term emotional memory of the user's emotional tendency at the last moment, the short-term emotional memory at the last moment, and the emotional state of the user at the current moment, and calculating the emotional flow control value through the emotional perception cells; Calculating the emotion memory element according to the short-term emotion memory at the previous moment, the amount of personality emotion information input at the current moment, the candidate emotion memory element, and the emotion flow control value, and further calculating the emotion memory state at the current moment; Calculating a time flow control value through timing perception cells according to the short-term emotional memory of the previous moment, the long-term emotional memory from the personality of the previous moment, and the emotional memory element; Multiplying the emotion reasoning information by the time flow control value to obtain the emotional state of the dialogue system at the current moment; The calculation of the current moment personality emotion information input amount, emotion reasoning information and candidate emotion memory element of the user specifically includes: Among them, i T is the amount of personality and emotional information input by the user at time T, h T-1 is the short-term emotional memory at time T-1, is the user's emotional state at time T, P S is the specified user's Big Five personality traits, W and b are the trainable network model weights and bias values, respectively, o T is the emotional reasoning information at time T, m T is the candidate emotion memory element at time T.

2. The method for generating emotions of a dialogue system in a dialogue scene according to claim 1, characterized in that: The calculation of the emotion flow control value specifically includes: Among them, s T-1 is the medium-term emotional memory from emotional tendency at time T-1, e EAC Control value for the emotion flow.

3. The method for generating emotions of a dialogue system in a dialogue scene according to claim 2, characterized in that: The calculation of the emotional memory state at the current moment specifically includes: N T =e EAC *s T-1 +i T *M T ; c T =e EAC *c T-1 +i T *M T ; Among them, c T-1 is the long-term emotional memory from personality at time T-1, N T is the emotional memory element, c T is the emotional memory state at time T.

4. The method for generating emotions of a dialogue system in a dialogue scene according to claim 3, characterized in that: The calculation time flow control value specifically includes: R T =TAC(h T-1 ,N T ,w T-1 ); Among them, R T is the time flow control value.

5. The method for generating emotions of a dialogue system in a dialogue scene according to claim 4, characterized in that: The obtaining of the emotional state of the dialogue system at the current moment specifically includes: in, is the emotional state of the dialogue system at time T.

6. An emotion generation system for a dialogue system in a dialogue scene, characterized in that: include: A calculation module, which obtains the user's current emotional state, the previous short-term emotional memory and the specified personality characteristics, and calculates the user's current personality emotional information input, emotional reasoning information and candidate emotional memory elements; The emotion flow control value module obtains the medium-term emotion memory of the emotion tendency of the user at the previous moment, the short-term emotion memory at the previous moment and the emotion state of the user at the current moment, and calculates the emotion flow control value through the emotion perception cells; The emotional memory state module calculates the emotional memory element according to the short-term emotional memory at the previous moment, the amount of personality emotional information input at the current moment, the candidate emotional memory element, and the emotional flow control value, and further calculates the emotional memory state at the current moment; A time control value module, which calculates a time flow control value through a timing perception cell according to the short-term emotional memory of the previous moment, the long-term emotional memory from the personality of the previous moment and the emotional memory element; A system emotional state module, which multiplies the emotional reasoning information by the time flow control value to obtain the emotional state of the dialogue system at the current moment; The calculation of the current moment personality emotion information input amount, emotion reasoning information and candidate emotion memory element of the user specifically includes: Among them, i T is the amount of personality and emotional information input by the user at time T, h T-1 is the short-term emotional memory at time T-1, is the user's emotional state at time T, P S is the specified user's Big Five personality traits, W and b are the trainable network model weights and bias values, respectively, o T is the emotional reasoning information at time T, m T is the candidate emotion memory element at time T.

Citation Information

Patent Citations

  • An emotion recognition and prediction method for text dialogue

    CN109299267A