Emotion recognition method, program product, device and storage medium based on autonomous and controllable large model

By adopting autonomous and controllable large models in emotion recognition technology, global emotional characteristics and computed emotional memory accumulation characteristics are extracted, and a multi-emotional transfer map is established, which solves the shortcomings of multi-emotion coexistence and multi-round dialogue emotions dynamic modeling in the existing technology, and realizes high-precision emotion recognition and abnormal mood fluctuation detection.

CN119691529BActive Publication Date: 2025-04-22ZHONGKE NANJING SOFTWARE TECH RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510207268.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-04-22
Estimated Expiration
2045-02-25

AI Technical Summary

Technical Problem

Existing emotion recognition technology is difficult to accurately characterize the coexistence of multiple emotions, cannot effectively model the emotional dynamics of multiple rounds of dialogue, cannot reflect the user's emotional changes in real time, and can easily lead to recognition bias in scenarios with fuzzy semantics or high noise.

Method used

An emotion recognition method based on an autonomous controllable large model is adopted, and the emotional distribution is formed by obtaining the word set of the current round of dialogue, global emotional characteristics are extracted and the accumulated characteristics of emotional memory are calculated. Establish a multi-emotional transfer map, calculate the probability of affective transfer, determine the fluctuations of the emotional trajectory, and perform feature fusion through the gated circulation unit and attention mechanism.

Benefits of technology

Supports high-precision classification of multi-emotion tags, enhances the ability to capture emotions for multiple rounds of dialogue, accurately recognizes abnormal mood fluctuations in dialogue, and can still accurately identify them in scenarios with fuzzy semantics or high noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691529B_ABST
    Figure CN119691529B_ABST
Patent Text Reader

Abstract

The present invention discloses an emotion recognition method, program product, device and storage medium based on an autonomous and controllable large model. The method includes: obtaining the emotion recognition data to be recognized in the current round of dialogue, and preprocessing to obtain the word set of the current round of dialogue; predicting the confidence of the emotion of the current round of dialogue belonging to each type of emotion according to the word set of the current round of dialogue and the historical dialogue, forming the emotion distribution of the current round of dialogue, taking each type of emotion as a node, taking the emotion transfer probability between each type of emotion as a directed edge, establishing a multi-emotion transfer map, and calculating the emotion trajectory fluctuation probability value according to the multi-emotion transfer map; if the emotion trajectory fluctuation probability value is less than a first threshold value, or the distribution-level emotion transfer probability is less than a second threshold value, the current round of dialogue is judged as an abnormal emotion fluctuation trend, otherwise it is judged as a normal emotion fluctuation trend. The present invention takes into account the emotion recognition of multiple emotions coexisting in multi-round dialogues, and can also reflect the trend of user emotion changes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to emotion recognition technology, and in particular to an emotion recognition method, program product, device and storage medium based on an autonomous and controllable large model. Background Art

[0002] Emotion recognition is an important research direction in the field of human-computer interaction and intelligent customer service. It aims to automatically identify the user's emotional state by analyzing the voice, text or multimodal data input by the user. In recent years, emotion recognition models based on deep learning have developed rapidly, and technologies such as Transformer structure, attention mechanism, and temporal memory network have been widely used. However, current emotion recognition technology still faces the following problems:

[0003] (1) Diversity and complexity of emotional expression: Different users have significantly different ways of expressing emotions, which may be affected by factors such as cultural background and personality traits. In addition, multiple emotional clues may exist simultaneously in the same conversation (such as anxiety and anger). Existing emotion recognition algorithms mostly use single-label classification models, which cannot accurately describe the coexistence of multiple emotions.

[0004] (2) Insufficient dynamic modeling of multi-round dialogue emotions: In practical applications, emotional states often change as the dialogue progresses. Traditional emotion recognition methods are usually based on the context of a single round of dialogue and lack effective modeling of the evolution of multi-round emotions, and are unable to capture the potential impact of historical dialogues on current emotions.

