Intelligent agent emotion generation method and system and storage medium

Through the pre-trained emotion change module and emotion accumulation function, the agent can independently generate emotional reactions without external instructions, solving the problem of the existing system lacking autonomous emotion generation when the situation is the same, and improving the level of intelligence and anthropomorphism.

CN119599055AInactive Publication Date: 2025-03-11BEIJING INSTITUTE FOR GENERAL ARTIFICIAL INTELLIGENCE
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510142941.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-03-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing artificial intelligence systems lack an autonomous emotion generation mechanism when the situation is the same, and cannot independently generate emotional reactions without external instructions, resulting in insufficient system intelligence and anthropomorphism.

Method used

Through the pre-trained emotion change module, based on the social situation and historical situation of the agent, the estimated emotional change value is determined, and the emotion accumulation function is used to combine the value tendency and historical emotions of the agent to independently generate the current emotion.

Benefits of technology

It realizes that the agent independently generates emotional reactions without external instructions, and improves the intelligence and anthropomorphism of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119599055A_ABST
    Figure CN119599055A_ABST
Patent Text Reader

Abstract

The invention provides an agent emotion generation method and system and a storage medium, and relates to the technical field of artificial intelligence, and the method comprises the steps: determining an emotion change estimation value through a pre-trained emotion change module based on the social situation of an agent at the current moment and the social situation of the agent at the historical moment; and determining the emotion of the agent at the current moment based on the emotion of the agent at the historical moment, the value tendency of the agent and the emotion change estimated value through an emotion accumulation function. The intelligent agent can autonomously generate emotional response under the condition that no external instruction exists, and the intelligence and personification of the system are improved.
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 in particular to an intelligent agent emotion generation method, system and storage medium. Background Art

[0002] At present, the research and application of artificial intelligence technology mainly focuses on emotion recognition and response. Specifically, most existing research focuses on judging the user's emotional state by sensing external input (such as the user's voice, facial expressions, body language, etc.), and generating corresponding behavioral feedback based on this. This type of emotion recognition technology is widely used in the fields of intelligent assistants, emotional computing, robot interaction, etc.

[0003] However, most of these emotion recognition systems are passive, that is, the intelligent agents judge and respond to human emotions by receiving external instructions or behavioral information. In the same situation, these systems usually adopt the same or similar behavior patterns and lack the mechanism to generate autonomous emotions. This is different from the emotional response of natural people, because human emotions are not only affected by external situations, but also regulated by individual values, life experience, psychological state and other factors. Even in the same situation, different people may have different emotional reactions due to their different emotional tendencies or values, thereby driving different decisions and behaviors.

[0004] In order to make artificial intelligence systems more intelligent and humanized, it is necessary to explore how to enable intelligent agents to autonomously generate emotional responses without external instructions. Summary of the invention

[0005] One of the purposes of the present invention is to provide a method for generating emotions of an intelligent agent. Through a pre-trained emotion change module, an estimated value of emotion change is determined based on the social context of the intelligent agent at the current moment and the social context of the intelligent agent at the historical moment. Through an emotion accumulation function, based on the emotions of the intelligent agent at the historical moment, the value orientation of the intelligent agent and the estimated value of emotion change, the emotion of the intelligent agent at the current moment is determined, so that the intelligent agent can autonomously generate emotional responses without external instructions, thereby improving the intelligence and anthropomorphism of the system.

[0006] An embodiment of the present invention provides a method for generating emotions of an intelligent agent, comprising: Determine the estimated value of the emotion change based on the social context of the agent at the current moment and the social context of the agent at the historical moment through the pre-trained emotion change module; where the historical moment is one time step earlier than the current moment; Through the emotion accumulation function, the emotion of the agent at the current moment is determined based on the emotion of the agent at the historical moment, the value orientation of the agent, and the estimated value of the emotion change.

[0007] Optionally, the pre-training steps for the emotion change module are as follows: Generate a large number of scripts; Pre-process each script; Tracking of situational changes in pre-processing results; Determine the emotion change label based on the preprocessing results and the situation change tracking results; Based on the preprocessing results, situational change tracking results, and emotion change labels, the emotion change module is trained.

[0008] Optionally, the generating of a large number of scripts includes: Generate a large number of scripts using the first large language model.

