Knowledge-enhanced product question and answer community user dialogue emotion recognition method and system

By building a user-personalized emotion dictionary and a cross-modal Transformer, combined with LSTM and GCN networks, and adopting a two-layer supervised contrastive learning strategy, the problem of insufficient personalization of emotion recognition in the existing technology is solved and higher accuracy is achieved. emotion recognition.

CN118821045AActive Publication Date: 2024-10-22HEFEI UNIV OF TECH

Patent Information

Application Number
CN202410886322.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-10-22
Estimated Expiration
2044-07-03

AI Technical Summary

Technical Problem

The existing technology ignores the differences in the perception and expression of emotional information by different users, resulting in insufficiently personalized emotion recognition.

Method used

By constructing the user's personalized emotion dictionary, the preference knowledge embedding vector is obtained, and the cross-modal Transformer is used to fuse multi-modal data. The LSTM and GCN networks are combined to model context and situational relationships, and a two-layer supervised contrastive learning strategy is used for emotion recognition.

Benefits of technology

It achieves personalized emotion recognition, improves the accuracy and fine-grainedness of emotion recognition, and can capture the user's emotional state more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118821045A_ABST
    Figure CN118821045A_ABST
Patent Text Reader

Abstract

The invention provides a knowledge-enhanced product question and answer community user dialogue emotion recognition method and system, a storage medium and electronic equipment, and relates to the field of dialogue emotion recognition. According to the method, a user personalized emotion dictionary is constructed through user keyword extraction and a dictionary extension algorithm, and preference knowledge embedding vectors are obtained; fusing the dialogue text embedding vector, the dialogue visual embedding vector and the dialogue audio embedding vector which are enhanced by emotional knowledge through a cross-modal Transform to obtain a dialogue feature vector after knowledge enhancement; based on a dialogue situation GCN network, considering a context in the multi-round question and answer information and a situation relationship between dialogue users, and obtaining a global situation vector; and carrying out personalized emotion recognition by considering the interaction between the global situation vector and the dialogue feature vector. In addition, a double-layer supervised contrast learning strategy based on an emotion layer and a multi-modal layer is provided, the model is promoted to learn multi-modal feature representation with higher discrimination, and the accuracy and fine granularity of emotion recognition are further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of conversation emotion recognition, and in particular to a method, system, storage medium and electronic device for recognizing conversation emotions among users of a knowledge-enhanced product question-and-answer community. Background Art

[0002] In recent years, with the rapid development of Internet technology, product Q&A communities have become an important platform for knowledge sharing and user interaction. The dialogues between questioners and answerers in product Q&A communities and their emotional expressions reflect users' satisfaction with the quality of answers in the community. Providing users with satisfactory answers can promote knowledge sharing, improve the information quality of the community, and maintain the healthy development of the community.

[0003] In related technologies, question-and-answer community platforms monitor and analyze users' emotional states in real time. Once users express dissatisfaction, the platform can promptly invite technical experts in the field to intervene and provide users with professional answers and support. In addition, the platform can also dynamically adjust its response strategy based on the results of sentiment analysis, in order to achieve positive feedback and effective response to user needs. The implementation of this strategy can improve user satisfaction and help the platform build a positive image, thereby attracting more potential users to participate in community interactions and discussions, and further expanding the scale and influence of the community.

[0004] However, existing solutions are usually generalized models. Considering that different users perceive and express emotional information differently, it is necessary to provide a new emotion recognition technology solution to achieve personalized emotion recognition. Summary of the invention

[0005] 1. Technical issues to be solved

[0006] In view of the deficiencies in the prior art, the present invention provides a knowledge-enhanced product question-and-answer community user conversation emotion recognition method, system, storage medium and electronic device, which solves the technical problem of ignoring that different users have different perceptions and expressions of emotional information.

[0007] (II) Technical solution

