Personalized implicit sentiment analysis method fusing multi-modal heterogeneous user knowledge

By constructing a multi-modal common sense knowledge graph and user implicit preference representation module, combining graph neural network and attention mechanism, and integrating user characteristics and external knowledge, the problem of ignoring user personality characteristics and external knowledge in traditional sentiment analysis is solved, and the Personalized recognition and in-depth understanding of implicit emotions improve the accuracy and depth of sentiment analysis.

CN118626588APending Publication Date: 2024-09-10SHANXI UNIV
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410675047.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Traditional sentiment analysis methods ignore users' personality characteristics and external knowledge when processing implicit emotions, resulting in problems of individual differences and insufficient emotional information, making it difficult to achieve accurate personalized implicit sentiment analysis.

Method used

A personalized implicit sentiment analysis method that integrates multi-modal heterogeneous user knowledge is adopted. By constructing a multi-modal common sense knowledge graph, user implicit preference representation module and emotional sentence representation module, combined with graph neural network and attention mechanism, the user fusion features and external knowledge to generate more accurate implicit emotion representations.

Benefits of technology

It achieves personalized recognition and in-depth understanding of implicit emotions, provides more accurate and personalized emotional analysis services, and improves the accuracy and depth of emotional analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626588A
    Figure CN118626588A
Patent Text Reader

Abstract

The invention belongs to the technical field of implicit sentiment analysis, and particularly relates to a personalized implicit sentiment analysis method fusing multi-modal heterogeneous user knowledge. In order to solve the problems of lack of user characteristic knowledge fusion and lack of effective utilization of multi-modal common knowledge in a traditional implicit emotion analysis method, the performance of personalized analysis of implicit emotion is improved. The method is mainly divided into four modules: a multi-modal common knowledge graph learning module, a multi-view user implicit preference representation module, a user content knowledge and sentiment sentence representation module and an implicit sentiment analysis module fusing heterogeneous knowledge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of implicit sentiment analysis, and in particular relates to a personalized implicit sentiment analysis method integrating multimodal heterogeneous user knowledge. Background Art

[0002] With the popularity of network platforms such as social media and e-commerce, a large amount of user-generated text data continues to emerge, which contains rich emotional information. As an important research topic in the field of natural language processing, sentiment analysis is committed to identifying and understanding emotional tendencies from texts, providing users with emotional insights and personalized services. However, traditional sentiment analysis methods mainly focus on the emotional vocabulary and syntactic structure on the surface of the text, ignoring the influence of users' personality characteristics and external knowledge on emotional expression, resulting in poor results in processing implicit emotions.

[0003] Implicit emotional expressions lack explicit emotional vocabulary, and their emotional tendencies are often affected by user characteristics. The same implicit emotional expression may have different emotional tendencies among different users. This individual difference makes it difficult for traditional sentiment analysis methods to accurately capture the user's true emotional state. Influenced by factors such as user background, personality traits, interest preferences, and social relationships, the interpretation of implicit emotions requires personalized analysis combined with user characteristics.

[0004] Existing research on implicit sentiment analysis has the following two deficiencies: On the one hand, there is a lack of fusion of user characteristic knowledge. Previous implicit sentiment analysis research mainly focused on the feature modeling representation of implicit emotional expression itself, while ignoring the effective modeling and fusion of heterogeneous user characteristics. Existing personalized implicit sentiment analysis research usually focuses on user modeling based on user attributes or relationships, without considering mining implicit features from user content. Some content-based user modeling methods usually directly learn the semantic information of the text content itself, without analyzing the correlation between words in the content and implicit user preferences. On the other hand, there is a lack of effective use of multimodal common sense knowledge. Existing research can only perform implicit sentiment analysis through the semantic information of words, phrases and sentences, or supplement it with the common sense knowledge of a single text modality. It is difficult to obtain enough sentiment information to achieve effective modeling of implicit sentiment semantics.

[0005] Therefore, personalized implicit sentiment analysis faces two major challenges: (1) The individual differences of users lead to the fact that the emotional tendency of implicit sentiment expression is closely related to user characteristics, but it is usually difficult to obtain directly; (2) The expression of implicit sentiment lacks sufficient emotional information and needs to be semantically enhanced with the help of external knowledge to improve the accuracy and depth of sentiment analysis.

[0006] In view of the above situation, it is necessary to propose a new personalized implicit sentiment analysis method, which can achieve accurate identification and deep understanding of implicit emotions by comprehensively utilizing user characteristics and external knowledge, and provide users with more accurate and personalized sentiment analysis services.

[0007] Therefore, the present invention aims to overcome the limitations of traditional sentiment analysis methods, realize personalized recognition and in-depth analysis of implicit emotions, and provide users with more intelligent and personalized emotional services. Summary of the invention

[0008] Aiming at the problems of lack of fusion of user characteristic knowledge and lack of effective utilization of multimodal common sense knowledge in personalized implicit sentiment analysis research tasks, the present invention proposes a personalized implicit sentiment analysis method that integrates multimodal heterogeneous user knowledge.

[0009] To achieve the above object, the present invention adopts the following technical solutions:

[0010] A personalized implicit sentiment analysis method integrating multimodal heterogeneous user knowledge includes the following steps:

[0011] S1. Data preparation: implicit sentiment text set S = {s}, s is implicit sentiment text, history of the author's published content history, multimodal common sense knowledge graph G = {N, R}, N is the multimodal common sense knowledge node set, R is the knowledge relationship set;

[0012] S2. Construct an implicit sentiment analysis model: including constructing a multimodal common sense knowledge graph learning module, a view user implicit preference representation module, a user content knowledge and sentiment sentence representation module, and an implicit sentiment analysis module that integrates heterogeneous knowledge, and outputs the integrated implicit sentiment representation;