[0005] (3) Insufficient learning of emotion transition rules: In a conversation, the frequency and pattern of transitions between different emotions may change with the scene. The existing model cannot reflect the changing trend of user emotions in real time;

[0006] (4) Challenges in coupling semantics and emotion: Emotion recognition relies on the semantic understanding of the input text. Existing algorithms are prone to recognition bias in scenarios with ambiguous semantics or high noise levels. Summary of the invention

[0007] In view of the problems existing in the prior art, the purpose of the present invention is to provide an emotion recognition method, program product, device and storage medium based on an autonomous and controllable large model that can reflect the trend of user emotion changes under multi-round conversations and the coexistence of multiple emotions.

[0008] In order to achieve the above-mentioned object of the invention, the present invention provides the following technical solutions:

[0009] An emotion recognition method based on an autonomous and controllable large model, comprising:

[0010] Obtain the emotion recognition data for the current round of dialogue, and preprocess to obtain the word set for the current round of dialogue;

[0011] Extracting global sentiment features based on the word set of the current round of dialogue, and calculating the sentiment memory accumulation features of the global sentiment features in all rounds of dialogue, predicting the confidence that the sentiment of the current round of dialogue belongs to each type of sentiment, and forming the sentiment distribution of the current round of dialogue, wherein the sentiment memory accumulation features are calculated by using the gated recurrent unit through the global sentiment features of all rounds of dialogue;

[0012] Taking each type of emotion as a node and the emotion transfer probability between each type of emotion as a directed edge, a multi-emotion transfer graph is established, wherein the emotion transfer probability between each type of emotion is obtained based on the confidence statistics of the emotion of each type of emotion in multiple rounds of historical conversations;

[0013] According to the multi-emotion transfer graph, calculating the distribution-level emotion transfer probability between any two consecutive rounds of dialogue in the current time period;

[0014] Multiply the distribution-level emotion transfer probabilities of all two consecutive rounds in the current time period to obtain the emotion trajectory fluctuation probability value;

[0015] If the probability value of the emotion trajectory fluctuation is less than the preset threshold, the current round of dialogue is judged as abnormal emotion fluctuation, otherwise it is judged as normal emotion fluctuation.

[0016] A computer program product comprises a computer program / instruction, wherein the computer program / instruction implements the above method when executed by a processor.

[0017] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above method.

[0018] A computer-readable storage medium having a computer program / instruction stored thereon, wherein the computer program / instruction implements the above method when executed by a processor.

[0019] Compared with the prior art, the present invention has the following beneficial effects:

[0020] (1) The present invention takes into account the situation where users have multiple emotions coexisting, and uses the emotion distribution including multiple emotions as the recognized emotion output, supporting high-precision classification of multiple emotion labels;

[0021] (2) When calculating the emotion distribution, the present invention not only considers the emotion of the current round of dialogue, but also considers the potential impact of historical dialogue on the current emotion, thereby enhancing the ability to capture emotions in the dialogue context and making emotion recognition more accurate.

[0022] (3) Based on the probability distribution of emotions in multiple rounds of conversations, a high-dimensional emotion transfer map is constructed. The outer product form is used to capture the concurrent transfer rules of multiple emotions. The sliding window and forgetting factor are combined to achieve dynamic update and real-time optimization of the emotion transfer rules. The user's emotion trajectory fluctuations are then obtained through the multi-emotion transfer map, which can accurately identify abnormal emotion fluctuations in the conversation.

[0023] (4) In emotion recognition, the present invention uses a text encoder for feature extraction, an attention mechanism to calculate a global emotion feature vector, a gated recurrent unit to calculate the emotion memory accumulation feature of the global emotion feature vector, and a comprehensive emotion feature vector that integrates the emotion memory accumulation feature and the current global emotion feature vector for classification. Therefore, it does not rely on semantic understanding and can accurately identify even in scenes with ambiguous semantics or high noise.