[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions:

[0009] A knowledge-enhanced method for identifying user conversation emotions in a product question-and-answer community, based on a preset model, including:

[0010] Acquire historical multi-round question-and-answer information of multiple product question-and-answer communities; each of the historical multi-round question-and-answer information includes multimodal conversation data of users and their emotion labels, and each piece of multimodal conversation data includes text, visual, and audio modality information;

[0011] For the current historical multi-round question-and-answer information, obtain a conversation text embedding vector, a conversation visual embedding vector, and a conversation audio embedding vector corresponding to each piece of the multimodal conversation data;

[0012] For any of the multimodal dialogue data, the similarity between each original word of its text modal information and the keywords in the pre-built user personalized sentiment dictionary is calculated, the embedding representation of each original word is concatenated with the preference knowledge embedding vector corresponding to the keyword with the highest similarity, and the corresponding highest similarity is used as a weight to multiply the concatenation result to obtain a knowledge-enhanced dialogue text embedding vector;

[0013] Taking the knowledge-enhanced conversation text embedding vector as the main modality, and fusing it with the conversation visual embedding vector and the conversation audio embedding vector using a cross-modal Transformer to obtain a knowledge-enhanced conversation feature vector for each of the multimodal conversation data;

[0014] Based on the conversation feature vector, an LSTM network is used to model the contextual emotional dependency relationship of each user in the multimodal conversation data to obtain a contextual situation vector of personalized preference knowledge perception; and based on the contextual situation vector, a global conversation graph is constructed, and a GCN network is used to model the emotional dependency relationship between users in each multimodal conversation data to obtain a global situation vector storing a global context state;

[0015] According to the interaction between the dialogue feature vector and the global context vector, an emotion recognition prediction result of each piece of the multimodal dialogue data is obtained through a collaborative attention mechanism;

[0016] According to the conversation text embedding vector, conversation visual embedding vector and conversation audio embedding vector corresponding to each piece of the multimodal conversation data, a contrastive learning loss is constructed based on a double-layer supervised contrastive learning strategy of an emotional layer and a multimodal layer; according to the emotion label and emotion recognition prediction result of each piece of the multimodal conversation data, a cross entropy loss is constructed; and a joint loss function of the contrastive learning loss and the cross entropy loss is minimized to train the model until convergence;

[0017] The multi-round question-and-answer information to be recognized is used as the input of the converged model to obtain the emotion recognition result of each multimodal dialogue data in the multi-round question-and-answer information.

[0018] Preferably, the process of obtaining contrastive learning loss based on sentiment layer includes:

[0019] Map the conversation text embedding vector, conversation visual embedding vector, and conversation audio embedding vector into the three-dimensional VAD emotion space:

[0020]

[0021] Among them, the modality m∈{T,V,A}, T,V,A are the text, visual and audio modality information in the multimodal conversation data respectively; is the corresponding multimodal embedding vector, is the feature representation mapped to the VAD emotion space, i is the index of the multimodal dialogue data; R is the set; W is the weight parameter; b is the bias term;

[0022] Introducing manually labeled e for each emotion in the VAD emotion space c ∈R 3 ; where c∈E represents the emotion category, E represents the set of emotion label categories, and e c Represents the VAD vector corresponding to the true emotion label;

[0023] Each piece of the multimodal conversation data is taken as a sample, and the feature representation of the three modal information in each sample is mapped to the VAD emotional space. The VAD vector corresponding to its true emotion label is regarded as a positive sample pair, and the VAD vector of other types of emotions is regarded as a negative sample pair, and the first contrastive learning loss is constructed:

[0024]

[0025] Where |E| is the number of emotion categories; the hyperparameter λ m It is used to adjust the weight of the loss function for comparing the consistency between each modality information and the label; log is the logarithmic function; Represents the true emotion label y of the i-th multimodal dialogue data i The corresponding VAD vector; represents the dot product operation, which is used to calculate the similarity between vectors; τ is a learnable hyperparameter.

[0026] Preferably, the process of obtaining a contrastive learning loss based on a multimodal layer comprises:

[0027] The multimodal embedding vectors of samples with the same type of emotions are regarded as positive sample pairs, and the multimodal embedding vectors of samples with different types of emotions are regarded as negative sample pairs, and the second contrastive learning loss is constructed:

[0028]

[0029] Among them, m1 and m2 are two arbitrary modes; λ m1,m2 N is the weight hyperparameter for contrast learning between different modalities; d is the number of samples of previous multi-round question-answering information; The label is y in the current multi-round question-answer information i The number of samples; j and k are the indexes of the multimodal conversation data used as samples.

[0030] Preferably, the process of constructing the user personalized sentiment dictionary includes:

[0031] The manually annotated sentiment dictionary NRC-VAD Chinese version is selected as the basic sentiment dictionary, expressed as Where (V i , A i , D i ) is the word w i The features of represent the corresponding VAD emotional state vector, which represents the scores of activation, pleasure, and dominance in three dimensions as V i , A i , D i , and the value range of the three is between 0 and 1;

[0032] Crawl the historical Q&A information of all users in the current product Q&A community, build a Q&A corpus in the target domain, remove stop words to get a domain dictionary W, and use the dictionary to train a Word2Vec model to map each word in W to a high-dimensional vector containing the semantic information of the word, and use cosine similarity to measure the semantic similarity between any two words;

[0033] For words in W, either they belong to the dictionary L0 or they do not belong to the basic sentiment dictionary L0. Through the semantic similarity between any two words, there are several similar words. If there is a similar word belonging to the dictionary L0, then the word is regarded as a potential sentiment word and added to the potential sentiment word set P;

[0034] For each emotional word in the set P, define algorithm f to map its feature representation into a VAD emotional state vector; if the three dimensions of the VAD emotional state vector are all greater than 0, then add the emotional word and the corresponding VAD emotional state vector to the dictionary L0, and record the expanded domain emotional dictionary as L new ;

[0035] Collect the historical question and answer information of the current user and treat it as a document. Remove the stop words in the document and then perform word segmentation.

[0036] The TF-IDF method is used to extract all keywords from the preprocessed documents;

[0037] If the keyword is in the expanded domain sentiment dictionary L new Then find the VAD emotional state vector corresponding to the keyword; if the keyword is not in the expanded domain emotional dictionary L new In , a zero vector is used instead;

[0038] The TF-IDF value of the keyword is used as a weight to multiply the VAD emotional state vector or the zero vector to obtain the corresponding preference knowledge embedding vector;

[0039] Each keyword and the corresponding preference knowledge embedding vector are summarized to construct the user personalized sentiment dictionary.

[0040] Preferably, cosine similarity is used to calculate the similarity between each original word of the text modal information and a keyword in a pre-constructed user personalized sentiment dictionary.

[0041] Preferably, the method uses the knowledge-enhanced dialogue text embedding vector as the main modality, and fuses it with the dialogue visual embedding vector and the dialogue audio embedding vector using a cross-modal Transformer to obtain the knowledge-enhanced dialogue feature vector of each multimodal dialogue data; including:

[0042] Using a connection temporal classification model, adjusting the sequence lengths of the knowledge-enhanced conversation text embedding vector, the conversation visual embedding vector, and the conversation audio embedding vector to reach a unified standard;

[0043] Taking the knowledge-enhanced dialogue text embedding vector as the main modality, the similarity matrix between the standardized text and audio, and between the text and visual information is calculated by a dot product operation of the normalized vector, and the similarity matrix is ​​activated by a Softmax function as a weight matrix, and multiplied with the embedding vector of the corresponding non-text modality to obtain a weighted dialogue visual embedding vector and a dialogue audio embedding vector, respectively;

[0044] A cross-modal Transformer is used to fuse the knowledge-enhanced conversation text embedding vector, the weighted conversation visual embedding vector and the conversation audio embedding vector to obtain a knowledge-enhanced conversation feature vector for each of the multimodal conversation data.

[0045] A knowledge-enhanced product question-and-answer community user dialogue emotion recognition system based on a preset model, including:

[0046] An information acquisition module, used to acquire historical multi-round question-and-answer information of multiple product question-and-answer communities; each of the historical multi-round question-and-answer information includes a user's multimodal conversation data and its emotion label, and each of the multimodal conversation data includes text, visual and audio modality information;

[0047] A feature representation module is used to obtain a conversation text embedding vector, a conversation visual embedding vector, and a conversation audio embedding vector corresponding to each piece of the multimodal conversation data for the current historical multi-round question and answer information;

[0048] A preference knowledge embedding module is used to calculate the similarity between each original word of the text modal information and the keywords in the pre-built user personalized sentiment dictionary for any of the multimodal dialogue data, concatenate the embedding representation of each original word with the preference knowledge embedding vector corresponding to the keyword with the highest similarity, and multiply the concatenation result with the corresponding highest similarity as a weight to obtain a knowledge-enhanced dialogue text embedding vector;

[0049] A cross-modal fusion module, used to use the knowledge-enhanced conversation text embedding vector as the main modality, and fuse it with the conversation visual embedding vector and the conversation audio embedding vector using a cross-modal Transformer to obtain a knowledge-enhanced conversation feature vector for each of the multi-modal conversation data;

[0050] A dialogue scenario modeling module is used to model the context emotion dependency relationship of each user in the multimodal dialogue data using an LSTM network according to the dialogue feature vector to obtain a context scenario vector of personalized preference knowledge perception; and to construct a global dialogue graph according to the context scenario vector, and to model the emotion dependency relationship between users in each multimodal dialogue data using a GCN network to obtain a global scenario vector storing a global context state;

[0051] An emotion prediction module, which obtains an emotion recognition prediction result of each piece of the multimodal dialogue data through a collaborative attention mechanism according to the interaction between the dialogue feature vector and the global context vector;

[0052] A model training module, configured to construct a contrastive learning loss based on a double-layer supervised contrastive learning strategy of an emotional layer and a multimodal layer according to a conversation text embedding vector, a conversation visual embedding vector, and a conversation audio embedding vector corresponding to each piece of the multimodal conversation data; construct a cross entropy loss according to an emotion label and an emotion recognition prediction result of each piece of the multimodal conversation data; and minimize a joint loss function of the contrastive learning loss and the cross entropy loss to train the model until convergence;

[0053] The emotion recognition module is used to use the multi-round question and answer information to be recognized as the input of the converged model to obtain the emotion recognition result of each multimodal dialogue data in the multi-round question and answer information.

[0054] Preferably, it also includes a dictionary construction module for constructing the user personalized sentiment dictionary, and the construction process includes:

[0055] The manually annotated sentiment dictionary NRC-VAD Chinese version is selected as the basic sentiment dictionary, expressed as Where (V i , A i , D i ) is the word wi The features of represent the corresponding VAD emotional state vector, which represents the scores of activation, pleasure, and dominance in three dimensions as V i , A i , D i , and the value range of the three is between 0 and 1;

[0056] Crawl the historical Q&A information of all users in the current product Q&A community, build a Q&A corpus in the target domain, remove stop words to get a domain dictionary W, and use the dictionary to train a Word2Vec model to map each word in W to a high-dimensional vector containing the semantic information of the word, and use cosine similarity to measure the semantic similarity between any two words;

[0057] For words in W, either they belong to the dictionary L0 or they do not belong to the basic sentiment dictionary L0. Through the semantic similarity between any two words, there are several similar words. If there is a similar word belonging to the dictionary L0, then the word is regarded as a potential sentiment word and added to the potential sentiment word set P;

[0058] For each emotional word in the set P, define algorithm f to map its feature representation into a VAD emotional state vector; if the three dimensions of the VAD emotional state vector are all greater than 0, then add the emotional word and the corresponding VAD emotional state vector to the dictionary L0, and record the expanded domain emotional dictionary as L new ;

[0059] Collect the historical question and answer information of the current user and treat it as a document. Remove the stop words in the document and then perform word segmentation.

[0060] The TF-IDF method is used to extract all keywords from the preprocessed documents;

[0061] If the keyword is in the expanded domain sentiment dictionary L new Then find the VAD emotional state vector corresponding to the keyword; if the keyword is not in the expanded domain emotional dictionary L new In , a zero vector is used instead;

[0062] The TF-IDF value of the keyword is used as a weight to multiply the VAD emotional state vector or the zero vector to obtain the corresponding preference knowledge embedding vector;

[0063] Each keyword and the corresponding preference knowledge embedding vector are summarized to construct the user personalized sentiment dictionary.

[0064] A storage medium stores a computer program for identifying emotions in user conversations in a product question-and-answer community for knowledge enhancement, wherein the computer program enables a computer to execute the method for identifying emotions in user conversations in a product question-and-answer community as described above.

[0065] An electronic device, comprising:

[0066] One or more processors; 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 the one or more processors, and the programs include a method for executing the product question and answer community user conversation emotion recognition method as described above.

[0067] (III) Beneficial effects

[0068] The present invention provides a method, system, storage medium and electronic device for identifying emotions in user conversations in a knowledge-enhanced product question-and-answer community. Compared with the prior art, the present invention has the following beneficial effects:

[0069] In the present invention, a personalized user sentiment dictionary is constructed through user keyword extraction and dictionary expansion algorithms to obtain preference knowledge embedding vectors; a cross-modal Transformer enhanced with preference knowledge is used to fuse the dialogue text embedding vector, dialogue visual embedding vector and dialogue audio embedding vector enhanced with sentiment knowledge to obtain the dialogue feature vector enhanced with knowledge; a dialogue context GCN network based on personalized preference perception is used to consider the context in multiple rounds of question and answer information and the contextual relationship between dialogue users to obtain a personalized preference-aware global context vector; personalized emotion recognition is performed by considering the interaction between the global context vector and the dialogue feature vector enhanced with knowledge. In addition, a two-layer supervised contrast learning strategy based on the sentiment layer and the multimodal layer is proposed to enable the model to learn more discriminative multimodal feature representations, further improving the accuracy and granularity of emotion recognition. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0071] Figure 1 A method for identifying emotions in user conversations in a knowledge-enhanced product question-and-answer community provided by an embodiment of the present invention Figure 2