[0013] S3. Implicit sentiment analysis model prediction: The fused implicit sentiment representation is mapped to the sentiment category space using a fully connected network layer, and the probability distribution of each sentiment category is obtained through the softmax function, thus completing the implicit sentiment analysis.

[0014] Furthermore, the multimodal common sense knowledge graph learning module is constructed in S2, specifically including:

[0015] 1) Multimodal common sense knowledge graph construction: A knowledge graph is constructed based on an external common sense knowledge base. The knowledge entities of the text modality in the common sense knowledge base are used as keywords. For each keyword, candidate images are retrieved from the online image repository, and text descriptions are generated for the candidate images. The semantic relevance between the text description and the keyword is calculated, and t candidate images with the highest semantic relevance scores are selected as nodes to be added to the knowledge graph, and connected with their corresponding knowledge entities to construct a multimodal common sense knowledge graph G = {N, R}, where N is the set of multimodal common sense knowledge nodes and R is the set of knowledge relations;

[0016] 2) Multimodal common sense knowledge node representation: For all nodes N in the multimodal common sense knowledge graph G = {N, R}, use ChatGLM-6B and ResNet-152 models to encode the text and image knowledge nodes in N respectively, and record the initialization code of the i-th knowledge node in N as e i (0) , the representation of knowledge nodes is learned through the following formula:

[0017]

[0018] Among them, e i (k) and e j (k) is the node representation of the knowledge entity or image at the kth iteration, N i Yes i The set of neighbor nodes, e j ∈N i ,|N i | is the set N i The size of , k is the number of iterations;

[0019] 3) Multimodal common sense knowledge graph learning: After k rounds of iterative optimization, each node in the multimodal common sense knowledge graph G learns the information of its adjacent nodes, and the node e is calculated by the following formula: i and e j Prediction of relationship between:

[0020]

[0021] Among them, W c , b c is the parameter matrix and bias, is a concatenation operation, The result of predicting the type of relationship between nodes;

[0022] 4) Multimodal common sense knowledge semantic enhancement: For a given sentence s, match the knowledge entity e and its associated first-order neighbor sentiment knowledge entity appearing in the sentence s from the acquired common sense knowledge base G, and use the feature vector e learned by 3) to represent all entities. i , together constitute the external multimodal common sense knowledge semantic matrix M of sentence s gs On this basis, the ChatGLM-6B model and MPOA model are used to learn the representation h of sentence s i , h i As the key and value of the stacked multi-head attention model, the external multimodal commonsense knowledge semantic matrix M of sentence s gs As a query, the introduction of noise information is controlled through the gating mechanism, and the semantic representation of sentence s is fused with the knowledge entity it matches to obtain the sentence representation h enhanced by multimodal common sense knowledge semantics g , the process is as follows:

[0023]

[0024] c g = stacked-attention(M gs ,h i ,h i )

[0025] z g =σ(W g c g +W i h i )

[0026] Among them, W g , W i is the weight matrix, σ is the sigmoid function, Multiply vector elements.

[0027] Furthermore, the multi-view user implicit preference representation module is constructed in S2, specifically:

[0028] 1) Construction of user-content interaction matrix: Calculate the mutual information of each word w∈history in the user's historical text and each sentiment polarity y∈{positive, negative, neutral}, and select the top 15% of words with the largest mutual information to construct the feature word set {f w}, use semantic similarity to select the t images with the highest similarity and use them as the feature image node set {f i} is added to the user-content interaction graph, and the users who interact with the corresponding feature words are connected to obtain the user-content interaction matrix m is the number of users, n is the number of feature words, and (k+1)*n is the total number of feature words and images;

[0029] 2) User-content multi-view generation: Perform singular value decomposition on the obtained user-content interaction matrix A′, represent the user with the left singular matrix, and represent the feature words and images with the right singular matrix. Calculate the value of each user u and feature word f w Or feature image f i The inner product of uw , generate a structural correlation score matrix M, and generate two views V by setting different threshold combinations <η1,η2> (1) , V (2) , for each view V (t) , defined as:

[0030]

[0031] Among them, A′ uw For user u and feature word f w Or feature image f i The value in the user-content interaction matrix A′;

[0032] 3) User-content interaction graph representation initialization: For the feature words in the user-content interaction graph, the ChatGLM-6B model is used to obtain its semantic representation P w ; For images, ResNet152 is used as the encoder to obtain the image representation P i For a user u, the basic information of the user is concatenated and then the ChatGLM-6B model is used to obtain its representation P u ; After concatenating the representations of users, feature words, and images, we get the pre-trained representation P containing semantic information, which is then integrated into the initial representation of the graph neural network model, defined as:

[0033]

[0034] in, is the initialization representation matrix of all users, feature words / feature images, that is, the concatenation of the left and right singular matrices obtained after singular value decomposition. is a learnable parameter matrix, m is the number of users, n is the number of feature words, t*n is the number of feature images, d is the size of the embedding dimension, and E is the matrix composed of the fused interaction graph nodes;

[0035] 4) User-content interaction graph learning: Use graph neural networks to learn information in graph structures. The propagation process is:

[0036]

[0037] in, is the representation of the user after the kth iteration, is the representation of the feature word or image after the kth iteration, and Represent the embedding vectors of user u and feature word w in the kth layer, N u and N w Represents the neighbor sets of user u and feature word w respectively, N u and N w is the size of the set, is the user's initial state, It is the initial state of the feature word or image.

[0038] Train each view separately, view V (t) The loss function is defined as follows:

[0039]

[0040] Among them, λ t is the view V (t) A hyperparameter of is the initial representation of users and feature words, m is the number of users, is the user node representation e u The transpose of

[0041] 5) Multi-view fusion: After k layers of optimization learning, two views V are obtained. (1) 、V (2) Users said As a multi-view representation of the user's implicit preference, the attention mechanism is used to fuse the multi-view representation, and the implicit sentiment sentence is represented by the ChatGLM-6B model and the MPOA model. i As query vector, combined with multi-view representation of user implicit preferences To obtain the attention weight of each view, and then obtain the fused implicit preference representation u r , the process definition is as follows:

[0042]

[0043] in, b i are the parameter matrix and bias vector of the i-th view respectively.

[0044] Furthermore, the user content knowledge and sentiment sentence representation module is constructed in S2, specifically:

[0045] 1) User content knowledge representation: User content knowledge includes user basic information and user historical text. For user basic information, these information are concatenated and then the ChatGLM-6B model is used to obtain the representation of the entire long sequence h u , and use the stacked attention model to convert the implicit sentiment sentence into the representation h obtained by the ChatGLM-6B model s With h u Fusion obtains user basic information representation u s , the process definition is as follows:

[0046] s c = stacked-attention(h u ,h s ,h s )

[0047] s z =σ(W z s c +b z )

[0048]

[0049] W z and b z is the learnable parameter matrix and bias vector, σ is the sigmoid function;

[0050] For user historical texts, all historical texts of each user are regarded as a long text, and the ChatGLM-6B model and Transformer model are used to obtain the user historical text representation u c ;

[0051] 2) Implicit emotional sentence representation: Use the ChatGLM-6B model and the MPOA model to obtain the representation of implicit emotional sentences h i , defined as:

[0052]

[0053] α ij =softmax(q j W i )

[0054]

[0055] Among them, w i is the representation of the i-th word learned by the ChatGLM-6B model in the implicit sentiment sentence, T is the number of words in sentence s, [pos,neu,neg] refers to the three sentiment polarities of positive, neutral, and negative, j is one of the sentiment polarities, and q jis the attention query vector corresponding to the emotion, α ij w i With q j The attention weight, W is the parameter matrix, For splicing operation.

[0056] Furthermore, the implicit sentiment analysis module integrating heterogeneous knowledge is constructed in S2, specifically:

[0057] 1) Heterogeneous knowledge fusion: semantically enhanced sentence representation h obtained by multimodal common sense knowledge g , user basic information representation s , user history text representation u c and the fused implicit preference representation u r Fusion is performed to obtain the fused implicit emotion representation h o , defined as:

[0058] c c = stacked-attention(u c ,h i ,h i )

[0059] c r = stacked-attention(u r ,h i ,h i )

[0060] c s = stacked-attention(u s ,h i ,h i )

[0061]

[0062] in, b c , b r , b s Both are learnable parameter matrices and bias vectors.

[0063] Furthermore, the implicit sentiment analysis model prediction in S3 is specifically:

[0064] The fused implicit emotion is represented as h o Use a fully connected network layer to map to the emotion category space, and use the softmax function to obtain the probability distribution of each emotion category. As shown below:

[0065]

[0066] Among them, W o and b o are the parameters of the linear layer.

[0067] Furthermore, it also includes the optimization of implicit sentiment analysis model, specifically:

[0068] 1) The cross entropy loss function is used to measure the loss predicted by the implicit sentiment analysis model. At the same time, the orthogonal constraint in the MPOA model is added to maintain the sensitivity and difference of the attention of different sentiment polarities in the implicit sentiment sentence representation to the text content, which is defined as follows:

[0069]

[0070] Among them, x is the sentiment sentence, y is the true label of the sentiment sentence, λ is a hyperparameter used to adjust the ratio of prediction loss and orthogonal constraint, and q i ,q j ∈Q is a query vector of a certain sentiment polarity;

[0071] 2) The Adam stochastic gradient descent algorithm is used for parameter optimization learning. The model automatically adjusts the model parameters and data representation according to the size of the loss function return value on all data, and performs the next round of iterations, so that the loss value of the next round of iterations is reduced. The model iterative optimization process is repeated until the loss value stabilizes or the maximum number of iterations is reached.

[0072] Compared with the prior art, the present invention has the following advantages:

[0073] In response to the problem of lack of fusion of user characteristic knowledge, the present invention combines user portraits with implicit emotion semantic modeling, and comprehensively considers information such as the user's identity background and implicit preferences to achieve personalized analysis of implicit emotions. Personalized implicit emotion modeling based on multi-view fusion of implicit user preferences: First, the user's implicit preferences are modeled by screening feature words, and the user-content interaction graph is constructed using the interactive relationship between the user and the feature words; on this basis, multiple views are generated from different style and theme perspectives to model the user's implicit preferences, and a graph convolutional network is used to learn the complementary features of each view. Furthermore, user content knowledge is mined based on the user's basic information and historical content, and the user's implicit preferences and user content knowledge representations are integrated with the implicit emotion semantic representation to enhance the implicit emotion semantic modeling capabilities.

[0074] To address the problem of lack of effective utilization of multimodal common sense knowledge, based on personalized implicit emotion modeling based on multi-view fusion of implicit user preferences, this paper enhances the implicit preference feature words associated with users with multimodal knowledge, integrates feature-associated images into the interaction process between users and implicit preference features, and uses graph neural networks to learn the fusion semantics of user-implicit preference-associated images. At the same time, by multimodally expanding the common sense knowledge base, graph neural networks are used to introduce richer semantics for common sense knowledge entities. On this basis, the implicit emotion semantics are enhanced by using multimodal fusion of user information and common sense knowledge to provide richer knowledge information for personalized analysis of implicit emotions. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] Figure 1 It is a framework diagram of the implicit sentiment analysis model of the present invention;