[0024] (5) Through customizable large models and modular design, the system's autonomous controllability in specific scenarios is enhanced, and the emotion transfer map is used to provide an explainable output basis to ensure the credibility and compliance of the emotion recognition results. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a flow chart of the emotion recognition method based on the autonomous and controllable large model provided by the present invention;

[0026] Figure 2 It is a structural schematic diagram of the computer device provided by the present invention. DETAILED DESCRIPTION

[0027] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0028] Embodiment 1

[0029] The embodiment of the present invention provides an emotion recognition method based on an autonomous and controllable large model, such as Figure 1 As shown, the following steps are included:

[0030] S101, obtaining the emotion recognition data for the current round of dialogue, and preprocessing to obtain a word set for the current round of dialogue.

[0031] In specific implementation, the steps include:

[0032] S1011, obtaining the current round of conversation content as the data to be recognized by emotion;

[0033] S1012, obtaining the type of the data to be emotion recognized, and if the type of the data to be emotion recognized is a non-text type, converting the data to be emotion recognized into a text type; wherein the type of the data to be emotion recognized may be a non-text type such as voice, text, or picture;

[0034] S1013, adding role tags to the text of the current round of dialogue, and dividing it into text sequences; wherein the role tag specifically adds the role of the speaker to each text, for example, whether the role is the user or the agent who replies to the user, and the text sequence is mainly divided into a number of short sentences, each short sentence as a text, thereby forming a text sequence;

[0035] S1014. Clean, denoise and segment the text sequence of the current round of dialogue to form a word set of the current round of dialogue, wherein cleaning and denoising mainly remove redundant words, noise words, etc., and word segmentation divides each text into several words.

[0036] S102, extracting global sentiment features based on the word set of the current round of dialogue, and calculating the sentiment memory accumulation features of the global sentiment features in all rounds of dialogue, predicting the confidence that the sentiment of the current round of dialogue belongs to each type of sentiment, and forming the sentiment distribution of the current round of dialogue.

[0037] In specific implementation, the steps include:

[0038] S1021. Use a text encoder to extract features from the word set of the current round of dialogue to form a semantic feature sequence. The text encoder can be a trained Transformer model or other neural network model as long as it can achieve feature extraction. The extracted features are sequentially formed into a semantic feature sequence. represents the kth semantic feature, n represents the number of semantic features in the semantic feature sequence, and d represents the dimension of the semantic feature. The semantic feature sequence H is a dynamic focus on emotion-related semantic features.

[0039] S1022, using the attention mechanism, calculating the attention weight of each semantic feature in the semantic feature sequence according to the following formula;

[0040] ,

[0041] ,

[0042] In the formula, , Represents the kth semantic feature The attention weights and preliminary weights of Represents the query vector obtained through training. The attention weight is calculated using the attention mechanism. The attention mechanism parameters The training method is a conventional training method and will not be repeated here.

[0043] S1023. Use the attention weight to perform weighted summation on the semantic feature sequence to obtain the global emotional feature vector of the current round of dialogue. The specific formula is as follows:

[0044] ,

[0045] In the formula, represents the global sentiment feature vector of the t-th round of dialogue, and t represents the number of rounds of the current dialogue.

[0046] S1024. Use a gated recurrent unit to calculate the emotional memory accumulation features of the global emotional feature vector.

[0047] Specifically, the gated recurrent unit calculates the emotional memory accumulation feature of the global emotional feature vector through the following calculation formula:

[0048] ,

[0049] ,

[0050] ,

[0051] ,

[0052] in It is the update gate. It is the reset gate. represents the hidden state, is the emotional memory accumulation feature of the global emotional feature vector at the tth round of dialogue, which is used to record the emotional features accumulated in the dialogue so far and is initialized to an all-zero vector . represents element-wise multiplication, represents the sigmoid function, represents the hyperbolic tangent activation, , represents the network parameters of the update gate, , represents the network parameters of the reset gate, The network parameters representing the hidden state are obtained through training.

