A method and related device for identifying user emotions
By combining the analysis of emotional characteristics and emotional factors in the user input scenario, the problem of inaccurate emotion recognition in the existing technology is solved, more accurate user emotion recognition is achieved, and the accuracy of the recognition is improved.
Patent Information
- Application Number
- CN202110128395.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-29
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-01-29
AI Technical Summary
The existing technology only recognizes user emotions represented by user input information in user input scenarios, without considering other influencing information, resulting in inaccurate emotion recognition and possible large deviations from real emotions.
By obtaining the user's current input information and emotional factors, emotional feature extraction is performed, and combined with the emotion recognition model, the current emotional features and emotional factors are analyzed to achieve multi-angle comprehensive emotion recognition, including personality types and historical emotion types.
The accuracy of user emotion recognition is improved. It not only analyzes the current emotional characteristics, but also considers the impact of emotional factors on emotional characteristics to achieve more accurate user emotion recognition.
Smart Images

Figure CN112818841B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method for identifying user emotions and related devices. Background Art
[0002] At present, users interact with AI products through input tools, that is, input tools are an important entry point for users to experience AI. When users experience AI through input tools, it is particularly important to identify user emotions in user input scenarios in order to better understand users, provide more intelligent AI services, improve user experience, and increase user stickiness.
[0003] In the prior art, in the user input scenario, emotion recognition is generally performed on the user's input information to obtain the user's emotion. However, the inventors have found through research that this method only recognizes the user's emotion represented by the user's input information, and does not consider the influence of other influencing information on the user's emotion represented by the user's input information, which easily leads to the user's emotion being inaccurately recognized, and there is a high possibility of a large deviation from the real user's emotion. Summary of the invention
[0004] In view of this, the present application provides a method and related devices for identifying user emotions, which realize multi-angle comprehensive emotion recognition and greatly improve the accuracy of user emotion recognition.
[0005] In a first aspect, an embodiment of the present application provides a method for identifying user emotions, the method comprising:
[0006] Obtain the user's current input information and emotional factors;
[0007] Extracting emotion features from the current input information to obtain current emotion features corresponding to the current input information;
[0008] Based on the current emotion feature, the emotion factor and the emotion recognition model, the current emotion type of the user is obtained.
[0009] Optionally, the current input information includes at least two of current text input information, current voice input information and current image input information.
[0010] Optionally, the current image input information includes a current facial image and / or a current body posture image.
[0011] Optionally, the emotional factors include personality type and / or historical emotional type.
[0012] Optionally, the user's personality type is obtained based on the user's preset time period input information and a personality recognition model, wherein the personality recognition model is obtained by pre-training a first preset recognition network based on personality features and personality type labels corresponding to the preset time period input information samples.
[0013] Optionally, the training step of the personality recognition model includes:
[0014] The personality characteristics corresponding to the information sample input in the preset time period are input into the first preset recognition network in time series to obtain a predicted personality type;
[0015] Adjusting parameters of the first preset recognition network based on the predicted personality type, the personality type label and a first preset loss function;
[0016] The first preset recognition network that has been trained is used as the personality recognition model.
[0017] Optionally, the step of obtaining the user's personality type includes:
[0018] Extracting personality characteristics from the user's input information during a preset time period to obtain personality characteristics corresponding to the input information during the preset time period;
[0019] Determine the time sequence of personality characteristics corresponding to the input information in the preset time period;
[0020] The personality characteristics corresponding to the input information of the preset time period are input into the personality recognition model according to the time sequence to obtain the personality type of the user.
[0021] Optionally, the user's historical emotion types are pre-stored in a graph manner and / or an embedded manner.
[0022] Optionally, the emotion recognition model is obtained by pre-training a second preset recognition network based on the emotion features, emotion factor samples and corresponding emotion type labels corresponding to the preset input information samples.
[0023] Optionally, the emotion recognition model training step includes:
[0024] Inputting the emotion feature corresponding to the preset input information sample and the emotion factor sample into the second preset recognition network to obtain a predicted emotion type;
[0025] Adjusting parameters of the second preset recognition network based on the predicted emotion type, the emotion type label and a second preset loss function;
[0026] The trained second preset recognition network is used as the emotion recognition model.
[0027] In a second aspect, an embodiment of the present application provides a device for identifying user emotions, the device comprising:
[0028] A first obtaining unit, used to obtain the user's current input information and emotional factors;
[0029] A second obtaining unit, configured to extract emotion features from the current input information to obtain a current emotion feature corresponding to the current input information;
[0030] The third obtaining unit is used to obtain the current emotion type of the user based on the current emotion feature, the emotion factor and the emotion recognition model.
[0031] Optionally, the current input information includes at least two of current text input information, current voice input information and current image input information.
[0032] Optionally, the current image input information includes a current facial image and / or a current body posture image.
[0033] Optionally, the emotional factors include personality type and / or historical emotional type.
[0034] Optionally, the user's personality type is obtained based on the user's preset time period input information and a personality recognition model; the personality recognition model is obtained by pre-training a first preset recognition network based on personality features and personality type labels corresponding to the preset time period input information samples.
[0035] Optionally, the device further includes a first training unit, wherein the first training unit is configured to:
[0036] The personality characteristics corresponding to the information sample input in the preset time period are input into the first preset recognition network in time series to obtain a predicted personality type;
[0037] Adjusting parameters of the first preset recognition network based on the predicted personality type, the personality type label and a first preset loss function;
[0038] The first preset recognition network that has been trained is used as the personality recognition model.
[0039] Optionally, the device further includes a fourth obtaining unit, and the fourth obtaining unit is used to:
[0040] Extracting personality characteristics from the user's input information during a preset time period to obtain personality characteristics corresponding to the input information during the preset time period;
[0041] Determine the time sequence of personality characteristics corresponding to the input information in the preset time period;
[0042] The personality characteristics corresponding to the input information of the preset time period are input into the personality recognition model according to the time sequence to obtain the personality type of the user.
[0043] Optionally, the user's historical emotion types are pre-stored in a graph manner and / or an embedded manner.
[0044] Optionally, the emotion recognition model is obtained by pre-training a second preset recognition network based on the emotion features, emotion factor samples and corresponding emotion type labels corresponding to the preset input information samples.
[0045] Optionally, the device further includes a second training unit, wherein the second training unit is configured to:
[0046] Inputting the emotion feature corresponding to the preset input information sample and the emotion factor sample into the second preset recognition network to obtain a predicted emotion type;
[0047] Adjusting parameters of the second preset recognition network based on the predicted emotion type, the emotion type label and a second preset loss function;
[0048] The trained second preset recognition network is used as the emotion recognition model.
[0049] In a third aspect, an embodiment of the present application provides a device for identifying user emotions, the device comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations:
[0050] Obtain the user's current input information and emotional factors;
[0051] Extracting emotion features from the current input information to obtain current emotion features corresponding to the current input information;
[0052] Based on the current emotion feature, the emotion factor and the emotion recognition model, the current emotion type of the user is obtained.
[0053] Optionally, the current input information includes at least two of current text input information, current voice input information and current image input information.
[0054] Optionally, the current image input information includes a current facial image and / or a current body posture image.
[0055] Optionally, the emotional factors include personality type and / or historical emotional type.
[0056] Optionally, the user's personality type is obtained based on the user's preset time period input information and a personality recognition model, wherein the personality recognition model is obtained by pre-training a first preset recognition network based on personality features and personality type labels corresponding to the preset time period input information samples.
[0057] Optionally, the device is further configured to execute, by one or more processors, the one or more programs including instructions for performing the following operations:
[0058] The personality characteristics corresponding to the information sample input in the preset time period are input into the first preset recognition network in time series to obtain a predicted personality type;
[0059] Adjusting parameters of the first preset recognition network based on the predicted personality type, the personality type label and a first preset loss function;
[0060] The first preset recognition network that has been trained is used as the personality recognition model.
[0061] Optionally, the device is further configured to execute, by one or more processors, the one or more programs including instructions for performing the following operations:
[0062] Extracting personality characteristics from the user's input information during a preset time period to obtain personality characteristics corresponding to the input information during the preset time period;
[0063] Determine the time sequence of personality characteristics corresponding to the input information in the preset time period;
[0064] The personality characteristics corresponding to the input information of the preset time period are input into the personality recognition model according to the time sequence to obtain the personality type of the user.
[0065] Optionally, the user's historical emotion types are pre-stored in a graph manner and / or an embedded manner.
[0066] Optionally, the emotion recognition model is obtained by pre-training a second preset recognition network based on the emotion features, emotion factor samples and corresponding emotion type labels corresponding to the preset input information samples.
[0067] Optionally, the device is further configured to execute, by one or more processors, the one or more programs including instructions for performing the following operations:
[0068] Inputting the emotion feature corresponding to the preset input information sample and the emotion factor sample into the second preset recognition network to obtain a predicted emotion type;
[0069] Adjusting parameters of the second preset recognition network based on the predicted emotion type, the emotion type label and the second preset loss function;
[0070] The trained second preset recognition network is used as the emotion recognition model.
[0071] In a fourth aspect, an embodiment of the present application provides a machine-readable medium having instructions stored thereon, which, when executed by one or more processors, enables a device to execute the method for identifying user emotions as described in any one of the above-mentioned first aspects.
[0072] Compared with the prior art, this application has at least the following advantages:
[0073] Adopting the technical solution of the embodiment of the present application, first, obtain the user's current input information and emotional factors; then, extract the emotional features of the current input information to obtain the current emotional features corresponding to the current input information; finally, use the emotion recognition model to process the current emotional features and emotional factors to obtain the user's current emotional type. It can be seen that the emotional features of the user's current input information are first extracted to obtain the current emotional features, and then the current emotional features are combined with the user's emotional factors to perform emotion recognition to obtain the user's current emotional type; not only analyze the user's emotions represented by the current emotional features, but also analyze the influence of emotional factors on the user's emotions represented by the current emotional features, so as to achieve multi-angle comprehensive emotion recognition and greatly improve the accuracy of user emotion recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0075] Figure 1 A schematic diagram of a system framework involved in an application scenario in an embodiment of the present application;
[0076] Figure 2 A flowchart of a method for identifying user emotions provided in an embodiment of the present application;
[0077] Figure 3 A schematic diagram of the structure of a device for identifying user emotions provided in an embodiment of the present application;
[0078] Figure 4 A schematic diagram of the structure of a device for identifying user emotions provided in an embodiment of the present application;
[0079] Figure 5A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0080] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0081] At present, in the user input scenario, emotion recognition is generally performed on the user's input information to obtain the user's emotion. However, after research, the inventor found that this method does not consider the impact of other influencing information on the user's emotion represented by the user's input information, and only recognizes the user's emotion represented by the user's input information, which easily leads to the recognized user emotion being inaccurate and likely to deviate greatly from the real user emotion.
[0082] In order to solve this problem, in the embodiment of the present application, first, the user's current input information and emotional factors are obtained; then, the emotional features of the current input information are extracted to obtain the current emotional features corresponding to the current input information; finally, the current emotional features and emotional factors are processed by the emotion recognition model to obtain the user's current emotional type. It can be seen that the emotional features of the user's current input information are first extracted to obtain the current emotional features, and then the current emotional features are combined with the user's emotional factors to perform emotion recognition to obtain the user's current emotional type; not only the user's emotions represented by the current emotional features are analyzed, but also the influence of emotional factors on the user's emotions represented by the current emotional features is analyzed, so as to realize multi-angle comprehensive emotion recognition and greatly improve the accuracy of user emotion recognition.
[0083] For example, one of the scenarios of the embodiment of the present application may be applied to Figure 1 In the scenario shown, the scenario includes a client 101 and a processor 102, and the client 101 and the processor 102 are in the same artificial intelligence product. The user inputs through the input product installed on the client 101, and the processor 102 recognizes the user's emotions using the implementation method provided in the embodiment of the present application, so that the processor 102 performs artificial intelligence services based on the recognized user emotions, making the artificial intelligence product more intelligent.
[0084] It can be understood that in the above application scenario, although the action description of the implementation mode of the present application is executed by the processor 102; however, the present application is not limited in terms of the execution subject, as long as the actions disclosed in the implementation mode of the present application are executed.
[0085] It can be understood that the above scenario is only an example scenario provided by the embodiment of the present application, and the embodiment of the present application is not limited to this scenario.
[0086] The specific implementation of the method for identifying user emotions and related devices in the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0087] Exemplary Methods
[0088] See also Figure 2 , shows a flow chart of a method for identifying user emotions in an embodiment of the present application. In this embodiment, the method may include the following steps:
[0089] Step 201: Obtain the user's current input information and emotional factors.
[0090] In the embodiment of the present application, in order to avoid the low accuracy of the user's emotions obtained by emotion recognition based on the current input information of a single modality, the current input information of the user in at least two different modalities can be obtained to improve the accuracy of subsequent recognition of the user's emotions. The current input information can refer to the input information at the current moment or the input information during the current time period.
[0091] Common user input methods include text input, voice input, and image input; wherein the current input information corresponding to the text input is the current text input information, the current input information corresponding to the voice input is the current voice input information, and the current input information corresponding to the image input is the current image input information, and is generally image input information such as facial images and body posture images that can represent user emotions. Therefore, in an optional implementation of the embodiment of the present application, the current input information includes at least two of the current text input information, the current voice input information, and the current image input information; the current image input information includes the current facial image and / or the current body posture image.
[0092] Among them, the current facial image can be either the current static facial image, for example, the current static facial picture, or the current dynamic facial image, for example, the current dynamic facial picture or the current facial video; similarly, the current body posture image can be either the current static body posture image, for example, the current static body posture picture, or the current dynamic body posture image, for example, the current dynamic body posture picture or the current body posture video.
[0093] Since only the user emotions represented by the user's input information are identified, and the influence of other influencing information on the user emotions represented by the user's input information is not considered, it is easy to cause the identified user emotions to be inaccurate, and there is a high possibility of a large deviation from the real user emotions. Therefore, in the embodiment of the present application, on the basis of obtaining the user's current input information, it is also necessary to obtain information that affects the user emotions represented by the user's current input information as the user's emotional factor.
[0094] Among them, the user emotions represented by the user's current input information under different personality types are different, and the user emotions represented by the user's current input information under different historical emotion types are also different; that is, the user's personality type and historical emotion type affect the user emotion represented by the user's current input information, and any one or two of the personality type and historical emotion type can be used as the user's emotion factor. Therefore, in an optional implementation of the embodiment of the present application, the emotion factor includes the personality type and / or the historical emotion type.
[0095] In the embodiment of the present application, when the emotional factor includes a personality type, since the user's preset time period input information can reflect the user's personality type, the user's preset time period input information can be processed for personality recognition to obtain the user's personality type. For example, the personality type can be openness, responsibility, extroversion, agreeableness, neuroticism, or negativity, etc.
[0096] Among them, the premise of personality recognition processing is to pre-train the first preset recognition network to obtain a personality recognition model through the personality characteristics and personality type labels corresponding to the preset time period input information samples. Based on this, the user's personality type can be obtained by performing personality recognition processing on the user's preset time period input information using the personality recognition model. Therefore, in an optional implementation of the embodiment of the present application, the user's personality type is obtained based on the user's preset time period input information and the personality recognition model; the personality recognition model is obtained by pre-training the first preset recognition network based on the personality characteristics and personality type labels corresponding to the preset time period input information samples.
[0097] The training of the personality recognition model means: after taking the personality characteristics and corresponding personality type labels corresponding to the input information samples of the preset time period sorted according to the time series as training data; it is necessary to train a pre-set recognition network, that is, the first preset recognition network, through the training data to fully explore the correlation information between the personality characteristics and personality type labels corresponding to the input information samples of the preset time period sorted according to the time series; after multiple iterative training of a certain number of the above training data, the personality recognition model can be obtained.
[0098] In the specific implementation, first, the personality characteristics corresponding to the information sample in the preset time period need to be input, and then input into the first preset recognition network in time series. The first preset recognition network can predict the personality type and output the predicted personality type; then, the first preset loss function needs to be used to calculate the loss of the predicted personality type and the personality type label to adjust the parameters of the first preset recognition network; after multiple iterations of training, until the preset number of iterations of training is reached or the first preset recognition network converges, the training of the first preset recognition network is completed, and the trained first preset recognition network is used as the personality recognition model. Therefore, in an optional implementation of the embodiment of the present application, the training step of the personality recognition model includes the following steps:
[0099] Step A: inputting the personality characteristics corresponding to the information sample in the preset time period into the first preset recognition network in time series to obtain the predicted personality type;
[0100] Step B: adjusting the parameters of the first preset recognition network based on the predicted personality type, the personality type label and the first preset loss function;
[0101] Step C: Using the trained first preset recognition network as the personality recognition model.
[0102] Correspondingly, when obtaining the user's personality type, first, it is necessary to extract the personality characteristics in the user's preset time period input information, then it is necessary to determine the time series of the personality characteristics, and finally, the personality characteristics are input into the above-mentioned personality recognition model according to the time series, so as to obtain the user's personality type. In an optional implementation of the embodiment of the present application, the step of obtaining the user's personality type includes:
[0103] Step D: extracting personality characteristics from the user's input information during a preset time period to obtain personality characteristics corresponding to the input information during the preset time period;
[0104] Step E: determining the time series of personality characteristics corresponding to the input information in the preset time period;
[0105] Step F: Inputting the personality characteristics corresponding to the input information of the preset time period into the personality recognition model according to the time sequence to obtain the personality type of the user.
[0106] In an embodiment of the present application, when the emotional factors include historical emotion types, since the historical emotion types of the user are emotion types obtained through historical emotion recognition for the user, the historical emotion types of the user are pre-stored in the user emotion database relative to the user's current input information. The storage method of the historical emotion types of the user may be, for example, a graph method and / or an embedded method. That is, in an optional implementation of the embodiment of the present application, the historical emotion types of the user are pre-stored in a graph method and / or an embedded method.
[0107] When the user's historical emotion type is pre-stored in the form of a graph, a historical emotion type graph is obtained, which is composed of multiple historical emotion type triplets. A single historical emotion type triplet is in the format of (s, p, o), where s refers to the user, p refers to the historical emotion type, and p represents the time relationship between the user and the historical emotion type. The historical emotion type graph is divided into a long-term historical emotion type graph and a short-term historical emotion type graph. The long-term historical emotion type graph memorizes the user's long-term historical emotion type, and the short-term historical emotion type graph memorizes the user's short-term historical emotion type. The short-term historical emotion type graph needs to be updated in a timely manner.
[0108] When the user's historical emotion type is pre-stored by embedding, an embedded historical emotion type module is obtained, which represents multiple historical emotion type triplets with continuous numerical values. The embedded historical emotion type module is also divided into a long-term embedded historical emotion type module and a short-term embedded historical emotion type module. The long-term embedded historical emotion type module memorizes the user's long-term historical emotion type, and the short-term embedded historical emotion type module memorizes the user's short-term historical emotion type. The short-term embedded historical emotion type module also needs to be updated in a timely manner.
[0109] Step 202: extracting emotion features from the current input information to obtain current emotion features corresponding to the current input information.
[0110] In the embodiment of the present application, for the current input information of the user, it is first necessary to extract the emotional features of the user's emotions represented therein as the current emotional features corresponding to the current input information. The current input information corresponding to at least two different modalities includes at least two of the current text input information, the current voice input information, and the current image input information. In the specific implementation of step 202, the specific implementation methods corresponding to the three different modalities of the current input information of the current text input information, the current voice input information, and the current image input information are different, as shown below:
[0111] First, for the current text input information, when the current input information of at least two different modalities includes the current text input information, step 202 may, for example, include: extracting emotion-related semantic features of the first current text input information to obtain the first current emotion semantic features corresponding to the first current text input information.
[0112] Second, for the current voice input information, when the current input information of at least two different modalities includes the current voice input information, step 202 may include, for example: converting the current voice input information into a second current text input information; extracting emotion-related semantic features from the second current text input information to obtain a second current emotional semantic feature corresponding to the second current text input information; extracting emotion-related voice features from the current voice input information to obtain a current emotional voice feature corresponding to the current voice input information. The current voice input information is obtained through pre-emphasis, framing, windowing and other pre-processing to avoid the quality of the current voice input information being affected by factors such as aliasing, high-order harmonic distortion, and high frequency caused by the user's vocal organs and the device that collects the voice input information.
[0113] Third, for the current image input information, when the current input information of at least two different modalities includes the current image input information, step 202 may include, for example: extracting emotion-related image features from the current image input information to obtain current emotion image features corresponding to the current image input information. Wherein, when the current image input information includes the current facial image, the current emotion image features corresponding to the current facial image mainly refer to the current facial features, etc.; when the current image input information includes the current body posture image, the current emotion image features corresponding to the current body posture image mainly refer to the current human body features, etc.
[0114] Step 203: Based on the current emotion characteristics, the emotion factors and the emotion recognition model, the current emotion type of the user is obtained.
[0115] In an embodiment of the present application, after obtaining the current emotional features and the corresponding emotional factors, in order to avoid performing emotion recognition only on the current emotional features, which results in the recognized user emotions being inaccurate and likely to deviate significantly from the actual user emotions; it is necessary to perform emotion recognition based on the current emotional features and the corresponding emotional factors to obtain the user's current emotion type; not only analyze the user emotions represented by the current emotional features, but also analyze the impact of the emotional factors on the user emotions represented by the current emotional features, thereby achieving multi-angle comprehensive emotion recognition and greatly improving the accuracy of user emotion recognition.
[0116] Among them, the current emotion characteristics and the corresponding emotion factors are integrated to perform emotion recognition, which actually means inputting the current emotion characteristics and the corresponding emotion factors into a pre-trained emotion recognition model to identify the emotion type as the user's current emotion type. In an optional implementation of the embodiment of the present application, the emotion recognition model is obtained by pre-training a second preset recognition network based on the emotion characteristics, emotion factor samples and corresponding emotion type labels corresponding to the preset input information samples.
[0117] The training of the emotion recognition model means: after taking the emotion features, emotion factor samples, and emotion type labels corresponding to the preset input information samples as training data; another preset recognition network, that is, the second preset recognition network, needs to be trained through the training data to fully explore the correlation information between the emotion features, emotion factor samples and emotion type labels corresponding to the preset input information samples; after multiple iterative training of a certain number of the above training data, the emotion recognition model can be obtained.
[0118] In the specific implementation, first, the emotional features and emotional factor samples corresponding to the preset input information samples need to be input into the second preset recognition network, and the second preset recognition network can recognize the emotion type and output the predicted emotion type; then, the second preset loss function needs to be used to calculate the loss of the predicted emotion type and the emotion type label to adjust the parameters of the second preset recognition network; after multiple iterations of training, until the preset number of iterations of training is reached or the second preset recognition network converges, the training of the second preset recognition network is completed, and the trained second preset recognition network is used as the emotion recognition model. That is, in an optional implementation of the embodiment of the present application, the training steps of the emotion recognition model include:
[0119] Step G: Inputting the emotion feature corresponding to the preset input information sample and the emotion factor sample into the second preset recognition network to obtain a predicted emotion type;
[0120] Step H: adjusting the parameters of the second preset recognition network based on the predicted emotion type, the emotion type label and the second preset loss function;
[0121] Step I: Using the trained second preset recognition network as the emotion recognition model.
[0122] As an example, the current input information of the user includes the current text input information and the current image input information of the user, the current text input information is "I like eating apples so much", and the current image input information is the current facial image; the emotional image information includes the personality type, and the personality type is extroversion. The emotion-related emotional features of the current text input information "I like eating apples so much" are extracted to obtain the current emotional semantic features corresponding to the current text input information "I like eating apples so much"; the image features related to the emotions of the current image input information - the current facial image are extracted to obtain the current emotional image features corresponding to the current image input information - the current facial image; the current emotional semantic features and the current emotional image features constitute the current emotional features. Compared with the current emotional type of the user obtained by only performing emotional recognition on the current emotional features as happiness, based on the current emotional features, the personality type - extroversion and the emotional recognition model, the current emotional type of the user is obtained as general, and the multi-angle comprehensive emotional recognition is more accurate.
[0123] As another example, in the above example, the current input information remains unchanged, the emotional image information includes the personality type, and the personality type is negativity. Referring to the above example for details, compared with the current emotional type of the user being happy obtained by only performing emotional recognition on the current emotional feature, based on the current emotional feature, the personality type-negativity and the emotion recognition model, the current emotional type of the user is obtained as very happy.
[0124] Through the various implementation methods provided in this embodiment, first, the user's current input information and emotional factors are obtained; then, the emotional features of the current input information are extracted to obtain the current emotional features corresponding to the current input information; finally, the current emotional features and emotional factors are processed using the emotion recognition model to obtain the user's current emotional type. It can be seen that the emotional features of the user's current input information are first extracted to obtain the current emotional features, and then the current emotional features are combined with the user's emotional factors to perform emotion recognition to obtain the user's current emotional type; not only the user's emotions represented by the current emotional features are analyzed, but also the influence of emotional factors on the user's emotions represented by the current emotional features is analyzed, so as to realize multi-angle comprehensive emotion recognition and greatly improve the accuracy of user emotion recognition.
[0125] Exemplary Devices
[0126] See also Figure 3 , shows a schematic diagram of the structure of a device for identifying user emotions in an embodiment of the present application. In this embodiment, the device may specifically include:
[0127] The first obtaining unit 301 is used to obtain the current input information and emotional factors of the user;
[0128] The second obtaining unit 302 is used to extract the emotion feature of the current input information to obtain the current emotion feature corresponding to the current input information;
[0129] The third obtaining unit 303 is used to obtain the current emotion type of the user based on the current emotion feature, the emotion factor and the emotion recognition model.
[0130] In an optional implementation of the embodiment of the present application, the current input information includes at least two of current text input information, current voice input information and current image input information.
[0131] In an optional implementation of the embodiment of the present application, the current image input information includes a current facial image and / or a current body posture image.
[0132] In an optional implementation of the embodiment of the present application, the emotional factors include personality type and / or historical emotional type.
[0133] In an optional implementation of the embodiment of the present application, the user's personality type is obtained based on the user's preset time period input information and a personality recognition model; the personality recognition model is obtained by pre-training a first preset recognition network based on the personality characteristics and personality type labels corresponding to the preset time period input information samples.
[0134] In an optional implementation manner of the embodiment of the present application, the device further includes a first training unit, and the first training unit is used to:
[0135] The personality characteristics corresponding to the information sample input in the preset time period are input into the first preset recognition network in time series to obtain a predicted personality type;
[0136] Adjusting parameters of the first preset recognition network based on the predicted personality type, the personality type label and a first preset loss function;
[0137] The first preset recognition network that has been trained is used as the personality recognition model.
[0138] In an optional implementation manner of the embodiment of the present application, the apparatus further includes a fourth obtaining unit, and the fourth obtaining unit is used to:
[0139] Extracting personality characteristics from the user's input information during a preset time period to obtain personality characteristics corresponding to the input information during the preset time period;
[0140] Determine the time sequence of personality characteristics corresponding to the input information in the preset time period;
[0141] The personality characteristics corresponding to the input information of the preset time period are input into the personality recognition model according to the time sequence to obtain the personality type of the user.
[0142] In an optional implementation of the embodiment of the present application, the user's historical emotion type is pre-stored in a graph manner and / or an embedded manner.
[0143] In an optional implementation of the embodiment of the present application, the emotion recognition model is obtained by pre-training a second preset recognition network based on the emotion features, emotion factor samples and corresponding emotion type labels corresponding to the preset input information samples.
[0144] In an optional implementation manner of the embodiment of the present application, the device further includes a second training unit, and the second training unit is used to:
[0145] Inputting the emotion feature corresponding to the preset input information sample and the emotion factor sample into the second preset recognition network to obtain a predicted emotion type;
[0146] Adjusting parameters of the second preset recognition network based on the predicted emotion type, the emotion type label and the second preset loss function;
[0147] The trained second preset recognition network is used as the emotion recognition model.
[0148] Through the various implementation methods provided in this embodiment, first, the user's current input information and emotional factors are obtained; then, the emotional features of the current input information are extracted to obtain the current emotional features corresponding to the current input information; finally, the current emotional features and emotional factors are processed using the emotion recognition model to obtain the user's current emotional type. It can be seen that the emotional features of the user's current input information are first extracted to obtain the current emotional features, and then the current emotional features are combined with the user's emotional factors to perform emotion recognition to obtain the user's current emotional type; not only the user's emotions represented by the current emotional features are analyzed, but also the influence of emotional factors on the user's emotions represented by the current emotional features is analyzed, so as to realize multi-angle comprehensive emotion recognition and greatly improve the accuracy of user emotion recognition.
[0149] Figure 4 4 is a block diagram of an apparatus 400 for identifying user emotions according to an exemplary embodiment. For example, the apparatus 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0150] Reference Figure 4, the device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .
[0151] The processing component 402 generally controls the overall operation of the device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.
[0152] The memory 404 is configured to store various types of data to support operations on the device 400. Examples of such data include instructions for any application or method operating on the device 400, contact data, phone book data, messages, pictures, videos, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0153] The power supply component 406 provides power to the various components of the device 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 400.
[0154] The multimedia component 408 includes a screen that provides an output interface between the device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the device 400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0155] The audio component 410 is configured to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the device 400 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.
[0156] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0157] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the device 400. For example, the sensor assembly 414 can detect the open / closed state of the device 400, the relative positioning of components, such as the display and keypad of the device 400, and the sensor assembly 414 can also detect the position change of the device 400 or a component of the device 400, the presence or absence of user contact with the device 400, the orientation or acceleration / deceleration of the device 400, and the temperature change of the device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0158] The communication component 416 is configured to facilitate wired or wireless communication between the device 400 and other devices. The device 400 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0159] In an exemplary embodiment, the apparatus 400 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0160] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the instructions can be executed by a processor 420 of the device 400 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0161] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a mobile terminal, enables the mobile terminal to perform a method for identifying user emotions, the method comprising:
[0162] Obtain the user's current input information and emotional factors;
[0163] Extracting emotion features from the current input information to obtain current emotion features corresponding to the current input information;
[0164] Based on the current emotion feature, the emotion factor and the emotion recognition model, the current emotion type of the user is obtained.
[0165] In an optional implementation of the embodiment of the present application, the current input information includes at least two of current text input information, current voice input information and current image input information.
[0166] In an optional implementation of the embodiment of the present application, the current image input information includes a current facial image and / or a current body posture image.
[0167] In an optional implementation of the embodiment of the present application, the emotional factors include personality type and / or historical emotional type.
[0168] In an optional implementation of the embodiment of the present application, the user's personality type is obtained based on the user's preset time period input information and a personality recognition model, wherein the personality recognition model is obtained by pre-training a first preset recognition network based on personality features and personality type labels corresponding to the preset time period input information samples.
[0169] In an optional implementation of the embodiment of the present application, the step of training the personality recognition model includes:
[0170] The personality characteristics corresponding to the information sample input in the preset time period are input into the first preset recognition network in time series to obtain a predicted personality type;
[0171] Adjusting parameters of the first preset recognition network based on the predicted personality type, the personality type label and a first preset loss function;
[0172] The first preset recognition network that has been trained is used as the personality recognition model.
[0173] In an optional implementation of the embodiment of the present application, the step of obtaining the personality type of the user includes:
[0174] Extracting personality characteristics from the user's input information during a preset time period to obtain personality characteristics corresponding to the input information during the preset time period;
[0175] Determine the time sequence of personality characteristics corresponding to the input information in the preset time period;
[0176] The personality characteristics corresponding to the input information of the preset time period are input into the personality recognition model according to the time sequence to obtain the personality type of the user.
[0177] In an optional implementation of the embodiment of the present application, the user's historical emotion type is pre-stored in a graph manner and / or an embedded manner.
[0178] In an optional implementation of the embodiment of the present application, the emotion recognition model is obtained by pre-training a second preset recognition network based on the emotion features, emotion factor samples and corresponding emotion type labels corresponding to the preset input information samples.
[0179] In an optional implementation of the embodiment of the present application, the step of training the emotion recognition model includes:
[0180] Inputting the emotion feature corresponding to the preset input information sample and the emotion factor sample into the second preset recognition network to obtain a predicted emotion type;
[0181] Adjusting parameters of the second preset recognition network based on the predicted emotion type, the emotion type label and the second preset loss function;
[0182] The trained second preset recognition network is used as the emotion recognition model.
[0183] Figure 5 : is a schematic diagram of the structure of the server in the embodiment of the present application. The server 500 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 522 (for example, one or more processors) and a memory 532, and one or more storage media 530 (for example, one or more mass storage devices) storing application programs 542 or data 544. Among them, the memory 532 and the storage medium 530 can be temporary storage or permanent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 522 can be configured to communicate with the storage medium 530 and execute a series of instruction operations in the storage medium 530 on the server 500.
[0184] The server 500 may also include one or more power supplies 526, one or more wired or wireless network interfaces 550, one or more input and output interfaces 558, one or more keyboards 556, and / or one or more operating systems 541, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0185] 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.
[0186] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0187] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprises a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0188] The above is only a preferred embodiment of the present application and does not constitute any formal limitation to the present application. Although the present application has been disclosed as above with a preferred embodiment, it is not intended to limit the present application. Any technician familiar with the art can make many possible changes and modifications to the technical solution of the present application using the methods and technical contents disclosed above without departing from the scope of the technical solution of the present application, or modify it into an equivalent embodiment of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application still fall within the scope of protection of the technical solution of the present application.
Claims
1. A method for identifying user emotions, characterized in that: include: Obtaining current input information and emotional factors of the user, the current input information including at least two of current text input information, current voice input information and current image input information, the current image input information including a current facial image and a current body posture image, the emotional factors including a personality type and a historical emotional type, the current input information of the user representing different user emotions under different personality types and historical emotional types; When the current input information includes the current text information input information and the current image input information, performing emotion-related semantic feature extraction on the current text information to obtain current emotion semantic features corresponding to the current text input information, and performing emotion-related image feature extraction on the current image input information to obtain current emotion image features corresponding to the current image input information; Combining the current emotion semantic feature and the current emotion image feature into a current emotion feature; Obtaining the current emotion type of the user based on the current emotion feature, the personality type, the historical emotion type and the emotion recognition model; The training steps of the emotion recognition model include: Inputting the emotion feature corresponding to the preset input information sample and the emotion factor sample into the second preset recognition network to obtain a predicted emotion type; Adjusting parameters of the second preset recognition network based on the predicted emotion type, the emotion type label and a second preset loss function; The trained second preset recognition network is used as the emotion recognition model.
2. The method according to claim 1, characterized in that The user's personality type is obtained based on the user's preset time period input information and a personality recognition model, wherein the personality recognition model is obtained by pre-training a first preset recognition network based on personality features and personality type labels corresponding to the preset time period input information samples.
3. The method according to claim 2, characterized in that The training steps of the personality recognition model include: The personality characteristics corresponding to the information sample input in the preset time period are input into the first preset recognition network in time series to obtain a predicted personality type; Adjusting parameters of the first preset recognition network based on the predicted personality type, the personality type label and a first preset loss function; The first preset recognition network that has been trained is used as the personality recognition model.
4. The method according to claim 3, characterized in that The step of obtaining the personality type of the user comprises: Extracting personality characteristics from the user's input information during a preset time period to obtain personality characteristics corresponding to the input information during the preset time period; Determine the time sequence of personality characteristics corresponding to the input information in the preset time period; The personality characteristics corresponding to the input information of the preset time period are input into the personality recognition model according to the time sequence to obtain the personality type of the user.
5. The method according to claim 3, characterized in that: The user's historical emotion types are pre-stored in a graph manner and / or an embedded manner.
6. A device for identifying user emotions, characterized in that: include: A first obtaining unit is used to obtain current input information and emotional factors of the user, wherein the current input information includes at least two of current text input information, current voice input information and current image input information, wherein the current image input information includes a current facial image and a current body posture image, and the emotional factors include a personality type and a historical emotional type, and the user's current input information under different personality types and historical emotional types represents different user emotions; A second obtaining unit is used for, when the current input information includes the current text information input information and the current image input information, extracting emotion-related semantic features from the current text information to obtain current emotion semantic features corresponding to the current text input information, and extracting emotion-related image features from the current image input information to obtain current emotion image features corresponding to the current image input information; and combining the current emotion semantic features and the current emotion image features into a current emotion feature; a third obtaining unit, configured to obtain the current emotion type of the user based on the current emotion feature, the personality type, the historical emotion type and the emotion recognition model when the emotion factor includes the personality type; the device further comprises a second training unit, the second training unit being configured to: Inputting the emotion feature corresponding to the preset input information sample and the emotion factor sample into the second preset recognition network to obtain a predicted emotion type; Adjusting parameters of the second preset recognition network based on the predicted emotion type, the emotion type label and a second preset loss function; The trained second preset recognition network is used as the emotion recognition model.
7. The device according to claim 6, characterized in that The user's personality type is obtained based on the user's preset time period input information and a personality recognition model; the personality recognition model is obtained by pre-training a first preset recognition network based on personality characteristics and personality type labels corresponding to the preset time period input information samples.
8. The device according to claim 7, characterized in that The apparatus further comprises a first training unit, wherein the first training unit is configured to: The personality characteristics corresponding to the information sample input in the preset time period are input into the first preset recognition network in time series to obtain a predicted personality type; Adjusting parameters of the first preset recognition network based on the predicted personality type, the personality type label and a first preset loss function; The first preset recognition network that has been trained is used as the personality recognition model.
9. The device according to claim 8, characterized in that The device further includes a fourth obtaining unit, wherein the fourth obtaining unit is configured to: Extracting personality characteristics from the user's input information during a preset time period to obtain personality characteristics corresponding to the input information during the preset time period; Determine the time sequence of personality characteristics corresponding to the input information in the preset time period; The personality characteristics corresponding to the input information of the preset time period are input into the personality recognition model according to the time sequence to obtain the personality type of the user.
10. The device according to claim 6, characterized in that The user's historical emotion types are pre-stored in a graph manner and / or an embedded manner.
11. A device for identifying user emotions, characterized in that: It includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to perform the method for identifying user emotions as described in any one of claims 1 to 5.
12. A machine-readable medium having instructions stored thereon, which, when executed by one or more processors, causes a device to perform the method for identifying user emotions as claimed in any one of claims 1 to 5.
Citation Information
Patent Citations
Program screening method, program screening system and television with program screening system
CN103024521A
Candidate word generation method and device
CN110858099A
Emotion assessment terminal, emotion assessment program, and emotion assessment method
JP2020113217A