[0009] Optionally, the preprocessing of each script includes: Based on parse graph technology, the text of each step in each script is interpreted to obtain the PG graph of each asynchronous text in each script; Sort the PG graphs of the asynchronous texts in the same script according to the order in which the texts in the same script are asynchronous, and obtain a PG graph sequence for each script; Integrate the PG graph sequences of different scripts to obtain the preprocessing results.

[0010] Optionally, tracking the situation change of the preprocessing result includes: Based on the graph difference algorithm, each pair of adjacent PG graphs in the PG graph sequences of different scripts in the preprocessing results is compared to determine the changes of different pairs of adjacent PG graphs in the PG graph sequences of different scripts; The changes of different pairs of adjacent PG graphs in the PG graph sequences of different scripts are integrated to obtain the situation change tracking results.

[0011] Optionally, changes in the PG graph include at least: addition of graph nodes, disappearance of graph nodes, and changes in relationships between graph nodes.

[0012] Optionally, determining the emotion change label based on the preprocessing result and the situation change tracking result includes: The PG graph sequences of different scripts in the preprocessing results and the changes of different pairs of adjacent PG graphs in the PG graph sequences of different scripts in the situation change tracking results are input into the second largest language model to obtain emotion change labels.

[0013] Optionally, the formula for the sentiment accumulation function is as follows: in, is the emotion of the agent at the current moment, is the activation function or mapping function, and To control the parameters, is the vector of the agent’s emotions at the historical moment, is a vector of estimated sentiment changes, is the weight matrix, is the vector of the agent’s value orientation, is element-wise multiplication.

[0014] An embodiment of the present invention provides an intelligent agent emotion generation system, comprising: A first processing module is used to determine an estimated value of the emotion change based on the social context of the agent at the current moment and the social context of the agent at the historical moment through a pre-trained emotion change module; wherein the historical moment is one time step earlier than the current moment; The second processing module is used to determine the emotion of the agent at the current moment based on the emotion of the agent at the historical moment, the value orientation of the agent and the estimated value of the emotion change through the emotion accumulation function.

[0015] A computer-readable storage medium provided by an embodiment of the present invention is characterized in that a computer program is stored on the computer-readable storage medium, and a processor executes the computer program to implement any of the methods described above.

[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.

[0017] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings: Figure 1 Schematic diagram of an intelligent agent emotion generation method in an embodiment of the present invention; Figure 2 A schematic diagram of the application process of an intelligent agent emotion generation method in an embodiment of the present invention; Figure 3 Schematic diagram of an intelligent agent emotion generation system in an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0020] The embodiment of the present invention provides a method for generating emotions of an intelligent agent, such as Figure 1 As shown, including: S1. Determine the estimated value of the emotion change based on the social context of the agent at the current moment and the social context of the agent at the historical moment through the pre-trained emotion change module; wherein the historical moment is one time step earlier than the current moment; In S1, through the pre-trained emotion change module, the agent estimates the change of emotion based on its social context at the current moment and the social context at the historical moment; the social context refers to the social environment or interaction scene in which the agent is located, such as: dialogue, cooperation or conflict with other people, etc.; the social scene at the historical moment and the current moment can contain the same or different interpersonal communication, language communication or environmental changes; the time step refers to the time difference between the historical moment and the current moment, representing a predetermined time unit; S2. Through the emotion accumulation function, based on the emotion of the agent at the historical moment, the value orientation of the agent and the estimated value of the emotion change, the emotion of the agent at the current moment is determined.

[0021] In S2, the agent uses the emotion accumulation function to calculate the emotional state at the current moment based on its historical emotions, value orientations, and the estimated value of emotion changes obtained through the emotion change module; the emotion accumulation function takes into account the historical emotional state, the estimated value of emotion changes, and the value orientation of the agent to calculate the emotional response of the agent in the current situation; value orientation refers to the agent's inherent preference or tendency when facing decision-making or emotional response, such as: preference for quiet environment, love of learning, fear of strangers, etc.

[0022] This application uses a pre-trained emotion change module to determine the estimated value of emotion change based on the social context of the agent at the current moment and the social context of the agent at the historical moment. Through the emotion accumulation function, the emotion of the agent at the current moment is determined based on the emotion of the agent at the historical moment, the value orientation of the agent, and the estimated value of emotion change. This enables the agent to autonomously generate emotional responses without external instructions, thereby improving the intelligence and anthropomorphism of the system.