[0053] S1025. Fusion the emotional memory accumulation features of the global emotional feature vector with the global emotional feature vector of the current round of dialogue to obtain a comprehensive emotional feature vector of the current round of dialogue.

[0054] Among them, the fusion method of comprehensive emotional feature vector is splicing, specifically:

[0055] ,

[0056] In the formula, Represents the comprehensive emotional feature vector of the current round of dialogue.

[0057] It is understandable that in other embodiments, other fusion methods may also be used, such as weighted fusion.

[0058] The comprehensive sentiment feature vector can fully consider the comprehensive impact of the current text and multiple rounds of historical information on sentiment.

[0059] S1026. Using the comprehensive emotion feature vector of the current round of dialogue as classification input, obtaining the confidence that the emotion of the current round of dialogue belongs to each type of emotion, and forming the emotion distribution of the current round of dialogue.

[0060] Specifically, the comprehensive emotional feature vector of the current round of dialogue can be input into the trained classification model to obtain the prediction vector of the comprehensive emotional feature vector:

[0061] ,

[0062] In the formula, represents the prediction vector of the comprehensive sentiment feature vector, , represents the parameters obtained through training in the classification model, Represents the comprehensive emotional feature vector of the current round of dialogue; the classification model is specifically a single-layer fully connected layer, and can also be other forms of classification network models as long as classification can be achieved;

[0063] The prediction vector of the comprehensive emotional feature vector is calculated by Softmax to obtain the confidence that the emotion of the current round of dialogue belongs to each type of emotion, forming the emotional distribution of the current round of dialogue:

[0064] ,

[0065] ,

[0066] In the formula, Indicates the confidence that the emotion in the t-th round of dialogue belongs to the i-th type of emotion, , Respectively The i,jth element of ;

[0067] According to the confidence level of each type of emotion in the current round of dialogue, the emotion distribution of the current round of dialogue is formed:

[0068] ,

[0069] In the formula, Represents the sentiment distribution of the current round of dialogue.

[0070] The emotion type can be set to multiple types. For example, the following eight fine-grained emotion types can be preset: {angry, anxious, confused, happy, calm, excited, indifferent, lost}, Indicates the i-th type of emotion.

[0071] The embodiment of the present invention uses the emotion distribution as the recognized emotion instead of a main label as the recognized emotion, which takes into account the coexistence of multiple emotions. In the subsequent steps, the emotion distribution is also used for further calculation instead of using a single emotion for calculation.

[0072] The steps of predicting the confidence level of the emotion of the current dialogue can be combined into a sentiment classification model as part of the autonomous model. The data is saved in the conversation metadata for subsequent retrieval in the semantic understanding, preference alignment, and text generation stages. If there is a high-intensity negative emotion (such as the confidence level of anger > 0.6), the system can trigger soothing words in advance or warn the human agent.

[0073] S103. Taking each type of emotion as a node and the emotion transfer probability between each type of emotion as a directed edge, a multi-emotion transfer graph is established.

[0074] The emotion transfer probability between the various types of emotions is obtained according to the confidence statistics of the emotions of the historical multiple rounds of dialogues belonging to the various types of emotions, which specifically includes the following steps:

[0075] S1031. According to the confidence that the emotions of multiple rounds of dialogues in the current time period belong to various types of emotions, the frequency of emotion transfer between various types of emotions in the current time period is counted:

[0076] ,

[0077] In the formula, represents the frequency of emotion transfer from type i emotion to type j emotion in the current time period r, t represents the number of rounds of the current dialogue, Indicates the current time period -1 round of dialogue, the confidence that the emotion belongs to the i-th type of emotion, Indicates the current time period The confidence that the emotion of the turn-based dialogue belongs to the jth type of emotion, and m represents the total number of emotion types.