[0076] Figure 2 Examples of implicit sentiment data and some multi-model heterogeneous knowledge. DETAILED DESCRIPTION

[0077] In order to further illustrate the technical solution of the present invention, the present invention is further described below through embodiments.

[0078] A personalized implicit sentiment analysis method for integrating multimodal heterogeneous user knowledge in this embodiment includes the following steps:

[0079] S1. Data preparation: implicit sentiment text set S = {s}, s is implicit sentiment text, history of the author's published content history, multimodal common sense knowledge graph G = {N, R}, N is the multimodal common sense knowledge node set, R is the knowledge relationship set;

[0080] For example, sentence s = "There are various insects that cannot be seen in Beijing!", the implicit sentiment label y corresponding to sentence s s = "commendation". The author of the implicit sentiment sentence s has published historical content in the past: "This weekend, I plan to go to an insect exhibition and look forward to observing those delicate little creatures up close." Examples of implicit sentiment data and some multimodal heterogeneous knowledge are as follows: Figure 2 shown.

[0081] S2, build implicit sentiment analysis model (such as Figure 1 As shown in the figure): It includes building a multimodal common sense knowledge graph learning module, a view user implicit preference representation module, a user content knowledge and sentiment sentence representation module, and an implicit sentiment analysis module that integrates heterogeneous knowledge, and outputs the integrated implicit sentiment representation;

[0082] Construct a multimodal common sense knowledge graph learning module, including:

[0083] 1) Construction of multimodal common sense knowledge graph: In order to effectively introduce and utilize external knowledge for implicit sentiment analysis, a knowledge graph is constructed based on the external ConceptNet common sense knowledge base. The knowledge entities of the text modality in the common sense knowledge base are used as keywords. Five candidate images are retrieved from the online image repository for each keyword. In order to ensure the semantic relevance between these retrieved images and the keywords, the CogVLM model is used to generate text descriptions for the candidate images. The BERT model is used to calculate the semantic relevance between the text description and the keywords. T candidate images with the highest semantic relevance scores are selected as nodes and added to the knowledge graph. They are connected to their corresponding knowledge entities to construct a multimodal common sense knowledge graph G = {N, R}, where N is the set of multimodal common sense knowledge nodes and R is the set of knowledge relations.

[0084] 2) Multimodal common sense knowledge node representation: For all nodes N in the multimodal common sense knowledge graph G = {N, R}, since the nodes in the multimodal knowledge graph are knowledge entity words and images, if the nodes are randomly initialized, the information of the words and images themselves will be lost. Therefore, the present invention uses the ChatGLM-6B and ResNet-152 models in the large language model to encode the text and image knowledge nodes in N, respectively, and the initialization code of the i-th knowledge node in N is recorded as e i (0) , the representation of knowledge nodes is learned through the following formula:

[0085]

[0086] Among them, e i (k) and e j (k) is the node representation of the knowledge entity or image at the kth iteration, N i Yes i The set of neighbor nodes, e j ∈N i ,|N i | is the set N i The size of , k is the number of iterations;

[0087] 3) Multimodal common sense knowledge graph learning: After k rounds of iterative optimization, each node in the multimodal common sense knowledge graph G learns the information of its adjacent nodes, and the node e is calculated by the following formula: i and e j Prediction of relationship between:

[0088]

[0089] Among them, W c , b c is the parameter matrix and bias, is a concatenation operation, The result of predicting the type of relationship between nodes;

[0090] The objective function of training is defined as follows:

[0091]

[0092] 4) Multimodal common sense knowledge semantic enhancement: For a given sentence s, match the knowledge entity e and its associated first-order neighbor sentiment knowledge entity appearing in the sentence s from the obtained multimodal common sense knowledge base G, and use the feature vector e learned by 3) to represent all entities. i , together constitute the external multimodal common sense knowledge semantic matrix M of sentence s gs On this basis, the ChatGLM-6B model and MPOA model are used to learn the representation h of sentence s i , h i As the key and value of the stacked multi-head attention model, the external multimodal commonsense knowledge semantic matrix M of sentence s gs As a query, the introduction of noise information is controlled through the gating mechanism, and the semantic representation of sentence s is fused with the knowledge entity it matches to obtain the sentence representation h enhanced by multimodal common sense knowledge semantics g , the process is as follows:

[0093]

[0094] c g = stacked-attention(M gs ,h i ,h i )

[0095] z g =σ(W g c g +W i h i )

[0096] Among them, W g , W i is the weight matrix, σ is the sigmoid function, Multiply vector elements.

[0097] All the matched knowledge entities are represented as a set E s Since the set E of different sentences s s The number of nodes in the set E is different. In order to ensure the uniformity of subsequent operations, the present invention performs sThe size of is specified, and for sets with less than l nodes, they are filled with all-zero vectors, where l is the number of knowledge entities contained in the set corresponding to all sentiment sentences in the dataset, thereby obtaining the external common sense knowledge semantic matrix of sentence s

[0098] Since not all knowledge entities matched by sentence s are related to sentence s, it is necessary to select a suitable fusion method to extract useful sentiment information from them. The present invention fuses the semantic representation of sentence s with the knowledge entities matched by it by using stacked multi-head attention.

[0099] Construct a multi-view user implicit preference representation module, specifically:

[0100] 1) Construction of user-content interaction matrix: Calculate the mutual information of each word w∈history in the user's historical text and each sentiment polarity y∈{positive, negative, neutral}, and select the top 15% of words with the largest mutual information to construct the feature word set {f w}, use semantic similarity to select the 5 most similar images and use them as the feature image node set {f i} is added to the user-content interaction graph, and the users who interact with the corresponding feature words are connected to obtain the user-content interaction matrix m is the number of users, n is the number of feature words, and (k+1)*n is the total number of feature words and images;

[0101] 2) User-content multi-view generation: Perform singular value decomposition (SVD) on the obtained user-content interaction matrix A′. The user is represented by the left singular matrix, and the feature words and images are represented by the right singular matrix. Calculate the value of each user u and feature word f w Or feature image f i The inner product of uw , generate a structural correlation score matrix M, and generate two views by setting different threshold settings <η1,η2>, where V (1) <4e-4,0.025>, V (2) is <8e-4,0.025>, for each view V (t) , defined as:

[0102]

[0103] Among them, A′ uw For user u and feature word f w Or feature image f i The value in the user-content interaction matrix A′;

[0104] 3) Initialization of user-content interaction graph representation: In order to enable the graph convolutional network to learn the semantic information of the node itself during the learning process, the present invention uses the ChatGLM-6B model to obtain the semantic representation P of the feature words in the user-content interaction graph. w ; For images, ResNet152 is used as the encoder to obtain the image representation P i For a user u, the user's basic information (gender, region, and personal signature) is concatenated and then the ChatGLM-6B model is used to obtain its representation P u ; After concatenating the representations of users, feature words, and images, we get the pre-trained representation P containing semantic information, which is then integrated into the initial representation of the graph neural network model, defined as:

[0105]

[0106] in, is the initialization representation matrix of all users, feature words / feature images, that is, the concatenation of the left and right singular matrices obtained after singular value decomposition. is a learnable parameter matrix, m is the number of users, n is the number of feature words, t*n is the number of feature images, d is the size of the embedding dimension, and E is the matrix composed of the fused interaction graph nodes;

[0107] 4) User-content interaction graph learning: Use graph neural networks to learn information in graph structures. The propagation process is:

[0108]

[0109] in, is the representation of the user after the kth iteration, is the representation of the feature word or image after the kth iteration, and Represent the embedding vectors of user u and feature word w in the kth layer, N u and N w Represents the neighbor sets of user u and feature word w respectively, N u and N w is the size of the set, is the user's initial state, It is the initial state of the feature word or image and will not be updated as the model is optimized, so that the node maintains its individuality during the propagation process.

[0110] Train each view separately, view V (t) The loss function is defined as follows:

[0111]

[0112] Among them, λ t is the view V (t) A hyperparameter of is the initial representation of users and feature words, m is the number of users, is the user node representation e u The transpose of

[0113] 5) Multi-view fusion: After k layers of optimization learning, two views V are obtained. (1) 、V (2) Users said As a multi-view representation of user implicit preferences, in order to better fuse the user implicit preference representations of multiple views, the attention mechanism is used to fuse the multi-view representations, and the implicit sentiment sentences are represented by the ChatGLM-6B model and the MPOA model. i As query vector, combined with multi-view representation of user implicit preferences To obtain the attention weight of each view, and then obtain the fused implicit preference representation u r , the process definition is as follows:

[0114]

[0115] in, b i are the parameter matrix and bias vector of the i-th view respectively.

[0116] Construct user content knowledge and sentiment sentence representation modules, specifically:

[0117] 1) User content knowledge representation: User content knowledge includes user basic information and user historical text. For user basic information, these information are concatenated and then the ChatGLM-6B model is used to obtain the representation of the entire long sequence h u , and use the stacked attention model to convert the implicit sentiment sentence into the representation h obtained by the ChatGLM-6B model s With h u Fusion obtains user basic information representation u s , the process definition is as follows:

[0118] s c = stacked-attention(h u ,h s ,h s )

[0119] s z =σ(W z s c +b z )

[0120]

[0121] W z and b z is the learnable parameter matrix and bias vector, σ is the sigmoid function;

[0122] For user historical texts, all historical texts of each user are regarded as a long text, and the ChatGLM-6B model and Transformer model are used to obtain the user historical text representation u c ;

[0123] 2) Implicit emotional sentence representation: Use the ChatGLM-6B model and the MPOA model to obtain the representation of implicit emotional sentences h i , defined as:

[0124]

[0125] α ij =softmax(q j W i )

[0126]

[0127] Among them, w i is the representation of the i-th word learned by the ChatGLM-6B model in the implicit sentiment sentence, T is the number of words in sentence s, [pos,neu,neg] refers to the three sentiment polarities of positive, neutral, and negative, j is one of the sentiment polarities, and q j is the attention query vector corresponding to the emotion, α ij w i With q j The attention weight, W is the parameter matrix, For splicing operation.

[0128] Construct an implicit sentiment analysis module that integrates heterogeneous knowledge, specifically:

[0129] 1) Heterogeneous knowledge fusion: Use stacked attention to obtain the sentence representation h of multimodal common sense knowledge semantic enhancement g , user basic information representation s , user history text representation u c and the fused implicit preference representation u r Fusion is performed to obtain the fused implicit emotion representation h o , defined as:

[0130] c c = stacked-attention(u c ,hi ,h i )

[0131] c r = stacked-attention(u r ,h i ,h i )

[0132] c s = stacked-attention(u s ,h i ,h i )

[0133]

[0134] in, b c , b r , b s Both are learnable parameter matrices and bias vectors.