[0023] In one embodiment, the pre-training steps of the emotion change module are as follows: S11. Generate a large number of scripts; In S11, scripts are stories that simulate different social situations, involving different characters, environments, plots, and interactions. For example, a script describes a conversation between two people; S12, pre-processing each script; In S12, the purpose of preprocessing is to make the script convenient for situation change tracking; S13, tracking the situational changes of the preprocessing results; In S13, situation change tracking refers to analyzing how key events in the script affect the development of the situation, for example: one person's words or actions may cause a significant change in the other party's emotions; S14, determining an emotion change label based on the preprocessing result and the situation change tracking result; In S14, one or more emotion labels are assigned to each event or moment in the script according to different situations in the preprocessing results and the changes in the situations in the situation change tracking results. For example, in a conversation, when someone feels angry, the system may label the event with the emotion "anger"; when the conversation ends and the other party feels comforted, it may be labeled with the emotion "relaxation" or "satisfaction"; S15. Training an emotion change module based on the preprocessing results, the situation change tracking results, and the emotion change labels.

[0024] In S15, the emotion change module is trained according to different situations in the preprocessing results, changes in situations in the situation change tracking results, and emotion change labels; during training, deep learning methods such as RNN networks and Transformer networks can be used for training; the trained emotion change module can determine the estimated value of emotion change according to different social situations.

[0025] The embodiment of the present invention first creates a training data set containing multiple emotional changes by generating and processing rich social scripts; secondly, through the combination of situational change tracking and emotion labels, the intelligent agent can learn how to estimate and simulate emotional changes in social situations, and conduct training based on this. This process enables the emotion change module to have the ability to infer emotional changes from social interactions, laying the foundation for the intelligent agent to generate appropriate emotional responses.

[0026] In one embodiment, the S11 generates a large number of scripts, including: Generate a large number of scripts using the first large language model.

[0027] In the above technical solution, the first largest language model can be a smaller-scale 7B model; when it is used specifically, the script scenario can be set first, such as: meeting friends, family conversations, cooperation with colleagues, etc., and the script scenario can be input into the first largest language model. The first largest language model will generate a large number of corresponding scripts according to the script scenario.

[0028] The large number of scripts generated by the first language model in the embodiment of the present invention can provide sufficient data support for the training of the emotion change module, helping the training model to better understand and express emotions.

[0029] In one embodiment, the step S12, pre-processing each script, includes: S121. Based on the parse graph technology, interpret the text of each step in each script to obtain the PG graph of each asynchronous text in each script; In S121, the text of each step in the script (each step refers to each step of the script development in the script) is parsed into a graph structure, i.e., a PG graph, through the Parse Graph technology. Each step of the text corresponds to a PG graph, which describes the interaction between each character and the environment when the step occurs. Parse Graph technology is a graph structure representation method used to parse and understand social situations. In social situations, each participant (such as a person, object, and environment) can be represented as a node in the graph, and the relationship and interaction between them can be represented as an edge in the graph. For example, in a social scene, character A and character B have a conversation, which is represented by an edge connecting A and B. S122, sorting the PG graphs of the asynchronous texts in the same script according to the order in which the texts in the same script are asynchronous, to obtain a PG graph sequence for each script; In S122, a PG graph sequence is formed by sorting, and the sequence is arranged in the order in which the texts appear in the script; S123. Integrate PG graph sequences of different scripts to obtain preprocessing results.

[0030] In S123, the PG graph sequences of multiple scripts are integrated together to form the final preprocessing result.

[0031] In one embodiment, the step S13, tracking context changes of the preprocessing results, includes: S131, based on the graph difference algorithm, comparing each pair of adjacent PG graphs in the PG graph sequences of different scripts in the preprocessing results, and determining the changes of different pairs of adjacent PG graphs in the PG graph sequences of different scripts; the changes of the PG graphs at least include: the addition of graph nodes, the disappearance of graph nodes, and the changes of the relationships between graph nodes; In S131, the graph difference algorithm is used to identify changes in the same situation at different time points. By comparing the graphs parsed at different time points, it is possible to find out which parts of the social situation have changed, including: the emergence of new interactions between people, the increase or decrease of a node (person or object), etc. Specifically, for example, in one PG graph, character A and character B are talking, while in the next PG graph, character B may leave the scene, or another character C may join. The GraphDifference algorithm will detect the "departure" of character B or the "joining" of character C as a change in the PG graph; S132. Integrate the changes of different pairs of adjacent PG graphs in the PG graph sequences of different scripts to obtain situation change tracking results.