[0078] The time period can be set as needed, such as the last W hours, W days or W weeks, and can be set according to the conversation density. By setting the time period, the most recent data can be used as the main identification data source.

[0079] In this step, considering that users often have multiple emotional clues at the same time (such as anxiety and anger coexisting), in order to more finely characterize the concurrence and transition of multiple emotions, the frequency of emotional transfer is introduced for statistics. Specifically, the transfer law from the probability of emotional transfer in the previous round to the probability of emotional transfer in the current round is counted. This statistical method is soft counting. In this statistical method, if the probability of emotional transfer in the previous round is high, and the probability of emotional transfer in the current round is also high, the statistical frequency of emotional transfer will get more increments. In this way, it is possible to simultaneously record multiple possibilities such as how "anger and anxiety coexist" is transformed into "calm or loss" in the next round, so as to fully consider complex situations such as emotional mixing or gradual changes.

[0080] S1032. Calculate the local emotion transfer probability between various types of emotions in the current time period according to the transfer frequency between various types of emotions in the current time period:

[0081] ,

[0082] In the formula, represents the local emotion transition probability from the i-th emotion type to the j-th emotion type in the current time period r, Indicates the transition from type i emotion to type The frequency of emotional transfer of type emotion.

[0083] S1033, obtaining the emotion transfer probability between various types of emotions calculated in the previous time period, combining the local emotion transfer probability between various types of emotions in the current time period, and calculating the emotion transfer probability between various types of emotions in the current time period:

[0084] ,

[0085] In the formula, , They represent the probability of emotion transfer from the i-th emotion to the j-th emotion in the current time period r and the previous time period r-1, respectively. For the forgetting factor.

[0086] The emotion transfer probability calculated in this step takes into account both historical data and current data. The forgetting factor enables the model to reflect more recent emotion evolution trends while downplaying data that is too old. This allows the model to dynamically evolve after new samples arrive, continuously reflecting the latest user emotion trends and transfer patterns.

[0087] After calculating the emotion transfer probability, a multi-emotion transfer graph G={V, E} is constructed, where V is a node set, each node is a type of emotion, and E is an edge set, specifically a directed edge, and each directed edge is used to represent the emotion transfer probability from one node to another.

[0088] The various steps of establishing a multi-emotion transfer map in this step can be combined into an emotion transfer map establishment model and executed as part of the autonomous large model for subsequent calculations.

[0089] S104: Calculate the distribution-level emotion transfer probability between any two consecutive rounds of dialogue in the current time period according to the multi-emotion transfer graph.

[0090] In specific implementation, it can be calculated by the following formula:

[0091] ,

[0092] In the formula, Indicates -1st round and Distribution-level emotion transfer probability between turns, Indicates the current time period -1 round of dialogue, the confidence that the emotion belongs to the i-th type of emotion, Indicates the current time period The confidence that the emotion of the turn dialogue belongs to the jth type of emotion, represents the emotion transfer probability from the i-th emotion type to the j-th emotion type in the current time period r, m represents the total number of emotion types, and t represents the number of rounds in the current dialogue. The multi-round dialogue is regarded as a trajectory of emotion change, and the probability of the "flow trajectory" of the entire dialogue at the distribution level can be obtained through the distribution-level emotion transfer probability.

[0093] S105. Multiply the distribution-level emotion transfer probabilities of all two consecutive rounds in the current time period to obtain the emotion trajectory fluctuation probability value.

[0094] In specific implementation, it can be calculated by the following formula:

[0095] ,

[0096] Since the direct product may be too small, it is converted to logarithmic summation:

[0097] ,

[0098] In the formula, Represents the probability value of emotion trajectory fluctuation.

[0099] S106: If the emotion trajectory fluctuation probability value is less than the first threshold, or the distribution-level emotion transfer probability is less than the second threshold, the current round of dialogue is judged as having an abnormal emotion fluctuation trend; otherwise, the emotion fluctuation trend is judged as normal.