[0072] Figure 2A process for identifying emotions in user conversations in a knowledge-enhanced product question-and-answer community provided by an embodiment of the present invention Figure 2

[0073] Figure 3 A schematic diagram of multimodal feature fusion based on a cross-modal Transformer provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0074] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0075] The embodiments of the present application solve the technical problem of ignoring that different users have different perceptions and expressions of emotional information by providing a knowledge-enhanced product question-and-answer community user conversation emotion recognition method, system, storage medium and electronic device, thereby achieving personalized emotion recognition.

[0076] The technical solution in the embodiment of the present application is to solve the above technical problems, and the overall idea is as follows:

[0077] The embodiment of the present invention proposes a personalized user emotion recognition method for a multi-round dialogue scenario in a product question-and-answer community, and the key points involved are at least as follows:

[0078] First, build a personalized sentiment dictionary based on the historical question-and-answer information of users in the current product question-and-answer community, query the preference knowledge embedding vector corresponding to each keyword, embed the conversation text vector with knowledge enhancement, and merge it with the conversation visual embedding vector and the conversation audio embedding vector to obtain the knowledge-enhanced conversation feature vector of each multimodal conversation data.

[0079] Second, through the personalized preference-aware dialogue context GCN network, the context in multi-round question and answer information and the situational relationship between dialogue users are considered to make full use of information from multiple modalities.

[0080] Third, a two-layer supervised contrastive learning strategy of sentiment layer and multimodal layer is proposed, which makes full use of the consistent relationship between different modal data in the multimodal layer and the consistent relationship between modality and emotion labels in the low-dimensional VAD sentiment space.

[0081] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0082] Embodiment 1:

[0083] like Figure 1 As shown, an embodiment of the present invention provides a method for identifying emotions in user conversations in a knowledge-enhanced product question-and-answer community, based on a preset model, including:

[0084] S1. Obtaining historical multi-round question-and-answer information of multiple product question-and-answer communities; wherein each of the historical multi-round question-and-answer information includes a user's multimodal conversation data and its emotion label, and each of the multimodal conversation data includes text, visual, and audio modality information;

[0085] S2. For the current historical multi-round question-and-answer information, obtain a conversation text embedding vector, a conversation visual embedding vector, and a conversation audio embedding vector corresponding to each piece of the multimodal conversation data;

[0086] S3. For any piece of the multimodal dialogue data, calculate the similarity between each original word of its text modal information and the keywords in the pre-built user personalized sentiment dictionary, concatenate the embedding representation of each original word with the preference knowledge embedding vector corresponding to the keyword with the highest similarity, and multiply the concatenation result with the corresponding highest similarity as a weight to obtain a knowledge-enhanced dialogue text embedding vector;

[0087] S4, taking the knowledge-enhanced dialogue text embedding vector as the main modality, and fusing it with the dialogue visual embedding vector and the dialogue audio embedding vector using a cross-modal Transformer to obtain a knowledge-enhanced dialogue feature vector for each of the multimodal dialogue data;

[0088] S5. Based on the conversation feature vector, an LSTM network is used to model the contextual emotional dependency relationship of each user in the multimodal conversation data to obtain a contextual situation vector of personalized preference knowledge perception; and based on the contextual situation vector, a global conversation graph is constructed, and a GCN network is used to model the emotional dependency relationship between users in each multimodal conversation data to obtain a global situation vector storing a global context state;

[0089] S6. Obtaining the emotion recognition prediction result of each piece of the multimodal conversation data through a collaborative attention mechanism according to the interaction between the conversation feature vector and the global context vector;

[0090] S7, constructing a contrastive learning loss based on a double-layer supervised contrastive learning strategy of an emotional layer and a multimodal layer according to the conversation text embedding vector, the conversation visual embedding vector, and the conversation audio embedding vector corresponding to each piece of the multimodal conversation data; constructing a cross entropy loss according to the emotion label and emotion recognition prediction result of each piece of the multimodal conversation data; minimizing the joint loss function of the contrastive learning loss and the cross entropy loss, and training the model until convergence;

[0091] S8. Use the multi-round question-and-answer information to be recognized as the input of the converged model to obtain the emotion recognition result of each multimodal dialogue data in the multi-round question-and-answer information.

[0092] In the embodiment of the present invention, a user personalized sentiment dictionary is constructed through user keyword extraction and dictionary expansion algorithm to obtain a preference knowledge embedding vector; a dialogue text embedding vector, a dialogue visual embedding vector and a dialogue audio embedding vector enhanced with sentiment knowledge are integrated through a preference knowledge enhanced cross-modal Transformer to obtain a knowledge enhanced dialogue feature vector; based on a personalized preference-aware dialogue context GCN network, the context in multi-round question and answer information and the contextual relationship between dialogue users are considered to obtain a personalized preference-aware global context vector; and personalized emotion recognition is performed by considering the interaction between the global context vector and the knowledge enhanced dialogue feature vector.

[0093] In addition, a two-layer supervised contrastive learning strategy based on the sentiment layer and the multimodal layer is proposed to enable the model to learn more discriminative multimodal feature representations, further improving the accuracy and granularity of emotion recognition.

[0094] Figure 2 A flowchart of the method for emotion recognition in user conversations in a knowledge-enhanced product question-and-answer community is given. The basic processing flow includes information acquisition, multimodal feature representation, cross-modal fusion with personalized preference knowledge enhancement, conversation scenario modeling with personalized preference knowledge enhancement, emotion recognition prediction, and construction of a user personalized sentiment dictionary. The input is multimodal conversation data, and the output is personalized emotion recognition results.

[0095] Next, we will combine Figure 2 The following are the steps of the above solution:

[0096] In step S1, historical multi-round question-and-answer information of multiple product question-and-answer communities is obtained; each of the historical multi-round question-and-answer information includes the user's multimodal conversation data and its emotion label, and each of the multimodal conversation data includes text, visual and audio modality information.

[0097] Specifically, any historical multi-round question-answering information obtained is represented as Where |D| is the number of multimodal dialogue data, m = {t, v, a} is the text, visual and audio modality information in the question and answer, is the i-th multimodal dialogue data, sp i is the conversation user of the i-th multimodal conversation data, and sp i ∈{S q , S a},S q and Sa Represents the questioner and the answerer respectively.

[0098] In step S2, for the current historical multi-round question-and-answer information, a conversation text embedding vector, a conversation visual embedding vector, and a conversation audio embedding vector corresponding to each piece of the multimodal conversation data are obtained.

[0099] Exemplary:

[0100] (1) For text modal information, the pre-trained BERT model is used to obtain text feature representation. Input to the BERT model and obtain the conversation text embedding vector through encoding Where R represents is a set of n×dim dimensions.

[0101] Among them, [cls] and [sep] represent the start and end tags of the sentence respectively, n is the length of the text, and dim represents the dimension of the feature vector.

[0102] (2) For visual modality information, in order to effectively utilize the dynamic information in the video, 3D-CNN (3D convolutional neural networks) is used to extract visual features from the video. The 3D filter size is set to 5×5×5, and the dialogue visual embedding vector corresponding to the i-th multimodal dialogue data is obtained.

[0103] (3) For audio modal information, the open source speech processing toolkit openSMILE is used to extract audio features. The configuration file uses IS13ComParE to extract fundamental frequency, pitch, Mel frequency cepstral coefficients (MFSDs), Mel frequency spectrum energy (MFBs) and other features at a frame rate of 30 Hz and a sliding window of 100 ms. These acoustic features cover different types such as sound quality, rhythm, spectrum and are related to intonation and emotion. The conversation audio embedding vector corresponding to the i-th multimodal conversation data is obtained.