[0032] In S132, the identified changes between different pairs of adjacent PG graphs are integrated, and finally a context change tracking result is generated.

[0033] The embodiment of the present invention tracks context changes through a Graph Difference algorithm to improve the accuracy of social context analysis.

[0034] In one embodiment, determining the emotion change label based on the preprocessing result and the situation change tracking result includes: The PG graph sequences of different scripts in the preprocessing results and the changes of different pairs of adjacent PG graphs in the PG graph sequences of different scripts in the situation change tracking results are input into the second largest language model to obtain emotion change labels.

[0035] In the above technical solution, the second largest language model can be a smaller-scale 7B model; when used specifically, the preprocessing results and the situation change tracking results are input into the second largest language model, and the second largest language model can analyze the preprocessing results and the situation change tracking results to generate reasonable emotion change labels.

[0036] In one embodiment, the formula of the emotion accumulation function is as follows: in, is the emotion of the agent at the current moment, is the activation function or mapping function, and To control the parameters, is the vector of the agent’s emotions at the historical moment, is a vector of estimated sentiment changes, is the weight matrix, is the vector of the agent’s value orientation, is element-wise multiplication.

[0037] In the above formula, , represents the estimated value vector of multi-dimensional emotion changes, dimension Indicates different emotion categories (such as anger, happiness, etc.), represents n-dimensional real vector space; , represents the emotional state of the agent at time t-1; , represents the emotional state (output) of the agent at time t; , Represents the value orientation vector of the intelligent agent, dimension Indicates different value dimensions (such as sense of security, sense of belonging, etc.), is an m-dimensional real vector space; , is a weight matrix, which is used to map the value orientation of the agent to the weight of each emotional dimension. The value orientation of the agent is used as the weight of the multi-dimensional emotional changes caused by each value dimension, and is used to calculate the final change value of each emotional dimension. for dimensional real vector space; represents the control parameter, represents the decay rate of historical sentiment, Represents the impact of the latest sentiment change; It is an activation function or mapping function (such as ReLU function, Sigmoid function), which is used to limit the range of emotion values. Indicates the retained part of the emotion at the previous moment. Controls the decay speed, larger Represents a strong memory of historical emotions (because the latest emotion is the weighted sum of previous emotions and emotion changes, is the weight of the previous emotion, is the weight of the emotion change, The larger it is, the longer the influence of the previous emotion on the latest emotion lasts, so it reflects the decay speed of the previous emotion; similarly, Indicates the degree of influence of the emotion change on the latest emotion. ); represents the weighted sum of the latest sentiment changes, where is the weight generated based on value orientation, represents element-wise multiplication; Control the extent to which the latest changes affect your current mood; Used to limit the emotional state value to a reasonable range (such as [0, 1] or [-1,1]). This function has different parameters to control the decay rate of the agent's past emotions and the impact of the latest emotional changes on the final emotions.

[0038] The corresponding data generated by the large language model can be learned value, and can also design corresponding The training of this function is to train these parameters of the function, so that the large language model can give corresponding outputs according to the input of the emotion accumulation function and different personality traits as an emotion accumulation data set reflecting personality traits for training this function. The trained emotion accumulation function has different corresponding personality traits. The value can reflect the difference in the attenuation and change sensitivity of emotions.

[0039] In one embodiment, Figure 2 As shown in the figure, in this situation, the agent is playing with building blocks with his younger brother, the mother is sitting nearby reading a book, the father is tidying up the room, the younger brother takes the agent's car to play, the agent asks the younger brother to return the car to him, the younger brother is unwilling, the mother persuades the younger brother to return the car to the agent and takes it away, the father picks up the car and returns it to the agent; first, the PG graph of the situation is abstracted by the large model, then the changes in the PG graph are analyzed, and finally the emotional changes of the agent are generated, that is, from happy to sad to angry to happy.