[0100] If the probability value of the emotion trajectory fluctuation is less than the first threshold, for example, it is far lower than the quantile threshold of similar historical conversations, or the distribution-level emotion transfer probability is less than the second threshold, for example, it is extremely small (a rare mutation occurs), then the current round of conversation is judged as an abnormal emotion fluctuation trend and marked as an outlier. At this time, special attention, alarm or automatic strategy switching can be triggered on the customer service side to prevent the intensification of negative emotions.

[0101] Steps S104, S105, and S106 may also be combined into one model and executed as part of an autonomous large model for subsequent calculations.

[0102] S107. Predict the emotional distribution of the next round of conversation based on the multi-emotion transfer graph:

[0103] ,

[0104] ,

[0105] In the formula, Indicates the confidence that the predicted emotion of the next round of conversation belongs to the jth type of emotion, represents the predicted sentiment distribution of the next round of dialogue, Indicates the confidence that the emotion in the t-th round of dialogue belongs to the i-th type of emotion, Represents the probability of emotion transfer from the i-th type of emotion to the j-th type of emotion in the multi-emotion transfer graph.

[0106] By predicting the emotional distribution of the next round of conversation, you can intervene in advance or optimize the response strategy. For example, if The probability of some negative emotions (such as "anger" and "disappointment") in the conversation increases significantly, and customer service staff can intervene in advance. In the dialogue reply or automatic speech scenario, Prepare the words (such as enhancing the soothing component, guiding marketing, etc.). In addition, Splice or project into a form that is readable by the autonomous and controllable large model, and construct the following input prompt: [dialogue context] + [Predicted Emotion Distribution: ] + [System Instructions], when decoding, the language model combines additional attention heads or gating mechanisms Component, dynamically adjust the style and content of the generated text.

[0107] The steps of step S107 may also be combined into one model for execution as a part of an autonomous large model for subsequent calculations.

[0108] Embodiment 2

[0109] The embodiment of the present invention also provides a computer product, such as an app on a mobile phone or a tablet, an installation program on a computer, etc., which includes a computer program / instruction, and the computer program / instruction is executed by a processor to implement the method described in Example 1. The code of the computer executable program for performing the operation of the present invention can be written in one or more programming languages ​​or a combination thereof, and the programming language includes an object-oriented programming language, such as Java, Smalltalk, C++, and also includes a conventional procedural programming language, such as "C" language or similar programming language. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0110] Embodiment 3

[0111] Figure 2 Schematic diagram of the structure of a computer device provided by an embodiment of the present invention. The embodiment of the present invention provides services for implementing the method of the first embodiment of the present invention. Figure 2 As shown, the device may include: a memory 301 storing a computer executable program; a processor 302 coupled to the memory 301; the processor 302 calls the computer executable program stored in the memory 301 to execute the steps in the method described in the first embodiment.

[0112] The memory 301 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. The device may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the memory 301 may be used to read and write non-removable, non-volatile magnetic media (commonly referred to as a "hard drive"). A program / utility having a set (at least one) of program modules may be stored in, for example, the memory 301, such program modules including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include the implementation of a network environment. The computer executable program of the program module typically performs the functions and / or methods in the embodiments described in the present invention.

[0113] The processor 302 executes various functional applications and data processing by running the program stored in the memory 301, such as implementing the method provided in the first embodiment of the present invention.

[0114] The code of the computer executable program can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages.

[0115] Embodiment 4

[0116] An embodiment of the present invention provides a storage medium including a computer executable program. When the computer executable program is executed by a computer processor, it is used to execute the method of the first embodiment.

[0117] The storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device.

[0118] Of course, the storage medium including a computer executable program provided by an embodiment of the present invention, the computer executable program is not limited to the above method operations, and can also execute related operations in the method provided by any embodiment of the present invention.