[0104] In step S3, for any piece of the multimodal conversation data, the similarity between each original word of its text modal information and the keywords in the pre-built user personalized sentiment dictionary is calculated, the embedding representation of each original word is concatenated with the preference knowledge embedding vector corresponding to the keyword with the highest similarity, and the corresponding highest similarity is multiplied with the concatenation result as a weight to obtain a knowledge-enhanced conversation text embedding vector.

[0105] In order to solve the problem that existing emotion recognition methods ignore the personalized preferences of different users for emotional vocabulary, a personalized emotional dictionary is first constructed for each user. The discrete model of traditional emotion quantification believes that the emotional space is composed of discrete and limited basic emotions, ignoring the correlation information between emotions. Therefore, the NRC-VAD Chinese version of the emotional dictionary based on the VAD psychological emotion model is introduced as the basic dictionary. It uses the values ​​of valence (emotional polarity), arousal (calmness or excitement) and dominance (perceived control) in three dimensions to define the emotional state of the vocabulary. The distance between pairs of words can be calculated in the continuous emotional space, thereby capturing the potential relationship between the various emotions implied by each word.

[0106] In addition, in order to accurately capture the preferences of individual users in questions and answers, an embodiment of the present invention uses the TF-IDF method to analyze the distribution of keywords in the user's historical question and answer data. By calculating the TF-IDF value of each word, it is possible to quantify the frequency with which users use specific words in their personal historical data and evaluate the distinctiveness of these words in the entire user group. Words with higher TF-IDF values ​​indicate that they not only appear frequently in the historical questions and answers of a single user, but also have a lower prevalence in the overall question and answer dataset, thus revealing the user's significant preference for these words when publishing content.

[0107] like Figure 2 As shown, the construction of the user personalized sentiment dictionary is as follows:

[0108] (1) Constructing an expanded domain sentiment dictionary

[0109] Words in the text modality contain semantic emotional information, and existing word-level text feature extraction methods are difficult to learn implicit emotional state information. Therefore, introducing an external emotional dictionary into the model as a priori knowledge can supplement emotional information for words. In order to obtain the emotional state information corresponding to the word-level text feature representation in question and answer, an embodiment of the present invention designs a domain emotional dictionary expansion method, and the specific steps are as follows:

[0110] Step 1: Select the manually annotated sentiment dictionary NRC-VAD Chinese version as the basic sentiment dictionary, expressed as The dictionary contains VAD scores for 20,000 words; i , A i , D i ) is the word w i The features of represent the corresponding VAD emotional state vector, which represents the scores of activation, pleasure, and dominance in three dimensions as V i , A i , D i, and the value range of the three is between 0 and 1.

[0111] Note that the vocabulary in L0 comes from commonly used sentiment lexicons and Twitter corpus.

[0112] Step 2: Crawl historical Q&A information of users in the current product Q&A community, build a Q&A corpus in the target domain, remove stop words to obtain a domain dictionary W, and use the dictionary to train a Word2Vec model to map each word in W to a high-dimensional vector containing the semantic information of the word, and use cosine similarity to measure the semantic similarity between any two words.

[0113] Step 3: For words in W, either they belong to the dictionary L0 or they do not belong to the basic sentiment dictionary L0. Through the semantic similarity between any two words, there are several similar words. If there is a similar word belonging to the dictionary L0, then the word is regarded as a potential sentiment word and added to the potential sentiment word set P;

[0114] Step 4: For each emotion word in the set P, define algorithm f to map its feature representation into a VAD emotion state vector; if the three dimensions of the VAD emotion state vector are all greater than 0, then add the emotion word and the corresponding VAD emotion state vector to the dictionary L0, and record the expanded domain emotion dictionary as L new .

[0115] (2) Building a user-personalized sentiment dictionary

[0116] Collecting historical question and answer information of users in the multimodal conversation data and treating it as a document, and performing word segmentation processing after removing stop words in the document;

[0117] The TF-IDF method is used to extract all keywords in the preprocessed document, including TF and IDF. TF stands for word frequency, that is, the frequency value of a word appearing in a document. IDF stands for inverse document frequency, which is used to measure the general importance of a word. The TF-IDF value of the word is obtained by multiplying the TF and IDF parts. The higher the value, the higher the importance of the word in the document. The calculation process is shown in formula (1):

[0118]

[0119] in, represents the frequency of word i in the historical questions and answers of user spi, |U| represents the number of historical questions and answers in the user's historical question and answer information set, which is equivalent to the number of users; ∑ k k,sp i Indicates user sp i The number of all words in the history quiz, is the number of users whose historical question and answer information contains word t.

[0120] The keywords extracted by the TF-IDF method reflect the user's personalized vocabulary preferences. In order to extract the user's keywords, a threshold is set and the words with TF-IDF values ​​higher than the threshold are regarded as the user's keywords.

[0121] Then determine if the keyword is in the expanded domain sentiment dictionary L new Then find the VAD emotional state vector corresponding to the keyword; if the keyword is not in the expanded domain emotional dictionary L new In , a zero vector is used instead;

[0122] For the multimodal dialogue data in the training phase, if a keyword in the user's historical information appears in the dialogue text of the questioner or the answerer, the TF-IDF value of the keyword is used as a weight and multiplied by the VAD emotional state vector to obtain a user personalized emotional knowledge embedding vector representing the user's preference knowledge.

[0123] Finally, each keyword and the corresponding preference knowledge embedding vector are summarized to construct the user personalized sentiment dictionary.

[0124] In order to integrate the user's personalized preference information into the multimodal feature representation, the user's personalized sentiment dictionary is used to obtain the preference knowledge embedding vector corresponding to each original word in the text modal information.

[0125] For any of the multimodal dialogue data, Figure 3 As shown, this step specifically calculates each original word w in the text modal information i The keyword l in the constructed user personalized sentiment dictionary i The cosine similarity sim(w i , l i ); for the original word w in the text modal information i , select the dictionary with w i Similarity sim(w i , l i )Highest keyword i , the keyword l i The corresponding personalized sentiment preference knowledge embedding vector and the original word w i After the word embedding is concatenated, w i With l i The similarity is used as a weight to multiply the concatenated vector to obtain the knowledge-enhanced text embedded representation.

[0126] In step S4, the knowledge-enhanced dialogue text embedding vector is used as the main modality, and a cross-modal Transformer is used to fuse it with the dialogue visual embedding vector and the dialogue audio embedding vector to obtain a knowledge-enhanced dialogue feature vector of each multimodal dialogue data;

[0127] As a basic tool for human communication, language plays a vital role in the field of emotion perception. It can not only directly transmit information, but also implicitly express emotions and attitudes. In the study of emotion analysis, the introduction of metadata about the emotional state of words in the VAD (Valence-Arousal-Dominance) sentiment dictionary can significantly enhance the richness and accuracy of emotional information in text data. Therefore, the embodiment of the present invention regards text as the dominant modality, and guides other modal data (such as audio, video, etc.) to be deeply integrated with text through its rich semantic and emotional content.

[0128] Specifically, this step uses the knowledge-enhanced conversation text embedding vector as the query vector to perform cross-modal attention interaction with the conversation visual embedding vector and the conversation audio embedding vector, learns the audio and visual features of preference knowledge perception, and filters out noise information irrelevant to emotions in non-language modalities; the multimodal features are jointly input into the cross-modal Transformer layer to obtain a multimodal feature representation enhanced with preference knowledge.

[0129] The fusion process is Figure 3 The steps are as follows:

[0130] Step 1: First, due to the different sampling rates of data in different modes, the sequence lengths of different modes will be different. In order to perform subsequent calculations, the multimodal data must be aligned first. Specifically, the Connectionist Temporal Classification (CTC) model is used to adjust the sequence lengths of the knowledge-enhanced dialogue text embedding vector, dialogue visual embedding vector, and dialogue audio embedding vector to meet a unified standard; the CTC model, as a sequence-to-sequence mapping method, can effectively process sequence data of different lengths and provides an effective solution for multimodal data alignment. A linear network is then used to unify the vector dimensions of data in different modalities. The specific calculation is shown in formula (2):

[0131]

[0132] Among them, T i , V i , A i ∈R L×d , T iis the standardized preference knowledge-aware text feature representation corresponding to the i-th multimodal dialogue data, V i , A i is the standardized visual and audio feature vector corresponding to the i-th multimodal dialogue data, L is the sequence length, d represents the feature dimension; MLP is a multi-layer perceptron.