[0040] An embodiment of the present invention provides an intelligent agent emotion generation system, such as Figure 3 As shown, including: The first processing module 1 is used to determine the estimated value of the emotion change based on the social context of the agent at the current moment and the social context of the agent at the historical moment through the pre-trained emotion change module; wherein the historical moment is one time step earlier than the current moment; The second processing module 2 is used to determine the emotion of the agent at the current moment based on the emotion of the agent at the historical moment, the value orientation of the agent and the estimated value of the emotion change through the emotion accumulation function.

[0041] A computer-readable storage medium provided by an embodiment of the present invention is characterized in that a computer program is stored on the computer-readable storage medium, and a processor executes the computer program to implement any of the methods described above.

[0042] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for generating emotions of an intelligent agent, characterized in that: include: Determine the estimated value of emotion change based on the social context of the agent at the current moment and the social context of the agent at the historical moment through the pre-trained emotion change module; where the historical moment is one time step earlier than the current moment; Through the emotion accumulation function, the emotion of the agent at the current moment is determined based on the emotion of the agent at the historical moment, the value orientation of the agent, and the estimated value of the emotion change.

2. The method for generating emotions of an intelligent agent as claimed in claim 1, characterized in that: The pre-training steps of the emotion change module are as follows: Generate a large number of scripts; Pre-process each script; Tracking of situational changes in pre-processing results; Determine the emotion change label based on the preprocessing results and the situation change tracking results; Based on the preprocessing results, situational change tracking results, and emotion change labels, the emotion change module is trained.

3. The method for generating emotions of an intelligent agent as claimed in claim 2, characterized in that: The described generates a large number of scripts, including: Generate a large number of scripts using the first large language model.

4. The method for generating emotions of an intelligent agent as claimed in claim 2, characterized in that: The preprocessing of each script includes: Based on parse graph technology, the text of each step in each script is interpreted to obtain the PG graph of each asynchronous text in each script; Sort the PG graphs of the asynchronous texts in the same script according to the order in which the texts in the same script are asynchronous, and obtain a PG graph sequence for each script; Integrate the PG graph sequences of different scripts to obtain the preprocessing results.

5. The method for generating emotions of an intelligent agent as claimed in claim 4, characterized in that: The tracking of situation changes of the preprocessing results includes: Based on the graph difference algorithm, each pair of adjacent PG graphs in the PG graph sequences of different scripts in the preprocessing results is compared to determine the changes of different pairs of adjacent PG graphs in the PG graph sequences of different scripts; The changes of different pairs of adjacent PG graphs in the PG graph sequences of different scripts are integrated to obtain the situation change tracking results.

6. The method for generating emotions of an intelligent agent as claimed in claim 5, characterized in that: Changes to the PG graph include at least: the addition of graph nodes, the disappearance of graph nodes, and changes in the relationships between graph nodes.

7. The method for generating emotions of an intelligent agent as claimed in claim 5, characterized in that: The step of determining the emotion change label based on the preprocessing result and the situation change tracking result includes: The PG graph sequences of different scripts in the preprocessing results and the changes of different pairs of adjacent PG graphs in the PG graph sequences of different scripts in the situation change tracking results are input into the second largest language model to obtain emotion change labels.

8. The method for generating emotions of an intelligent agent as claimed in claim 5, characterized in that: The formula of the sentiment accumulation function is as follows: in, is the emotion of the agent at the current moment, is the activation function or mapping function, and To control the parameters, is the vector of the agent’s emotions at the historical moment, is a vector of estimated sentiment changes, is the weight matrix, is the vector of the agent’s value orientation, is element-wise multiplication.

9. An intelligent agent emotion generation system, characterized in that: include: A first processing module is used to determine an estimated value of the emotion change based on the social context of the agent at the current moment and the social context of the agent at the historical moment through a pre-trained emotion change module; wherein the historical moment is one time step earlier than the current moment; The second processing module is used to determine the emotion of the agent at the current moment based on the emotion of the agent at the historical moment, the value orientation of the agent and the estimated value of the emotion change through the emotion accumulation function.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the processor executes the computer program to implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Emotion analysis method and device, electronic equipment and storage medium

    CN115292495A

  • Emotion analysis method, device and equipment and storage medium

    CN115984905A

  • Emotion generation method and device, electronic equipment and storage medium

    CN116341607A

  • Social media negative emotion recognition method based on generative artificial intelligence

    CN117493973A

  • AI-based pet emotion recognition system

    CN119049086A