[0119] It should be understood that the above embodiments and descriptions only describe the principles, main features and advantages of the present invention. Without departing from the spirit and scope of the present invention, the present invention may be subject to various changes and improvements, and these changes and improvements all fall within the scope of protection of the present invention.

Claims

1. An emotion recognition method based on an autonomous and controllable large model, characterized in that: include: Obtain the emotion recognition data for the current round of dialogue, and preprocess to obtain the word set for the current round of dialogue; Extracting global sentiment features based on the word set of the current round of dialogue, and calculating the sentiment memory accumulation features of the global sentiment features in all rounds of dialogue, predicting the confidence that the sentiment of the current round of dialogue belongs to each type of sentiment, and forming the sentiment distribution of the current round of dialogue, wherein the sentiment memory accumulation features are calculated by using the gated recurrent unit through the global sentiment features of all rounds of dialogue; Taking each type of emotion as a node and the emotion transfer probability between each type of emotion as a directed edge, a multi-emotion transfer graph is established, wherein the emotion transfer probability between each type of emotion is obtained based on the confidence statistics of the emotion of each type of emotion in multiple rounds of historical conversations; According to the multi-emotion transfer graph, calculating the distribution-level emotion transfer probability between any two consecutive rounds of dialogue in the current time period; Multiply the distribution-level emotion transfer probabilities of all two consecutive rounds in the current time period to obtain the emotion trajectory fluctuation probability value; If the emotion trajectory fluctuation probability value is less than the first threshold, or the distribution-level emotion transfer probability is less than the second threshold, the current round of dialogue is judged as having an abnormal emotion fluctuation trend, otherwise it is judged as having a normal emotion fluctuation trend.

2. The emotion recognition method based on the autonomous and controllable large model according to claim 1 is characterized in that: The step of obtaining the emotion recognition data for the current round of dialogue and preprocessing to obtain the word set for the current round of dialogue specifically includes: Get the current round of conversation content as the data to be recognized by emotion; Obtain the type of the data to be recognized by emotion, and if the type of the data to be recognized by emotion is a non-text type, convert the data to be recognized by emotion into a text type; Add role tags to the text of the current round of dialogue and divide it into text sequences; The text sequence of the current round of dialogue is cleaned, denoised and segmented to form a word set of the current round of dialogue.

3. The emotion recognition method based on the autonomous and controllable large model according to claim 1 is characterized in that: The method extracts global emotional features according to the word set of the current round of dialogue, calculates the emotional memory accumulation features of the global emotional features in all rounds of dialogue, predicts the confidence of the emotion of the current round of dialogue belonging to each type of emotion, and forms the emotional distribution of the current round of dialogue, specifically including: Use a text encoder to extract features from the word set of the current round of dialogue to form a semantic feature sequence; Using the attention mechanism, the attention weight of each semantic feature in the semantic feature sequence is calculated according to the following formula; , , In the formula, , Represents the kth semantic feature The attention weights and preliminary weights of represents the initial weight of the k'th semantic feature, represents the query vector obtained through training, n represents the number of semantic features in the semantic feature sequence, and d represents the dimension of the semantic feature; The attention weight is used to perform weighted summation on the semantic feature sequence to obtain the global emotional feature vector of the current round of dialogue; The gated recurrent unit is used to calculate the emotional memory accumulation features of the global emotional feature vector; The emotional memory accumulation features of the global emotional feature vector are merged with the global emotional feature vector of the current round of dialogue to obtain the comprehensive emotional feature vector of the current round of dialogue; The comprehensive emotional feature vector of the current round of dialogue is used as the classification input to obtain the confidence that the emotion of the current round of dialogue belongs to each type of emotion, forming the emotional distribution of the current round of dialogue.