[0133] The knowledge-enhanced conversation text embedding vector is obtained by concatenating the user personalized emotion knowledge embedding vector with the corresponding conversation text embedding vector. Through this transformation, text, visual and audio features can be mapped into a common high-dimensional space.

[0134] Step 2: Calculate the similarity matrix between the normalized text and audio, and between the text and visual information through the normalized vector dot product operation, and use the similarity matrix as the weight matrix after activation by the Softmax function, and multiply it with the embedding vector of the corresponding non-text modality to obtain the weighted dialogue visual embedding vector and dialogue audio embedding vector respectively; reduce the difference between the non-language modality and the text modality. The specific process is shown in formulas (3) to (6):

[0135]

[0136] in, represents the similarity matrix, and is the weighted visual and audio feature representation.

[0137] Step 3: Use a cross-modal Transformer layer to fuse the knowledge-enhanced conversation text embedding vector, the weighted conversation visual embedding vector, and the conversation audio embedding vector to obtain a knowledge-enhanced conversation feature vector.

[0138] The core of the cross-modal Transformer is the cross-modal attention mechanism. We use the text feature T i As the query vector, As the key vector, The value vector is input into the cross-modal attention. The specific process is shown in formula (7):

[0139]

[0140] Among them, Q, K, and V are the inputs of the three modalities after linear mapping, and dim is the feature dimension. The vector F obtained by the attention layer after multimodal interaction f The final dialogue feature vector is generated after being processed by the residual connection and normalization layer, the feedforward layer, the residual connection and normalization layer. The specific process is shown in formulas (8) to (9):

[0141]

[0142] Among them, f θ represents the feedforward network, Norm represents normalization, F i is the final output of the cross-modal Transformer, that is, the knowledge-enhanced dialogue feature vector corresponding to the i-th multimodal dialogue data.

[0143] It can be seen that the embodiment of the present invention takes into account the user's personal emotion preference information, can more accurately identify the user's emotions, and provides an effective solution for personalized emotion recognition.

[0144] In step S5, based on the conversation feature vector, an LSTM network is used to model the contextual emotional dependency of users in each of the multimodal conversation data to obtain a context situation vector of personalized preference knowledge perception; and based on the context situation vector, a global conversation graph is constructed, and a GCN network is used to model the emotional dependency between users in each of the multimodal conversation data to obtain a global situation vector that stores the global context state.

[0145] In order to model the impact of the user's historical speech emotional state on the current speech emotion, the LSTM network is used to capture the user's emotional state. The gating mechanism (including the forget gate and the input gate) is used to determine which information should be retained and which should be forgotten, so as to capture the long-distance dependencies in the time series data. In the LSTM module of each user P, the input is the conversation feature vector The output is taking into account the corpus Contextual Situation Vector for Personalized Preference Knowledge Awareness

[0146] Next, we construct a global conversation graph, where the nodes are the output of LSTM. Initialize the assignment, the node set can be represented as shown Where P∈{S q , S a},N d is the total number of sentences in the dialogue d. The nodes are connected strictly in the chronological order of the dialogue. By using GCN to update the graph nodes, the emotional dependency relationship between users in each multimodal dialogue data is modeled to obtain a global context vector storing the global context state, expressed as

[0147] In step S6, based on the interaction between the dialogue feature vector and the global context vector, the emotion recognition prediction result of each piece of the multimodal dialogue data is obtained through a collaborative attention mechanism.

[0148] When classifying the emotion of the i-th multimodal conversation data, its knowledge-enhanced conversation feature vector can be interacted with M based on the attention mechanism, thereby supplementing the single conversation data with rich context information. The specific calculation is shown in formulas (10) to (12):

[0149] att=softmax((M) T u i ) (10)

[0150]

[0151] Among them, att is the learned attention weight vector, which is calculated by weighted summing each multimodal dialogue data in the memory bank using att It contains both the summary of the contextual emotional state and the information of the conversation data itself, and finally uses the weighted memory vector For the i-th multimodal dialogue data The feature representation is updated.

[0152] Then the updated speech vector It is transformed into emotion classification probability distribution through linear transformation and softmax function, as shown in formula (13):

[0153]

[0154] Among them, the output vector y ij is the probability value of the i-th multimodal dialogue data being identified as the j-th emotion, and its dimension is equal to the number of emotion categories, W oj , b j The weight parameters and bias terms in the linear transformation layer corresponding to the j-th emotion.

[0155] In step S7, according to the conversation text embedding vector, conversation visual embedding vector and conversation audio embedding vector corresponding to each piece of the multimodal conversation data, a contrastive learning loss is constructed based on a double-layer supervised contrastive learning strategy of the emotion layer and the multimodal layer; according to the emotion label and emotion recognition prediction result of each piece of the multimodal conversation data, a cross entropy loss is constructed; the joint loss function of the contrastive learning loss and the cross entropy loss is minimized, and the model is trained until convergence.

[0156] In the related art, the multimodal emotion recognition method does not take into account the semantic similarity relationship between emotions. For example, "happy" is more similar to "excited", but has a greater semantic difference with "sad". Especially when the distribution of samples of different emotion categories is uneven, it is difficult to distinguish emotions with similar semantics. The embodiment of the present invention proposes a two-layer supervised contrastive learning strategy on the emotional layer and the multimodal layer, which makes full use of the consistency relationship between multimodal data and emotion labels in a single sample instance, as well as the consistency relationship between multimodal data of different sample instances, and constructs a contrastive learning loss function, so that even in the case of unbalanced samples, more discriminative multimodal feature representations can be learned, which is conducive to distinguishing semantically similar emotions and improving the computational efficiency of contrastive learning. The details are as follows:

[0157] (1) Obtaining contrastive learning loss based on sentiment layer

[0158] When dealing with emotion labels, traditional supervised contrastive learning methods usually simply treat samples with different emotion labels as negative examples. This method ignores the quantitative semantic similarity between emotion labels, and emotions are continuous rather than discrete in the semantic space. Due to the complexity and diversity of emotions, simply defining positive and negative examples based on the similarities and differences in emotion labels is not enough to capture the subtle differences between emotions. This method may cause the model to have difficulties in distinguishing semantically similar emotions, thus affecting the accuracy and robustness of emotion recognition.

[0159] In order to solve the above problem, the dialogue text embedding vector, dialogue visual embedding vector and dialogue audio embedding vector are first mapped to the three-dimensional VAD (Valence-Arousal-Dominance) space. The specific process is shown in formula (14):

[0160] Map the conversation text embedding vector, conversation visual embedding vector, and conversation audio embedding vector into the three-dimensional VAD emotion space:

[0161]

[0162] Among them, the modality m∈{T,V,A}, T,V,A are the text, visual and audio modality information in the multimodal conversation data respectively; is the corresponding multimodal embedding vector, is the feature representation mapped to the VAD emotion space, i is the index of the multimodal dialogue data; W is the weight parameter; and b is the bias term.

[0163] Then, manually labeled e is introduced for each emotion in the VAD emotion space. c ∈R 3 ; where c∈E represents the emotion category, E represents the set of emotion label categories, and e cRepresents the VAD vector corresponding to the true emotion label;

[0164] Since the feature representation vector of each modality in the VAD emotional space should be close to the VAD vector corresponding to its true emotional label and far from the VAD vectors of other emotional labels, each multimodal conversation data is taken as a sample, and the feature representation of the three modal information in each sample mapped to the VAD emotional space and the VAD vector corresponding to its true emotional label are regarded as positive sample pairs, and the VAD vectors of other types of emotions are regarded as negative sample pairs, and the first contrastive learning loss is constructed, as shown in formula (15):

[0165]

[0166] Where |E| is the number of emotion categories; due to the different qualities and importance of different modalities, the hyperparameter λ m It is used to adjust the weight of the loss function for comparing the consistency between each modality information and the label; log is the logarithmic function; Represents the true emotion label y of the i-th multimodal dialogue data i The corresponding VAD vector; represents the dot product operation, which is used to calculate the similarity between vectors; τ is a learnable hyperparameter.

[0167] (2) The process of obtaining contrastive learning loss based on the multimodal layer; including:

[0168] The similarity between the multimodal feature representations of sample instances belonging to different emotion categories should be lower, and the similarity between the multimodal data corresponding to samples of the same emotion should be higher. Therefore, the multimodal embedding vectors of samples with the same emotion are regarded as positive sample pairs, and the multimodal embedding vectors of samples of different emotion categories are regarded as negative sample pairs. The second contrastive learning loss is constructed, as shown in formula (16):

[0169]

[0170] Among them, m1 and m2 are two arbitrary modes; λ m1,m2 is the weight hyperparameter for contrastive learning between different modalities; Nd is the number of samples of previous multi-round question-answering information; The label is y in the current multi-round question-answer information i The number of samples; j and k are the indexes of the multimodal conversation data used as samples.

[0171] From this, the total loss function of the two-layer supervised contrastive learning strategy based on the sentiment layer and the multimodal layer can be determined: As shown in formula (17):

[0172]

[0173] In addition, this step also constructs the cross entropy loss based on the real emotion label The weighted summation is performed with the contrastive learning loss shown in formula (14) to construct a joint loss function As shown in formulas (18) to (19):

[0174]

[0175] The model is trained until convergence by minimizing the joint loss function of the contrastive learning loss and the cross entropy loss.

[0176] In step S8, the multi-round question-and-answer information to be recognized is used as the input of the converged model to obtain the emotion recognition result of each multimodal dialogue data in the multi-round question-and-answer information.

[0177] So far, the embodiment of the present invention has completed the personalized emotion recognition of the user based on the historical multi-round question and answer information of the product question and answer community.

[0178] In order to demonstrate the superiority of the embodiments of the present invention, the following examples are provided:

[0179] This example includes the process from data acquisition to model training and testing, and provides a method for conversation emotion recognition in a product question-and-answer community based on sentiment preference perception. It can effectively improve the performance of emotion recognition for comment users, help companies better understand users' attitudes toward products, and thus improve their products and services.

[0180] (1) The Python web crawler technology is used to crawl product-related question and answer corpus on the product question and answer community. The main crawled content includes the text, video and audio content in the questions and answers, as well as the user IDs of the questioner and the answerer, to form a multimodal question and answer dataset, in which the audio data is extracted from the video file.

[0181] (2) In the multimodal feature extraction layer, the question-answer text, video, and audio data are encoded using pre-trained feature extractors to obtain the corresponding text, video, and audio feature representations.

[0182] (3) Fusion the different modal information extracted in step (2).

[0183] ① Crawl user-generated content (question and answer and comment text) related to the field to build a field corpus, expand the basic sentiment dictionary through the field corpus, and obtain the sentiment dictionary of the current question and answer field. Crawl the user's historical answer information, use the TF-IDF method to extract each user's keywords, use the TF-IDF value as a weight and multiply it with the VAD vector as the user's personalized emotional preference knowledge, and build a user's personalized sentiment dictionary.

[0184] ② For any of the multimodal dialogue data, calculate the similarity between each word in the text modal information and the words in the constructed user personalized sentiment dictionary; for the original word w in the text modal information, select the keyword l with the highest similarity to w in the user personalized sentiment dictionary, concatenate the preference knowledge embedding vector corresponding to the keyword, and concatenate the word embedding of the original word w, and use the similarity between w and, as the weight to multiply the concatenated vector, to obtain the knowledge-enhanced dialogue text embedding vector.

[0185] (4) The information of different modalities obtained in step (2) is used to construct a contrast loss function based on the double-layer supervised contrast learning strategy of the sentiment layer and the multi-modal layer.

[0186] (5) The multimodal fusion features of each speech segment of the same user in the question-answering dialogue are input into the long short-term memory network LSTM. The LSTM network is used to model the emotional influence relationship between contexts and capture the dynamic changes of emotional states over time.

[0187] (6) Integrate the conversation information between the questioner and the answerer, construct a conversation graph according to the time sequence of the conversation, and use the GCN network to update the graph nodes, so as to model the persistent emotional influence between speakers in the global conversation. The emotional state vectors obtained at each time step are concatenated to obtain a global conversation context vector.

[0188] (7) In the prediction module, the multimodal feature representation of the sentence to be predicted is input into the classifier after attention interaction with the global dialogue context vector to obtain the prediction result of the emotion category.

[0189] (8) Construct a cross entropy loss function based on the true emotion label, perform weighted summation with the double-layer contrastive learning loss obtained in step (4), construct a total loss function, and train the model until convergence.

[0190] (9) The performance of the model is evaluated on the test set using four classification indicators, namely accuracy, weighted average F1 value, weighted average recall rate and weighted average precision rate. The model parameters are tuned according to these indicator values, and the tuned model is trained and adjusted continuously until the performance of the model reaches the optimal level.

[0191] Embodiment 2:

[0192] The embodiment of the present invention provides a knowledge-enhanced product question-and-answer community user dialogue emotion recognition system, based on a preset model, including:

[0193] An information acquisition module, used to acquire historical multi-round question-and-answer information of multiple product question-and-answer communities; each of the historical multi-round question-and-answer information includes a user's multimodal conversation data and its emotion label, and each of the multimodal conversation data includes text, visual and audio modality information;

[0194] A feature representation module is used to obtain a conversation text embedding vector, a conversation visual embedding vector, and a conversation audio embedding vector corresponding to each piece of the multimodal conversation data for the current historical multi-round question and answer information;

[0195] A preference knowledge embedding module is used to calculate the similarity between each original word of the text modal information and the keywords in the pre-built user personalized sentiment dictionary for any of the multimodal dialogue data, concatenate the embedding representation of each original word with the preference knowledge embedding vector corresponding to the keyword with the highest similarity, and multiply the concatenation result with the corresponding highest similarity as a weight to obtain a knowledge-enhanced dialogue text embedding vector;

[0196] A cross-modal fusion module, used to use the knowledge-enhanced conversation text embedding vector as the main modality, and fuse it with the conversation visual embedding vector and the conversation audio embedding vector using a cross-modal Transformer to obtain a knowledge-enhanced conversation feature vector for each of the multi-modal conversation data;

[0197] A dialogue scenario modeling module is used to model the context emotion dependency relationship of each user in the multimodal dialogue data using an LSTM network according to the dialogue feature vector to obtain a context scenario vector of personalized preference knowledge perception; and to construct a global dialogue graph according to the context scenario vector, and to model the emotion dependency relationship between users in each multimodal dialogue data using a GCN network to obtain a global scenario vector storing a global context state;

[0198] An emotion prediction module, which obtains an emotion recognition prediction result of each piece of the multimodal dialogue data through a collaborative attention mechanism according to the interaction between the dialogue feature vector and the global context vector;

[0199] A model training module is used to construct a contrastive learning loss based on a double-layer supervised contrastive learning strategy of an emotional layer and a multimodal layer according to a conversation text embedding vector, a conversation visual embedding vector, and a conversation audio embedding vector corresponding to each piece of the multimodal conversation data; construct a cross entropy loss according to an emotion label and an emotion recognition prediction result of each piece of the multimodal conversation data; minimize a joint loss function of the contrastive learning loss and the cross entropy loss, and train the model until convergence;

[0200] The emotion recognition module is used to use the multi-round question and answer information to be recognized as the input of the converged model to obtain the emotion recognition result of each multimodal dialogue data in the multi-round question and answer information.

[0201] In an optional embodiment, the knowledge-enhanced product question-and-answer community user dialogue emotion recognition system further includes a dictionary construction module for constructing the user personalized emotion dictionary. The construction process includes two steps:

[0202] The manually annotated sentiment dictionary NRC-VAD Chinese version is selected as the basic sentiment dictionary, expressed as Where (V i , A i , D i ) is the word w i The features of represent the corresponding VAD emotional state vector, which represents the scores of activation, pleasure, and dominance in three dimensions as V i , A i , D i , and the value range of the three is between 0 and 1;

[0203] Crawl the historical Q&A information of all users in the current product Q&A community, build a Q&A corpus in the target domain, remove stop words to get a domain dictionary W, and use the dictionary to train a Word2Vec model to map each word in W to a high-dimensional vector containing the semantic information of the word, and use cosine similarity to measure the semantic similarity between any two words;

[0204] For words in W, either they belong to the dictionary L0 or they do not belong to the basic sentiment dictionary L0. Through the semantic similarity between any two words, there are several similar words. If there is a similar word belonging to the dictionary L0, then the word is regarded as a potential sentiment word and added to the potential sentiment word set P;

[0205] For each emotional word in the set P, define algorithm f to map its feature representation into a VAD emotional state vector; if the three dimensions of the VAD emotional state vector are all greater than 0, then add the emotional word and the corresponding VAD emotional state vector to the dictionary L0, and record the expanded domain emotional dictionary as L new ;