[0135] S3. Implicit sentiment analysis model prediction: The fused implicit sentiment representation is mapped to the sentiment category space using a fully connected network layer, and the probability distribution of each sentiment category is obtained through the softmax function, thus completing the implicit sentiment analysis.

[0136] Probability distribution of each emotion category As shown below:

[0137]

[0138] Among them, W o and b o are the parameters of the linear layer.

[0139] S4. Optimization of implicit sentiment analysis model, specifically:

[0140] 1) The cross entropy loss function is used to measure the loss predicted by the implicit sentiment analysis model. At the same time, the orthogonal constraint in the MPOA model is added to maintain the sensitivity and difference of the attention of different sentiment polarities in the implicit sentiment sentence representation to the text content, which is defined as follows:

[0141]

[0142] Among them, x is the sentiment sentence, y is the true label of the sentiment sentence, λ is a hyperparameter used to adjust the ratio of prediction loss and orthogonal constraint, and q i ,q j ∈Q is a query vector of a certain sentiment polarity;

[0143] 2) The Adam stochastic gradient descent algorithm is used for parameter optimization learning. The model automatically adjusts the model parameters and data representation according to the size of the loss function return value on all data, and performs the next round of iterations, so that the loss value of the next round of iterations is reduced. The model iterative optimization process is repeated until the loss value stabilizes or the maximum number of iterations is reached.

[0144] Example 2

[0145] The effect of the proposed model is verified on two datasets: implicit emotion dataset D-implicit and general emotion dataset D-general. The model is implemented based on the PyTorch framework, the operating environment is Ubuntu 22.04, and the computing device is RTX 3090*4. The detailed experimental configuration and hyperparameter settings of this experiment are as follows:

[0146] In the experiment, the top 15% of words in the user content were selected as feature words after sorting from large to small according to the eigenvalues; the original user-content matrix retained the first 64 singular values ​​and corresponding singular vectors after singular value decomposition, that is, user e u and the characteristic word e w The embedding is 64-dimensional; the number of multiple views is set to 3; the number of iterations of view learning is set to 3; except for the original view, the threshold combination <η1,η2> parameters in the other two views are set to <4e-4,0.025> and <8e-4,0.025> respectively; the number of stacked attention layers for user basic information and the number of stacked attention layers k for user information fusion are set to 2 and 3 respectively; the maximum sequence length of user basic information (gender, region, personal signature) is [6,6,24] respectively; due to the large length of user history text, its maximum sequence length is set to 192; the word embedding dimension is 768; the number of Transformer encoder layers is set to 6; the coefficient λ of the classification loss in the loss function is 0.9; the optimization method uses Adam optimization with a learning rate of 6e-6; and the dropout is set to 0.5. In addition, 10 images were retrieved for each feature word, and 5 images were retained after semantic similarity calculation; the embedding size d of the image was set to 2048; the number of iterations of LightGCN was set to 3; the node embedding of the user-content interaction graph was 256; the word embedding dimension was set to 4096; and the learning rate was 6e-7.

[0147] The present invention is compared horizontally with a series of current international cutting-edge sentiment analysis and representation classification methods (BERT, RoBERTa, BERT-CNN, BERT-RNN, BERT-RCNN, BERT-DPCNN, ERNIE, MPOA, ACOS, SPDAug, SCAPT, RGAT, KGAN, RDGCN, MV-IUP). In addition, it is compared and analyzed with the online large language model ChatGLM-130b with 130B parameters. Experiments were conducted on two personalized implicit sentiment analysis datasets, D-implicit and D-general. Precision (P), recall (R) and F1 value were used to measure the recognition performance of each implicit sentiment category, and the macro average F1 value (F1-macro) was used to evaluate the overall performance. The comparison results are shown in Tables 1 and 2 below.

[0148] Table 1 Comparison of experimental results (D-implicit dataset)

[0149]

[0150] Table 2 Comparison of experimental results (D-general dataset)

[0151]

[0152]

[0153] As can be seen from Tables 1 and 2 above, the model proposed in the present invention has achieved better results than other comparison models on both data sets, and the F1-macro value is 0.2%-10.9% (D-implicit) and 0.1%-14.8% (D-general) higher than all comparison experiments. Through specific analysis, methods based on pre-trained models such as BERT, RoBERTa, and ERNIE only represent the deep semantics of the emotional sentence itself, but do not consider additional information. MPOA models the difference in emotional polarity; SPDAug uses a semantically preserved data expansion method to provide more training data; ACOS and SCAPT respectively study implicit sentiment analysis by extracting quadruplets and supervised contrastive learning methods; RGAT and RDGCN both use graph neural networks to better learn text semantics; KGAN enhances sentiment analysis through knowledge graphs; the ChatGLM-130b model can learn rich semantic information from a large amount of pre-training data, but still cannot deeply understand user information. These methods have achieved good results, but they all ignore the important influence of user characteristics on implicit emotions. In contrast, the method proposed in the present invention generates multiple views from the original user-content view, models user characteristics from different angles, and deeply understands user characteristics, thereby obtaining a better implicit emotion discrimination effect. In addition, since most comparison models only use unimodal data, they are unable to use different features between multimodalities for sentiment analysis. The model of the present invention deeply mines user characteristics by adding image information to the user's implicit preference module, and at the same time introduces multimodal common sense knowledge to use the complementary information of different modal knowledge to better perform implicit emotion discrimination, thereby alleviating the problem of lack of emotional information in implicit emotion expression.

[0154] In order to verify the role of each core module of the method proposed in the present invention, further ablation experiments are performed on it. i The images in the user-content interaction graph were removed to verify the effect of adding image information to the model's user implicit preference module; -g removed the common sense knowledge graph learning module to verify the effect of the common sense knowledge module on the model. The experimental results are shown in Tables 3 and 4.