4. The emotion recognition method based on the autonomous and controllable large model according to claim 3 is characterized in that: The comprehensive emotion feature vector of the current round of dialogue is used as the classification input to obtain the confidence that the emotion of the current round of dialogue belongs to each type of emotion, and form the emotion distribution of the current round of dialogue, which specifically includes: Input the comprehensive emotional feature vector of the current round of dialogue into the trained classification model to obtain the prediction vector of the comprehensive emotional feature vector: , In the formula, represents the prediction vector of the comprehensive sentiment feature vector, , represents the parameters obtained through training in the classification model, represents the comprehensive emotional feature vector of the current round of dialogue, and t represents the number of rounds of the current round of dialogue; Perform Softmax calculation on the prediction vector of the comprehensive emotional feature vector to obtain the confidence that the emotion of the current round of dialogue belongs to each type of emotion: , In the formula, Indicates the confidence that the emotion of the current round of dialogue belongs to the i-th type of emotion, , Respectively represent the i-th and j-th elements, and m represents the total number of emotion types; According to the confidence level of each type of emotion in the current round of dialogue, the emotion distribution of the current round of dialogue is formed: , In the formula, Represents the sentiment distribution of the current round of dialogue.

5. The emotion recognition method based on the autonomous and controllable large model according to claim 1 is characterized in that: The method for calculating the emotion transfer probability between the various types of emotions specifically includes: According to the confidence that the emotions of multiple rounds of dialogues in the current time period belong to each type of emotion, the frequency of emotion transfer between each type of emotion in the current time period is counted: , In the formula, represents the frequency of emotion transfer from type i emotion to type j emotion in the current time period r, t represents the number of rounds of the current dialogue, Indicates the current time period -1 round of dialogue, the confidence that the emotion belongs to the i-th type of emotion, Indicates the current time period The confidence that the emotion of the turn dialogue belongs to the jth type of emotion, and m represents the total number of emotion types; According to the transfer frequency between various types of emotions in the current time period, the local emotion transfer probability between various types of emotions in the current time period is calculated: , In the formula, represents the local emotion transition probability from the i-th emotion type to the j-th emotion type in the current time period r, Indicates the transition from type i emotion to type Frequency of emotional transfer of type emotion; Get the emotion transfer probability between each type of emotion calculated in the previous time period, and combine it with the local emotion transfer probability between each type of emotion in the current time period to calculate the emotion transfer probability between each type of emotion in the current time period: , In the formula, , They represent the probability of emotion transfer from the i-th emotion to the j-th emotion in the current time period r and the previous time period r-1, respectively. For the forgetting factor.

6. The emotion recognition method based on the autonomous and controllable large model according to claim 1 is characterized in that: The step of calculating the distribution-level emotion transfer probability between any two consecutive rounds of dialogue in the current time period according to the multiple emotion transfer graphs specifically includes: , In the formula, Indicates -1st round and Distribution-level emotion transfer probability between turns, Indicates the current time period -1 round of dialogue, the confidence that the emotion belongs to the i-th type of emotion, Indicates the current time period The confidence that the emotion of the turn dialogue belongs to the jth type of emotion, represents the emotion transition probability from the i-th emotion type to the j-th emotion type in the current time period r, m represents the total number of emotion types, and t represents the number of rounds in the current dialogue.

7. The emotion recognition method based on an autonomous and controllable large model according to claim 1 is characterized in that: Also includes: According to the multi-emotion transfer graph, predict the emotional distribution of the next round of conversation: , , In the formula, Indicates the confidence that the predicted emotion of the next round of conversation belongs to the jth type of emotion, represents the predicted sentiment distribution of the next round of dialogue, Indicates the confidence that the emotion in the t-th round of dialogue belongs to the i-th type of emotion, represents the probability of emotion transfer from the i-th type of emotion to the j-th type of emotion in the multi-emotion transfer graph, and m represents the total number of emotion types.

8. A computer program product comprising a computer program / instructions, characterized in that: When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor executes the computer program to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: The computer program / instructions, when executed by a processor, implement the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Dialogue-based personal abnormal emotion detection method and device

    CN108197667A

  • Emotion guiding method and system based on emotion semantic transfer graph

    CN111914556A