[0206] Collect the historical question and answer information of the current user and treat it as a document. Remove the stop words in the document and then perform word segmentation.

[0207] The TF-IDF method is used to extract all keywords from the preprocessed documents;

[0208] If the keyword is in the expanded domain sentiment dictionary L newThen find the VAD emotional state vector corresponding to the keyword; if the keyword is not in the expanded domain emotional dictionary L new In , a zero vector is used instead;

[0209] The TF-IDF value of the keyword is used as a weight to multiply the VAD emotional state vector or the zero vector to obtain the corresponding preference knowledge embedding vector;

[0210] Each keyword and the corresponding preference knowledge embedding vector are summarized to construct the user personalized sentiment dictionary.

[0211] Embodiment 3:

[0212] An embodiment of the present invention provides a storage medium storing a computer program for identifying emotions in user conversations in a product question and answer community for knowledge enhancement, wherein the computer program enables a computer to execute the method for identifying emotions in user conversations in a product question and answer community as described in Example 1.

[0213] Embodiment 4:

[0214] An embodiment of the present invention provides an electronic device, including:

[0215] One or more processors; 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 the one or more processors, and the programs include a method for executing the product question and answer community user conversation emotion recognition method as described in Example 1.

[0216] It can be understood that the knowledge-enhanced product Q&A community user conversation emotion recognition system, storage medium and electronic device provided in the embodiments of the present invention correspond to the knowledge-enhanced product Q&A community user conversation emotion recognition method provided in the embodiments of the present invention, and the explanations, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the product Q&A community user conversation emotion recognition method, which will not be repeated here.

[0217] In summary, compared with the prior art, the present invention has the following beneficial effects:

[0218] 1. The embodiment of the present invention comprehensively considers the influence relationship between the contexts in multiple rounds of question and answer information and the emotional state between the dialogue users, and makes full use of the multimodal dialogue data on the product question and answer platform to improve the emotion recognition effect, help the platform and enterprises understand the emotional state of users, and thus improve user satisfaction.

[0219] 2. The embodiment of the present invention builds a user personalized sentiment dictionary based on the question-and-answer corpus and the user's historical question-and-answer information to supplement the implicit sentiment information in the text. By calculating the similarity between the original words in the text modal information and the keywords in the user's personalized sentiment dictionary, the embedding representation of each original word is spliced ​​with the preference knowledge embedding vector corresponding to the keyword with the highest similarity, and the corresponding highest similarity is multiplied with the splicing result as a weight to obtain the knowledge-enhanced dialogue text embedding vector, and it is used as the main modality to filter out the noise information that is not related to the emotion in the non-text modality, and then the information interaction between multiple modalities is learned based on the cross-modal Transformer. This module can reduce unnecessary information interference and realize the deep fusion of multimodal data, thereby obtaining a higher quality fusion feature representation.

[0220] 3. The embodiment of the present invention proposes a double-layer supervised contrastive learning strategy in the sentiment layer and the multimodal layer, which introduces label-related emotional knowledge from the outside, and makes full use of the similarity between sample modal data of the same type and the difference between sample modalities of different types, as well as the similarity between modalities and their corresponding labels and the difference between modalities and other labels. In this way, the model can capture the subtle differences between different emotional states, thereby effectively distinguishing semantically similar emotional categories. This contrastive learning strategy enables the model to learn more discriminative feature representations, improving the accuracy and granularity of emotion recognition.

[0221] 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. Moreover, the terms "include", "comprise" 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 sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0222] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A knowledge-enhanced method for identifying user emotions in product Q&A communities. It is characterized in that Based on preset models, including: Acquire historical multi-round question-and-answer information of multiple product question-and-answer communities; each of the historical multi-round question-and-answer information includes multimodal conversation data of users and their emotion labels, and each piece of multimodal conversation data includes text, visual and audio modality information; For the current historical multi-round question-and-answer information, obtain a conversation text embedding vector, a conversation visual embedding vector, and a conversation audio embedding vector corresponding to each piece of the multimodal conversation data; For any of the multimodal dialogue data, the similarity between each original word of its text modal information and the keywords in the pre-built user personalized sentiment dictionary is calculated, the embedding representation of each original word is concatenated with the preference knowledge embedding vector corresponding to the keyword with the highest similarity, and the corresponding highest similarity is used as a weight to multiply the concatenation result to obtain a knowledge-enhanced dialogue text embedding vector; Taking the knowledge-enhanced conversation text embedding vector as the main modality, and fusing it with the conversation visual embedding vector and the conversation audio embedding vector using a cross-modal Transformer to obtain a knowledge-enhanced conversation feature vector for each of the multimodal conversation data; Based on the conversation feature vector, an LSTM network is used to model the contextual emotional dependency relationship of each user in the multimodal conversation data to obtain a contextual situation vector of personalized preference knowledge perception; and based on the contextual situation vector, a global conversation graph is constructed, and a GCN network is used to model the emotional dependency relationship between users in each multimodal conversation data to obtain a global situation vector storing a global context state; According to the interaction between the dialogue feature vector and the global context vector, an emotion recognition prediction result of each piece of the multimodal dialogue data is obtained through a collaborative attention mechanism; According to the conversation text embedding vector, conversation visual embedding vector and conversation audio embedding vector corresponding to each piece of the multimodal conversation data, a contrastive learning loss is constructed based on a double-layer supervised contrastive learning strategy of an emotional layer and a multimodal layer; according to the emotion label and emotion recognition prediction result of each piece of the multimodal conversation data, a cross entropy loss is constructed; and a joint loss function of the contrastive learning loss and the cross entropy loss is minimized to train the model until convergence; The multi-round question-and-answer information to be recognized is used as the input of the converged model to obtain the emotion recognition result of each multimodal dialogue data in the multi-round question-and-answer information.

2. The method for identifying emotions in user conversations in a product question-and-answer community according to claim 1, It is characterized in that The process of obtaining contrastive learning loss based on sentiment layer; include Map the conversation text embedding vector, conversation visual embedding vector, and conversation audio embedding vector into the three-dimensional VAD emotion space: Among them, the modality m∈{T,V,A}, T,V,A are the text, visual and audio modality information in the multimodal conversation data respectively; is the corresponding multimodal embedding vector, is the feature representation mapped to the VAD emotion space, i is the index of the multimodal dialogue data; R is the set; W is the weight parameter; b is the bias term; Introducing manually labeled e for each emotion in the VAD emotion space c ∈R 3 ; where c∈E represents the emotion category, E represents the set of emotion label categories, and e c Represents the VAD vector corresponding to the true emotion label; Each piece of the multimodal conversation data is taken as a sample, and the feature representation of the three modal information in each sample is mapped to the VAD emotional space. The VAD vector corresponding to its true emotion label is regarded as a positive sample pair, and the VAD vector of other types of emotions is regarded as a negative sample pair, and the first contrastive learning loss is constructed: Where |E| is the number of emotion categories; the hyperparameter λ m It is used to adjust the weight of the loss function for comparing the consistency between each modality information and the label; log is the logarithmic function; Represents the true emotion label y of the i-th multimodal dialogue data i The corresponding VAD vector; represents the dot product operation, which is used to calculate the similarity between vectors; τ is a learnable hyperparameter.

3. The method for identifying emotions in user conversations in a product question-and-answer community according to claim 2, It is characterized in that The process of obtaining a contrastive learning loss based on a multimodal layer; including: The multimodal embedding vectors of samples with the same type of emotions are regarded as positive sample pairs, and the multimodal embedding vectors of samples with different types of emotions are regarded as negative sample pairs, and the second contrastive learning loss is constructed: Among them, m1 and m2 are two arbitrary modes; λ m1,m2 is the weight hyperparameter for contrastive learning between different modalities; Nd is the number of samples of previous multi-round question-answering information; The label is y in the current multi-round question-answer information i The number of samples; j and k are the indexes of the multimodal conversation data used as samples.