[0155] Table 3D-implicit ablation experimental results

[0156]

[0157] Table 4 D-general ablation experiment results

[0158]

[0159] From the experimental results, it can be seen that after removing the image information or common sense knowledge in the user-content interaction, the experimental effect is reduced, indicating that image information and common sense knowledge play a certain role in the model. After removing the image information and common sense knowledge in the user-content interaction, the model effect is reduced to a certain extent, indicating that the model can learn additional emotional information from multimodal data and common sense knowledge to enhance implicit emotional semantic modeling.

Claims

1. A personalized implicit sentiment analysis method integrating multimodal heterogeneous user knowledge, characterized in that: The following steps are involved: S1. Data preparation: implicit sentiment text set S = {s}, s is implicit sentiment text, history of the author's published content history, multimodal common sense knowledge graph G = {N, R}, N is the multimodal common sense knowledge node set, R is the knowledge relationship set; S2. Construct an implicit sentiment analysis model: including constructing a multimodal common sense knowledge graph learning module, a view user implicit preference representation module, a user content knowledge and sentiment sentence representation module, and an implicit sentiment analysis module that integrates heterogeneous knowledge, and outputs the integrated implicit sentiment representation; S3. Implicit sentiment analysis model prediction: The fused implicit sentiment representation is mapped to the sentiment category space using a fully connected network layer, and the probability distribution of each sentiment category is obtained through the softmax function, thus completing the implicit sentiment analysis.

2. According to claim 1, a personalized implicit sentiment analysis method integrating multimodal heterogeneous user knowledge is characterized in that: The multimodal common sense knowledge graph learning module is constructed in S2, specifically including: 1) Multimodal common sense knowledge graph construction: A knowledge graph is constructed based on an external common sense knowledge base. The knowledge entities of the text modality in the common sense knowledge base are used as keywords. For each keyword, candidate images are retrieved from the online image repository, and text descriptions are generated for the candidate images. The semantic relevance between the text description and the keyword is calculated, and t candidate images with the highest semantic relevance scores are selected as nodes to be added to the knowledge graph, and connected with their corresponding knowledge entities to construct a multimodal common sense knowledge graph G = {N, R}, where N is the set of multimodal common sense knowledge nodes and R is the set of knowledge relations; 2) Multimodal common sense knowledge node representation: For all nodes N in the multimodal common sense knowledge graph G = {N, R}, use ChatGLM-6B and ResNet-152 models to encode the text and image knowledge nodes in N respectively, and record the initialization code of the i-th knowledge node in N as e i (0) , the representation of knowledge nodes is learned through the following formula: Among them, e i (k) and e j (k) is the node representation of the knowledge entity or image at the kth iteration, N i Yes i The set of neighbor nodes, e j ∈N i ,|N i | is the set N i The size of , k is the number of iterations; 3) Multimodal common sense knowledge graph learning: After k rounds of iterative optimization, each node in the multimodal common sense knowledge graph G learns the information of its adjacent nodes, and the node e is calculated by the following formula: i and e j Prediction of relationship between: Among them, W c , b c is the parameter matrix and bias, is a concatenation operation, The result of predicting the type of relationship between nodes; 4) Multimodal common sense knowledge semantic enhancement: For a given sentence s, match the knowledge entity e and its associated first-order neighbor sentiment knowledge entity appearing in the sentence s from the obtained multimodal common sense knowledge base G, and use the feature vector e learned by 3) to represent all entities. i , together constitute the external multimodal common sense knowledge semantic matrix M of sentence s gs On this basis, the ChatGLM-6B model and MPOA model are used to learn the representation h of sentence s i , h i As the key and value of the stacked multi-head attention model, the external multimodal commonsense knowledge semantic matrix M of sentence s gs As a query, the introduction of noise information is controlled through the gating mechanism, and the semantic representation of sentence s is fused with the knowledge entity it matches to obtain the sentence representation h enhanced by multimodal common sense knowledge semantics g , the process is as follows: c g =stacked-attention(M gs ,h i ,h i ) With g =σ(W g c g +W i h i ) Among them, W g , W i is the weight matrix, σ is the sigmoid function, Multiply vector elements.

3. According to claim 2, a personalized implicit sentiment analysis method integrating multimodal heterogeneous user knowledge is characterized in that: In S2, a multi-view user implicit preference representation module is constructed, specifically: 1) Construction of user-content interaction matrix: Calculate the mutual information of each word w∈history in the user's historical text and each sentiment polarity y∈{positive, negative, neutral}, and select the top 15% of words with the largest mutual information to construct the feature word set {f w }, use semantic similarity to select the t images with the highest similarity and use them as the feature image node set {f i } is added to the user-content interaction graph, and the users who interact with the corresponding feature words are connected to obtain the user-content interaction matrix m is the number of users, n is the number of feature words, and (k+1)*n is the total number of feature words and images; 2) User-content multi-view generation: Perform singular value decomposition on the obtained user-content interaction matrix A′, represent the user with the left singular matrix, and represent the feature words and images with the right singular matrix. Calculate the value of each user u and feature word f w Or feature image f i The inner product of uw , generate a structural correlation score matrix M, and generate two views V by setting different threshold combinations <η1,η2> (1) , V (2) , for each view V (t) , defined as: Among them, A′ uw For user u and feature word f w Or feature image f i The value in the user-content interaction matrix A′; 3) User-content interaction graph representation initialization: For the feature words in the user-content interaction graph, the ChatGLM-6B model is used to obtain its semantic representation P w ; For images, ResNet152 is used as the encoder to obtain the image representation P i For a user u, the basic information of the user is concatenated and then the ChatGLM-6B model is used to obtain its representation P u ; After concatenating the representations of users, feature words, and images, we get the pre-trained representation P containing semantic information, which is then integrated into the initial representation of the graph neural network model, defined as: in, is the initialization representation matrix of all users, feature words / feature images, that is, the concatenation of the left and right singular matrices obtained after singular value decomposition. is a learnable parameter matrix, m is the number of users, n is the number of feature words, t*n is the number of feature images, d is the size of the embedding dimension, and E is the matrix composed of the fused interaction graph nodes; 4) User-content interaction graph learning: Use graph neural networks to learn information in graph structures. The propagation process is: in, is the representation of the user after the kth iteration, is the representation of the feature word or image after the kth iteration, and Represent the embedding vectors of user u and feature word w in the kth layer, N u and N w Represents the neighbor sets of user u and feature word w respectively, |N u | and |N w | is the size of the set, is the user's initial state, It is the initial state of the feature word or image. Train each view separately, view V (t) The loss function is defined as follows: Among them, λ t is the view V (t) A hyperparameter of is the initial representation of users and feature words, m is the number of users, is the user node representation e u The transpose of 5) Multi-view fusion: After k layers of optimization learning, two views V are obtained. (1) 、V (2) Users said As a multi-view representation of the user's implicit preference, the attention mechanism is used to fuse the multi-view representation, and the implicit sentiment sentence is represented by the ChatGLM-6B model and the MPOA model. i As query vector, combined with multi-view representation of user implicit preferences To obtain the attention weight of each view, and then obtain the fused implicit preference representation u r , the process definition is as follows: in, b i are the parameter matrix and bias vector of the i-th view respectively.

4. According to claim 3, a personalized implicit sentiment analysis method integrating multimodal heterogeneous user knowledge is characterized in that: The user content knowledge and sentiment sentence representation module is constructed in S2, specifically: 1) User content knowledge representation: User content knowledge includes user basic information and user historical text. For user basic information, these information are concatenated and then the ChatGLM-6B model is used to obtain the representation of the entire long sequence h u , and use the stacked attention model to convert the implicit sentiment sentence into the representation h obtained by the ChatGLM-6B model s With h u Fusion obtains user basic information representation u s , the process definition is as follows: s c =stacked-attention(h u ,h s ,h s ) s z =σ(W z s c +b z ) Among them, W z and b z is the learnable parameter matrix and bias vector, σ is the sigmoid function; For user historical texts, all historical texts of each user are regarded as a long text, and the ChatGLM-6B model and Transformer model are used to obtain the user historical text representation u c ; 2) Implicit emotional sentence representation: Use the ChatGLM-6B model and the MPOA model to obtain the representation of implicit emotional sentences h i , defined as: α ij =softmax(q j Ww i ) Among them, w i is the representation of the i-th word learned by the ChatGLM-6B model in the implicit sentiment sentence, T is the number of words in sentence s, [pos,neu,neg] refers to the three sentiment polarities of positive, neutral, and negative, j is one of the sentiment polarities, and q j is the attention query vector corresponding to the emotion, α ij w i With q j The attention weight, W is the parameter matrix, For splicing operation.

5. According to claim 4, a personalized implicit sentiment analysis method integrating multimodal heterogeneous user knowledge is characterized in that: The implicit sentiment analysis module integrating heterogeneous knowledge is constructed in S2, specifically: 1) Heterogeneous knowledge fusion: semantically enhanced sentence representation h obtained by multimodal common sense knowledge g , user basic information representation s , user history text representation u c And the fused implicit preference representation u r Fusion is performed to obtain the fused implicit emotion representation h o , defined as: c c =stacked-attention(u c ,h i ,h i ) c r =stacked-attention(u r ,h i ,h i ) c s =stacked-attention(u s ,h i ,h i ) in, b c 、b r 、b s Both are learnable parameter matrices and bias vectors.

6. According to claim 5, a personalized implicit sentiment analysis method integrating multimodal heterogeneous user knowledge is characterized in that: The implicit sentiment analysis model prediction in S3 is specifically: The fused implicit emotion is represented as h o Use a fully connected network layer to map to the emotion category space, and use the softmax function to obtain the probability distribution of each emotion category. As shown below: Among them, W o and b o are the parameters of the linear layer.

7. The personalized implicit sentiment analysis method integrating multimodal heterogeneous user knowledge according to claim 6 is characterized in that: It also includes the optimization of implicit sentiment analysis models, specifically: 1) The cross entropy loss function is used to measure the loss predicted by the implicit sentiment analysis model. At the same time, the orthogonal constraint in the MPOA model is added to maintain the sensitivity and difference of the attention of different sentiment polarities in the implicit sentiment sentence representation to the text content, which is defined as follows: Among them, x is the sentiment sentence, y is the true label of the sentiment sentence, λ is a hyperparameter used to adjust the ratio of prediction loss and orthogonal constraint, and q i ,q j ∈Q is a query vector of a certain sentiment polarity; 2) The Adam stochastic gradient descent algorithm is used for parameter optimization learning. The model automatically adjusts the model parameters and data representation according to the size of the loss function return value on all data, and performs the next round of iterations, so that the loss value of the next round of iterations is reduced. The model iterative optimization process is repeated until the loss value stabilizes or the maximum number of iterations is reached.

Citation Information

Cited By

  • Implicit emotion recognition method based on multilevel recognition and user information enhancement

    CN119377735A

  • Recommendation method fusing knowledge graph and sentiment analysis

    CN119397105A

  • User analysis method, device and equipment based on large model and storage medium

    CN120524251A