4. The method for identifying emotions in user conversations in a product question-and-answer community according to claim 1, It is characterized in that The process of constructing the user personalized sentiment dictionary includes: The manually annotated sentiment dictionary NRC-VAD Chinese version is selected as the basic sentiment dictionary, expressed as Where (V i , A i , D i ) is the word w i The features of represent the corresponding VAD emotional state vector, which represents the scores of activation, pleasure, and dominance in three dimensions as V i , A i , D i , and the value range of the three is between 0 and 1; Crawl the historical Q&A information of all users in the current product Q&A community, build a Q&A corpus in the target domain, remove stop words to get a domain dictionary W, and use the dictionary to train a Word2Vec model to map each word in W to a high-dimensional vector containing the semantic information of the word, and use cosine similarity to measure the semantic similarity between any two words; For words in W, or belonging to dictionary L 0 , or does not belong to the basic sentiment dictionary L 0 , through the semantic similarity between any two words, there are several similar words belonging to the dictionary L 0 , then the word is taken as a potential emotion word and added to the potential emotion word set P; For each emotion word in the set P, define algorithm f to map its feature representation into a VAD emotion state vector; if the three dimensions of the VAD emotion state vector are all greater than 0, then add the emotion word and the corresponding VAD emotion state vector to the dictionary L 0 In the above example, the expanded domain sentiment dictionary is recorded as L new ; Collect the historical question and answer information of the current user and treat it as a document. Remove the stop words in the document and then perform word segmentation. The TF-IDF method is used to extract all keywords from the preprocessed documents; If the keyword is in the expanded domain sentiment dictionary L new Then find the VAD emotional state vector corresponding to the keyword; if the keyword is not in the expanded domain emotional dictionary L new In , a zero vector is used instead; The TF-IDF value of the keyword is used as a weight to multiply the VAD emotional state vector or the zero vector to obtain the corresponding preference knowledge embedding vector; Each keyword and the corresponding preference knowledge embedding vector are summarized to construct the user personalized sentiment dictionary.

5. The method for identifying emotions in user conversations in a product question-and-answer community according to claim 1, It is characterized in that Cosine similarity is used to calculate the similarity between each original word of the text modal information and the keywords in the pre-built user personalized sentiment dictionary.

6. The method for identifying emotions in user conversations in a product question-and-answer community according to claim 1, It is characterized in that The method uses the knowledge-enhanced dialogue text embedding vector as the main modality, and fuses it with the dialogue visual embedding vector and the dialogue audio embedding vector using a cross-modal Transformer to obtain the knowledge-enhanced dialogue feature vector of each multimodal dialogue data; including: Using a connection temporal classification model, adjusting the sequence lengths of the knowledge-enhanced conversation text embedding vector, the conversation visual embedding vector, and the conversation audio embedding vector to reach a unified standard; Taking the knowledge-enhanced dialogue text embedding vector as the main modality, the similarity matrix between the standardized text and audio, and between the text and visual information is calculated by a dot product operation of the normalized vector, and the similarity matrix is ​​activated by a Softmax function as a weight matrix, and multiplied with the embedding vector of the corresponding non-text modality to obtain a weighted dialogue visual embedding vector and a dialogue audio embedding vector, respectively; A cross-modal Transformer is used to fuse the knowledge-enhanced conversation text embedding vector, the weighted conversation visual embedding vector and the conversation audio embedding vector to obtain a knowledge-enhanced conversation feature vector for each of the multimodal conversation data.

7. A knowledge-enhanced product question-and-answer community user dialogue emotion recognition system, It is characterized in that Based on preset models, including: An information acquisition module, used to acquire historical multi-round question-and-answer information of multiple product question-and-answer communities; each of the historical multi-round question-and-answer information includes a user's multimodal conversation data and its emotion label, and each of the multimodal conversation data includes text, visual and audio modality information; A feature representation module is used to obtain a conversation text embedding vector, a conversation visual embedding vector, and a conversation audio embedding vector corresponding to each piece of the multimodal conversation data for the current historical multi-round question and answer information; A preference knowledge embedding module is used to calculate the similarity between each original word of the text modal information and the keywords in the pre-built user personalized sentiment dictionary for any of the multimodal dialogue data, concatenate the embedding representation of each original word with the preference knowledge embedding vector corresponding to the keyword with the highest similarity, and multiply the concatenation result with the corresponding highest similarity as a weight to obtain a knowledge-enhanced dialogue text embedding vector; A cross-modal fusion module, used to use the knowledge-enhanced conversation text embedding vector as the main modality, and fuse it with the conversation visual embedding vector and the conversation audio embedding vector using a cross-modal Transformer to obtain a knowledge-enhanced conversation feature vector for each of the multi-modal conversation data; A dialogue scenario modeling module is used to model the context emotion dependency relationship of each user in the multimodal dialogue data using an LSTM network according to the dialogue feature vector to obtain a context scenario vector of personalized preference knowledge perception; and to construct a global dialogue graph according to the context scenario vector, and to model the emotion dependency relationship between users in each multimodal dialogue data using a GCN network to obtain a global scenario vector storing a global context state; An emotion prediction module, which obtains an emotion recognition prediction result of each piece of the multimodal dialogue data through a collaborative attention mechanism according to the interaction between the dialogue feature vector and the global context vector; A model training module is used to construct a contrastive learning loss based on a double-layer supervised contrastive learning strategy of an emotional layer and a multimodal layer according to a conversation text embedding vector, a conversation visual embedding vector, and a conversation audio embedding vector corresponding to each piece of the multimodal conversation data; construct a cross entropy loss according to an emotion label and an emotion recognition prediction result of each piece of the multimodal conversation data; minimize a joint loss function of the contrastive learning loss and the cross entropy loss, and train the model until convergence; The emotion recognition module is used to use the multi-round question and answer information to be recognized as the input of the converged model to obtain the emotion recognition result of each multimodal dialogue data in the multi-round question and answer information.

8. A knowledge-enhanced product question-and-answer community user dialogue emotion recognition system, It is characterized in that It also includes a dictionary building module for building the user personalized sentiment dictionary, and the building process includes: The manually annotated sentiment dictionary NRC-VAD Chinese version is selected as the basic sentiment dictionary, expressed as Where (V i , A i , D i ) is the word w i The features of represent the corresponding VAD emotional state vector, which represents the scores of activation, pleasure, and dominance in three dimensions as V i , A i , D i , and the value range of the three is between 0 and 1; Crawl the historical Q&A information of all users in the current product Q&A community, build a Q&A corpus in the target domain, remove stop words to get a domain dictionary W, and use the dictionary to train a Word2Vec model to map each word in W to a high-dimensional vector containing the semantic information of the word, and use cosine similarity to measure the semantic similarity between any two words; For words in W, or belonging to dictionary L 0 , or does not belong to the basic sentiment dictionary L 0 , through the semantic similarity between any two words, there are several similar words belonging to the dictionary L 0 , then the word is taken as a potential emotion word and added to the potential emotion word set P; For each emotion word in the set P, define algorithm f to map its feature representation into a VAD emotion state vector; if the three dimensions of the VAD emotion state vector are all greater than 0, then add the emotion word and the corresponding VAD emotion state vector to the dictionary L 0 In the above example, the expanded domain sentiment dictionary is recorded as L new ; Collect the historical question and answer information of the current user and treat it as a document. Remove the stop words in the document and then perform word segmentation. The TF-IDF method is used to extract all keywords from the preprocessed documents; If the keyword is in the expanded domain sentiment dictionary L new Then find the VAD emotional state vector corresponding to the keyword; if the keyword is not in the expanded domain emotional dictionary L new In , a zero vector is used instead; The TF-IDF value of the keyword is used as a weight to multiply the VAD emotional state vector or the zero vector to obtain the corresponding preference knowledge embedding vector; Each keyword and the corresponding preference knowledge embedding vector are summarized to construct the user personalized sentiment dictionary.

9. A storage medium, It is characterized in that It stores a computer program for identifying emotions in user conversations in a product question-and-answer community for knowledge enhancement, wherein the computer program enables a computer to execute the method for identifying emotions in user conversations in a product question-and-answer community as described in any one of claims 1 to 6.

10. An electronic device, It is characterized in that include: one or more processors; Memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include a method for executing the product question and answer community user conversation emotion recognition method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Speech emotion recognition method based on context level self-attention network

    CN116306669A

  • Electroencephalogram (EEG) emotion recognition method based on spiking convolutional neural network

    US20240172984A1

Cited By

  • Psychological intervention method, system and equipment based on multi-modal emotion recognition and medium

    CN119153039A

  • Controllable supervised conversation simulation method and system based on large language model

    CN119202211A

  • Speech emotion recognition method based on supervised comparative learning

    CN119207385A

  • Dialogue emotion recognition method and device based on multi-modal large model

    CN119416035A

  • Dialogue risk assessment method, system and equipment based on large model and medium

    CN119578431A