Text emotion deep reason identification method and device based on common sense reasoning

By constructing emotional clause diagrams and reason clause diagrams, combining common sense knowledge and multi-layer graph attention layer, the deep emotional cause identification problem in the text is solved, and the accuracy and reliability of emotional cause inference is improved.

CN119179754AActive Publication Date: 2024-12-24SUN YAT SEN UNIV

Patent Information

Application Number
CN202311867525.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2024-12-24
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

The existing technology is difficult to identify deep emotional causes in texts. Traditional methods mainly focus on shallow causes, lack effective deep emotional causes recognition mechanisms, and machines have weak abilities in understanding and reasoning of abstract knowledge.

Method used

By constructing emotional clause diagrams and reason clause diagrams, searching common sense knowledge and expanding the graph structure, using multi-layer graph attention layer and multi-head attention interaction mechanism, filtering and decoding the most relevant emotions-cause combinations to generate deep emotions reason.

Benefits of technology

It realizes effective exploration of the deep emotional reasons behind the superficial emotional causes of the text, improves the accuracy and reliability of emotional cause inference, and can better understand the text semantics and causal relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179754A_ABST
    Figure CN119179754A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and discloses a text emotion deep reason recognition method and device based on common sense reasoning, and the method comprises the steps: firstly recognizing potential emotion clauses and potential reason clauses in a text, and constructing a corresponding emotion clause graph and a corresponding reason clause graph; then, searching emotional and causal common senses related to the clauses to expand a graph structure, and obtaining two graph neural networks for representing context semantics and common sense knowledge of an emotional and reason graph respectively; and utilizing an interactive attention mechanism to find out an emotion-reason combination clause pair with the maximum relevancy, and further decoding a deep reason with a relatively strong causal relationship and a corresponding emotion. Due to the fact that a text grammar structure is fully described and related external common senses are fused, deep emotional reasons can be better decoded, potential deep emotional reasons behind text surface emotional reason events are mined, and the accuracy and reliability of emotional reason inference are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for identifying the deep causes of text emotions based on common sense reasoning. Background Art

[0002] With the rapid development of the Internet, more and more text data with subjective emotions are generated, such as comment data in the e-commerce field and conversation data in the field of psychological counseling. These emotions are a series of physical and mental states that are generated by a combination of multiple factors such as feelings, cognition, thoughts and behaviors. This kind of text with emotions contains rich subjective knowledge and reflects people's preferences and feelings. It is of great value to mine this preference knowledge. Decision makers see the essence from the phenomenon, and realize the transition from "knowing what it is" to "knowing why it is" to solve the root cause. For example, in the dialogue system, by analyzing the emotions and reasons contained in the user's expression in the dialogue, the machine can generate more appropriate replies; for product or service operations, enterprises can accurately grasp the user's real experience and needs by analyzing the user's emotions and the induced internal reasons in the comment data. This is conducive to clarifying the direction of improvement and optimization and launching products and services that better meet consumer expectations.

[0003] Regarding the problem of discovering the causes of emotions, most of the existing work only focuses on the superficial causes that stimulate emotions, and the research on the deep causes is very weak. The "shallow" and "deep" here refer to the degree of semantic cognition. Shallow causes generally refer to emotional causes or events that appear in the literal text. People can directly extract the sentence where the cause event is located, or extract certain fragments from the text as causes through clue words such as "lead to" and "due to". For example, for the text "Xiao Ming is very sad because he failed the exam." The text fragment can be extracted to obtain the cause of negative emotions as "failed the exam." These methods can identify simple superficial causes. However, the expression of emotions is diverse and complex, and some emotional causes are vague and obscure. For example, Figure 1As shown, for the text "I recently bought this cheap phone and it's really annoying. I called 'Excuse me...you you...is it...etc....etc....'. I called the customer service and she said that I could try to put the phone in a higher position, or put it by the window and add a signal amplifier. I can't stand it anymore. I will switch to Huawei next." This comment contains the emotion of "anger". Through literal matching, the shallow cause event extracted is "bought this phone" or "made a phone call". However, these neutral actions do not carry any emotional tendency and are not the root cause of the anger, that is, "bad mobile phone signal". This kind of reason that does not appear directly in the text, but people can easily understand the text semantics and combine common sense, we call it a deep-level reason. Identifying deep causes can better reveal the essence of things and guide decision-making more accurately. Therefore, the present invention focuses on the discovery of deep emotional causes, which has important commercial value. On the other hand, since deep causes often do not appear directly in the text, traditional extraction-based methods are difficult to identify. Moreover, deep causes usually involve semantic understanding and common sense reasoning, but machines are not good at understanding and reasoning of abstract knowledge. There is currently a lack of research on this challenging task, and academic research is of great value.

[0004] In the academic field, traditional methods study the independent extraction of emotion causes, or the joint extraction of emotion-cause pairs. The emotion cause extraction task refers to extracting emotion-related fragments or phrases from a given text as causes; the emotion-cause pair extraction task is generally a clause-level extraction, which aims to extract a series of causal sentences from a given document as emotion-cause pairs. However, both types of work belong to shallow emotion recognition. As far as we know, there is no research on the discovery of deep emotion causes.

[0005] For the discovery of emotional causes, traditional technologies can be summarized into three categories, namely rule-based methods based on cause trigger words, statistical machine learning methods, and deep learning-based methods. In the first category of methods, people construct a rule set by observing the language features of the data under the guidance of experience, and then extract emotional expressions and their causes. The statistical method mainly extracts emotional causes by engineering features related to emotional causes, treating the problem of emotional cause extraction as a text classification or sequence labeling problem. This type of method generally assumes that the cause of triggering emotions is one or a series of events, and the emotional cause is near the emotional words. The general process is as follows: first find the meaningful content words in a paragraph, then determine the classification features, such as event features, linguistic features, distance features, lexical features, etc., and finally use these features to complete the classification or sequence labeling of emotional causes. With the widespread application of deep learning in the field of natural language processing, neural network-based methods have been applied to text emotional cause extraction since 2017. The general process is: first map words to vector space; second, use a neural network model to automatically extract text features; finally, use the softmax function to calculate the maximum probability to extract emotional causes. Existing deep extraction models include convolutional neural networks, recurrent neural networks, long short-term memory networks, gated recurrent networks, transformers, graph convolutional networks, etc., which construct more complex and efficient models through combination, deformation, fusion of attention mechanisms, etc. In addition, there are studies that jointly learn sentiment classification and sentiment cause extraction tasks through a multi-task learning framework, or introduce clause relative position information, external knowledge and external sentiment vocabulary to improve the performance of sentiment cause recognition. Among the above methods, the rule method generally recognizes a phrase in the text, and the rules usually contain lexical features or semantic features. However, due to the limited nature of the rules, the coverage and completeness are insufficient. Statistical methods are generally based on feature engineering and rely on large-scale training data, so the disadvantage is that they are overly dependent on feature selection. These features usually require manual design, have weak scalability, and are difficult to handle complex semantic information and logic between sentences. Deep learning methods are still at the stage of identifying and extracting surface cause events, lack a mechanism to discover implicit or deep causes, and are still weak in reasoning ability.

[0006] In the field of patents, there is currently a lack of technology for identifying deep emotional causes. Existing work has mainly focused on extracting shallow causes. CN113486657A assists in the extraction of emotional cause pairs by integrating external knowledge in the word encoding representation stage. Due to insufficient use of knowledge, the judgment of the causal relationship between clauses is still not strong. CN113505583A and CN114065769B use semantic decision graph neural networks and graph attention networks to extract emotional cause clauses respectively; CN114357164A uses an attention module fused with Gaussian priors to extract emotional cause pairs, but the method combines the emotional clause set and the cause clause set using Cartesian products, resulting in high computational cost and low efficiency; CN113988048A proposes to use a multi-round machine reading comprehension method with a reflection mechanism to verify the extracted emotional cause pairs and reduce noise. However, these methods are suitable for identifying shallow causes. Extract fragments or sentences as causes from a given text by sequence annotation or classification. The identification of emotional causes remains at the surface level, ignoring the fact that these surface causes contain deeper causes that have a more causal logical relationship with the generation of emotions. Summary of the invention

[0007] The purpose of the present invention is to provide a method and device for identifying the deep causes of text emotions based on common sense reasoning, which is used to discover the deep causes of emotions contained in the semantics of the text.

[0008] In order to achieve the above object, the present invention provides a method for identifying the deep causes of text emotions based on common sense reasoning, comprising:

[0009] S1. First, extract potential sentiment clauses and potential cause clauses from the sentences in the text, and then construct sentiment clause graph and cause clause graph respectively by taking clauses as nodes and dependencies between clauses as edges; for each node in the sentiment clause graph and cause clause graph, first retrieve common sense, and expand the original graph by adding the retrieved common sense as the adjacent knowledge node of the corresponding node, so as to obtain the expanded sentiment clause graph and cause clause graph;

[0010] S2. For the expanded sentiment clause graph and reason clause graph, the nodes are updated through the calculation of multiple layers of graph attention layers. During the calculation process, the information of the clause context and the corresponding external common sense knowledge are integrated into the node representation to obtain the updated sentiment clause graph and reason clause graph;

[0011] S3. For the updated emotion clause graph and reason clause graph, first filter out the nodes used for combination and pairing, then pair the filtered nodes of the emotion clause graph with the nodes of the reason clause graph to obtain multiple candidate emotion-reason combinations; after obtaining a candidate emotion-reason combination, concatenate the hidden vector representations of the emotion clause graph nodes and the reason clause graph nodes of the candidate combination in the graph structure to obtain a joint representation vector of the candidate combination; then perform multi-head attention interaction calculation on the candidate emotion-reason combination to calculate the emotion-reason vector combination with the highest correlation; decode the vector of the emotion-reason vector combination with the highest correlation to obtain the deep emotion cause.

[0012] As a preferred solution, in step S1, the sentences in the text are preprocessed and segmented, and the obtained words are searched in the sentiment dictionary SentiWordNet, and the clauses in which the words appear in the sentiment dictionary SentiWordNet are regarded as potential sentiment clauses to obtain a set of potential sentiment clauses. And regard all sentences in the text as potential cause clauses to obtain the set of potential cause clauses

[0013] As a preferred solution, the pre-trained model RoBERTa is used to encode all clauses in the text, with the goal of obtaining each clause c i The vector representation v i , in order to better understand and process natural language. Before inputting into RoBERTa, special characters [CLS] and [SEP] are added to the front and back of the clause to mark the beginning and end of the sentence, respectively. Each clause is represented as Among them, w i Indicates the words in a clause.

[0014] As a preferred solution, when generating common sense knowledge for a clause, the clause is replaced with a placeholder, which is used as a prompt to input into the GPT large model. By sampling, a set of common sense descriptions K = {k1, k2, ..., k 10}; Considering that these descriptions may contain noise, they are filtered by point mutual information PMI, which can calculate the clause v i And the correlation between each description k, refer to formula (1),

[0015]

[0016] Because v i and k are sentences, use PrLM to estimate the probability, and use the clause v i As a condition to calculate the mutual information between the common sense description and the clause:

[0017]

[0018] PMI measures the dependency between clauses and knowledge. The greater the correlation, the greater the PMI value. That is, when the PMI score is positive, there is a positive correlation between the two. When the PMI is zero, there is no correlation. When the PMI is negative, the clause and knowledge may be contradictory. This is achieved by retaining only knowledge with a positive PMI score and expanding it into adjacent knowledge nodes of the corresponding clause nodes.

[0019] As a preferred solution, in step S1, the COMET model is used to retrieve common sense related to each clause from the knowledge base; for the cause clause diagram, four types related to causality are used: xIntend, xWant, xNeed, and xEffect, where xIntend describes the intention or purpose behind the behavior; xEffect describes the impact caused by an event or behavior; xWant represents a goal or desire that a person wants to achieve; xNeed represents someone's need or requirement; for the emotion clause diagram, three types related to emotional expression are used: xReact, oReact, and xAttr, where xReact represents one's own or others' feelings and reactions to an event; and xAttr represents an attribute or trait.

[0020] As a preferred solution, we perform emotion recognition on the knowledge generated by COMET in the newly added knowledge nodes, divide the knowledge according to emotion categories, and then select the knowledge that matches the emotion categories in the document, map the emotions to emotion polarity, and use the emotion dictionary SentiWordNet to calculate the emotion score.

[0021] For a piece of common sense knowledge, query the positive score, negative score, and objective score of each word in the sentiment dictionary SentiWordNet, and then calculate the average of the three scores to get r pos ,r neg and r neu . According to formula (3):

[0022]

[0023] Calculate the sentiment score r of this common sense knowledge s , if r s >0 means common sense knowledge is positive, r s <0 is negative, otherwise it is neutral. After calculating all the common sense knowledge emotions, the common sense knowledge is divided into three groups according to the emotions, and the common sense that matches the emotions contained in the input text is selected.

[0024] As a preferred solution, in step S2, for the cause clause graph, the number of nodes n of the expanded cause clause graph is the sum of the number of clauses in the original document and the newly added adjacent knowledge nodes of all nodes.

[0025] Assumptions represents the input node representation of the t-th layer graph attention, For node v i The output of the t-1th layer of is represented by the first layer of graph attention. Each node in the graph is updated by the following aggregation method, as shown in Formula 4:

[0026]

[0027] in, is the output representation, W t and b t is the learning parameter, N(i) represents the node v i Connected neighbors, then, the attention weights can be calculated Used to represent node v i and node v j Relevance

[0028]

[0029]

[0030] Among them, [,;,] is a concatenation operation. By stacking T layers of graph attention layers to model the relationship between sentences, we get the output clause representation of the last layer of graph attention, denoted as h T =(h1,h2,...,h n ) T ∈R n×d .

[0031] As a preferred solution, in step S3, the node screening rules of the sentiment clause graph and the cause clause graph are as follows:

[0032] For the cause clause graph, the nodes of the original document clause are not considered, and only the expanded knowledge nodes are retained to avoid discovering some shallow causes;

[0033] For the sentiment clause graph, only the nodes of the original document clauses in the sentiment clause graph are considered, and the expanded knowledge nodes are not considered;

[0034] Only the extended adjacent knowledge nodes of the reason clause whose relative position with the sentiment clause in the original document is ≤2 are considered, and the extended nodes in the reason clause graph are included in the scope of pairing with the sentiment sentence as an independent reason.

[0035] As a preferred solution, in step S3, the joint representation vector of the candidate combination is

[0036] All candidate combinations are represented as a matrix H = [H1, H2, ..., H N ]∈R t×2d , where t is the number of all candidate emotion-reason combinations that meet the conditions. In order to fully obtain the global information of an emotion-reason combination, a multi-head attention mechanism is used on H, as shown in the following formula (7):

[0037]

[0038] in, N h represents the number of attention heads, d k is the dimension of the multi-head attention hidden layer vector. In order to explicitly introduce relative position information, relative position encoding is added And through the formula For splicing, where W p and b p is the learning parameter;

[0039] The emotion-reason vector combination is decoded by the decoder:

[0040] First, initialize the decoder's hidden state h i sequence, and then calculate the context vector of the decoder at time step t At each time step t, the decoder GRU layer accepts the input vector and obtains the hidden state s at time step t t , the attention distribution is obtained by formulas 8 and 9:

[0041]

[0042]

[0043] Among them, v t , W h , W s and b attn is a learnable parameter. Next, the obtained attention distribution is weighted and summed with the hidden state of the encoder to obtain the context vector Will With s t After concatenation, it is input into two linear layers to obtain the vocabulary distribution P vocab , Among them, V', V, b', b are learnable parameters, P vocab is the probability distribution of all words in the vocabulary;

[0044] For each time step t, the probability of generating a sentence Pgen Through the context vector Decoder status s t and decoder input x t The three get in, b gen is a learnable parameter, σ is the Sigmoid activation function; next, P gen is a soft switch, according to the vocabulary probability P vocab to decide whether to generate words from the vocabulary or according to the attention distribution a t Copy the words from the source text; for the final vocabulary probability distribution, use Equation 10 to express it:

[0045]

[0046] In this formula, if w is a word in the vocabulary, P vocab greater than zero; if w does not appear in the source text, then will be equal to zero; during training, the loss value at time step t is the target word The negative log-likelihood of : The overall loss for the entire sequence is:

[0047] The present invention also provides a device for identifying the deep causes of text emotions based on common sense reasoning, comprising:

[0048] The common sense causal graph construction unit is used to extract potential sentiment clauses and potential cause clauses from sentences in the text, and then construct sentiment clause graphs and cause clause graphs respectively by taking clauses as nodes and dependencies between clauses as edges; for each node in the sentiment clause graph and cause clause graph, common sense is first retrieved, and the retrieved common sense is added as an adjacent knowledge node of the corresponding node to expand the original graph, thereby obtaining the expanded sentiment clause graph and cause clause graph;

[0049] The sentiment semantic graph representation unit is used to update the nodes of the expanded sentiment clause graph and the cause clause graph through the calculation of multiple layers of graph attention layers. During the calculation process, the information of the clause context and the corresponding external common sense knowledge are integrated into the node representation to obtain the updated sentiment clause graph and the cause clause graph.

[0050] The graph interactive reasoning generation unit is used to first screen out the nodes used for combination and pairing of the updated sentiment clause graph and cause clause graph, and then pair the screened nodes of the sentiment clause graph with the nodes of the cause clause graph to obtain multiple candidate sentiment-reason combinations; after obtaining a candidate sentiment-reason combination, the latent vector representations of the sentiment clause graph nodes and the cause clause graph nodes of the candidate combination in the graph structure are concatenated to obtain a joint representation vector of the candidate combination; then, multi-head attention interactive calculations are performed on the candidate sentiment-reason combinations to calculate the sentiment-reason vector combination with the highest correlation; the vector of the sentiment-reason vector combination with the highest correlation is decoded to obtain the deep sentiment cause.

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

[0052] The present invention first identifies the potential emotion clauses and potential cause clauses in the text, and constructs the corresponding emotion clause graph and cause clause graph; then, it retrieves the emotion and causal common sense related to these clauses to expand the graph structure, and obtains two graph neural networks to represent the contextual semantics and common sense knowledge of the emotion and cause graphs respectively; and uses the interactive attention mechanism to find the emotion-cause combination clause pairs with the greatest correlation, and further decodes the deep causes and corresponding emotions with strong causal relationships. Due to the full characterization of the text grammatical structure and the integration of relevant external common sense, the present invention can better decode the deep emotional causes, realize the mining of the potential deep emotional causes behind the surface emotional cause events of the text, and effectively improve the accuracy and reliability of emotional cause inference. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 This is an example graph generated by deep emotional reasons;

[0054] Figure 2 is a flow chart of a method for identifying deep causes of text emotions based on common sense reasoning according to an embodiment of the present invention;

[0055] Figure 3 is a prompt example of common sense knowledge of an embodiment of the present invention;

[0056] Figure 4 is a COMET generation example of an embodiment of the present invention;

[0057] Figure 5 It is a schematic diagram of a device for identifying deep causes of text emotions based on common sense reasoning according to an embodiment of the present invention. DETAILED DESCRIPTION

[0058] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0059] Terminology explanation:

[0060] Common sense reasoning: An important research direction in natural language processing, which aims to help computers learn common sense knowledge shared by most people and use the knowledge they have mastered to achieve in-depth understanding and reasoning.

[0061] Text sentiment: user sentiment categories and related attributes contained in the text.

[0062] Deep-seated causes of emotions: The deep-seated causes of user emotions are summarized and used to infer unobserved causal relationships or new causal hypotheses.

[0063] Embodiment 1

[0064] like Figure 2 As shown, a method for identifying deep causes of text emotions based on common sense reasoning in a preferred embodiment of the present invention includes:

[0065] S1. First, extract potential sentiment clauses and potential cause clauses from the sentences in the text, and then construct sentiment clause graph and cause clause graph respectively by taking clauses as nodes and dependencies between clauses as edges; for each node in the sentiment clause graph and cause clause graph, first retrieve common sense, and expand the original graph by adding the retrieved common sense as the adjacent knowledge node of the corresponding node, so as to obtain the expanded sentiment clause graph and cause clause graph;

[0066] S2. For the expanded sentiment clause graph and reason clause graph, the nodes are updated through the calculation of multiple layers of graph attention layers. During the calculation process, the information of the clause context and the corresponding external common sense knowledge are integrated into the node representation to obtain the updated sentiment clause graph and reason clause graph;

[0067] S3. For the updated emotion clause graph and reason clause graph, first filter out the nodes used for combination and pairing, then pair the filtered nodes of the emotion clause graph with the nodes of the reason clause graph to obtain multiple candidate emotion-reason combinations; after obtaining a candidate emotion-reason combination, concatenate the hidden vector representations of the emotion clause graph nodes and the reason clause graph nodes of the candidate combination in the graph structure to obtain a joint representation vector of the candidate combination; then perform multi-head attention interaction calculation on the candidate emotion-reason combination to calculate the emotion-reason vector combination with the highest correlation; decode the vector of the emotion-reason vector combination with the highest correlation to obtain the deep emotion cause.

[0068] This embodiment first identifies the potential emotion clauses and potential cause clauses in the text, and constructs the corresponding emotion clause graph and cause clause graph; then, retrieves the emotion and causal common sense related to these clauses to expand the graph structure, and obtains two graph neural networks that represent the contextual semantics and common sense knowledge of the emotion and cause graphs respectively; and uses the interactive attention mechanism to find the emotion-cause combination clause pairs with the greatest correlation, and further decodes the deep causes and corresponding emotions with strong causal relationships. Due to the full characterization of the text grammatical structure and the integration of relevant external common sense, this embodiment can better decode the deep emotional causes, realize the mining of the potential deep emotional causes behind the surface emotional cause events of the text, and effectively improve the accuracy and reliability of emotional cause inference.

[0069] Specifically, this method can depict the contextual associations between text sentences, better understand the semantics and emotions of text, and integrate external common sense knowledge for reasoning. This method can achieve causal reasoning with the assistance of graph neural networks and external common sense knowledge, and generate deep emotional reasons. This method can provide better decision support for applications such as psychological counseling, product optimization, and public opinion monitoring. The advantages of this method are as follows:

[0070] 1. Deep reasoning ability: This method can not only discover shallow emotional reasons, but also infer deep emotional reasons. Unlike traditional extractive methods, the generative reason discovery model of this method is more diverse and free in expressing reasons, and can better capture the complex relationships in the text. Compared with extractive methods, this method is more suitable for complex situations. Generating deep emotional reasons can directly express the internal mechanism and essence of the event, so it is more explanatory and persuasive. It can explore more obscure and subtle causal relationships, thereby producing more accurate and reliable prediction results.

[0071] 2. Introducing external common sense knowledge: This method has common sense perception and reasoning capabilities, and not only uses common sense to understand the deep reasons hidden in literal events. These advantages can enable the model to better understand and interpret emotional events, effectively improving the accuracy and reliability of emotional cause inference.

[0072] 3. Stronger application value: Our deep-seated emotion cause discovery device has stronger practicality and promotion value, and can be applied to a variety of emotion analysis scenarios, such as social media monitoring, public opinion analysis, brand management, etc.

[0073] Embodiment 2

[0074] The difference between this embodiment and the first embodiment is that, based on the first embodiment, this embodiment further explains step S1.

[0075] S1. First, potential sentiment clauses and potential cause clauses are extracted from the sentences in the text, and then the sentiment clause graph and cause clause graph are constructed respectively by taking the clauses as nodes and the dependencies between clauses as edges. For each node in the sentiment clause graph and the cause clause graph, common sense is first retrieved, and the retrieved common sense is expanded by adding the adjacent knowledge nodes of the corresponding nodes to obtain the expanded sentiment clause graph and cause clause graph.

[0076] Step S1 constructs an association graph of cause and associated sentiment clauses by analyzing the semantic relations and potential related common sense in a given text.

[0077] Step S1 builds a sentiment clause graph and a cause clause graph, and depicts the logical relationship between text sentences in a fine-grained manner by building a graph, and introduces common sense knowledge that helps sentiment understanding and causal reasoning. Specifically, this step first analyzes the document through a grammatical parser, extracts potential sentiment sentences and potential cause clauses, and then builds the corresponding clause association graph. Subsequently, relevant common sense is retrieved for the graph nodes, and implicit sentiment and common sense information is expanded in this explicit way.

[0078] Clause graph construction: First, extract sentiment clauses and cause clauses from the sentences in the text, and then use sentiment information more finely to support causal reasoning.

[0079] The potential sentiment clauses are obtained by preprocessing the sentences in the input text and searching the obtained words in the sentiment dictionary SentiWordNet. SentiWordNet is a sentiment dictionary widely used in natural language processing, which contains a large number of sentiment words and sentiment polarity scores corresponding to the words. The clauses in which the words appear in the sentiment dictionary are regarded as potential sentiment clauses, and the set of potential sentiment clauses is obtained. Since the cause clause may be the sentiment clause itself or other clauses in the document, all clauses in the text are considered as potential cause clauses to obtain the set of potential cause clauses.

[0080] Then, we learn the representation of the clauses. We use the pre-trained model RoBERTa to encode all the clauses in the text, with the goal of obtaining the c i The vector representation v i , in order to better understand and process natural language. Before inputting into RoBERTa, special characters [CLS] and [SEP] are added to the front and back of the clause to mark the beginning and end of the sentence, respectively. Each clause is represented as Among them, w i Represents the words in the clause. Finally, the sentiment and reason clause graphs are constructed respectively by taking the clauses as nodes and the dependencies between clauses as edges.

[0081] Then, common sense is introduced by extending the graph. Based on the clause graph, this step retrieves relevant common sense to improve causal reasoning ability. One of the most direct sources of common sense is the knowledge graph. However, since the graph is usually limited to fixed relationship categories, the coverage is limited. This embodiment proposes to use a large language model containing a lot of common sense to obtain more complete knowledge. By combining these two knowledge sources, the knowledge gap between events and deep causes can be better bridged, and clues involved in implicit intermediate reasoning steps can be supplemented, thereby helping to discover deep causes. Based on the above construction of each graph node in the sentiment and cause clause graph, common sense is first retrieved, and the original graph is expanded by adding adjacent knowledge nodes to the corresponding clause nodes, so as to achieve the purpose of enriching general common sense information, sentiment information and causal information. The specific method is as follows:

[0082] (a) Large language model: Prompt learning is a technique for extracting the built-in knowledge in a large language model. Prompt sentences can be designed and constructed to guide the large model to generate sentences that meet specific tasks. The large language model has learned a wealth of general language knowledge and world knowledge through pre-training on massive text data. In this step, prompt sentences are designed to allow the large language model GPT to flexibly generate common sense related to the events in the sentence and of unrestricted types for the clause.

[0083] like Figure 3 The common sense knowledge prompt example shown in the figure contains instructions, examples, and placeholders. When generating common sense knowledge for a new clause, the clause replaces the placeholder. This is used as a prompt to input the GPT large model, and a set of common sense descriptions K = {k1, k2, ..., k 10}. Considering that these descriptions may contain noise, they are filtered by pointwise mutual information (PMI). Pointwise mutual information PMI can be used to calculate the clause v i And the correlation between each description k, refer to formula 1.

[0084]

[0085] Because v i and k are sentences, use PrLM to estimate the probability, and use the clause v i As a condition to calculate the mutual information between the common sense description and the clause:

[0086]

[0087] PMI measures the dependency between clauses and knowledge. The greater the correlation, the greater the PMI value. That is, when the PMI score is positive, there is a positive correlation between the two; when the PMI is zero, there is no correlation; when the PMI is negative, the clause and knowledge may be contradictory. We only retain the knowledge with a positive PMI score and expand it into the adjacent knowledge nodes of the corresponding clause nodes.

[0088] (b) Knowledge graph: This embodiment uses the COMET model to retrieve knowledge related to each clause from the knowledge base. The COMET model has been pre-trained on the knowledge graph and contains rich graph knowledge. It can output the associated knowledge of the specified type.

[0089] Considering that social common sense knowledge is conducive to reasoning about the impact, consequences, and emotions of events, it helps to discover the underlying causes. This method uses social common sense knowledge to expand the clause graph. The common sense library is provided by the knowledge graph ATOMIC-2020. In order to facilitate the query of knowledge in ATOMIC-2020, the researchers used the triples in the graph to train a BART-based generative model COMET. COMET takes text and relationship types as input and outputs the corresponding common sense knowledge in the form of short sentences.

[0090] 1. Common sense knowledge related to causality: For the cause clause diagram, this embodiment uses four types related to causality: xIntend, xWant, xNeed, and xEffect. Among them, xIntend describes the intention or purpose behind the behavior; xEffect describes the impact caused by an event or behavior; xWant represents a goal or desire that a person wants to achieve; and xNeed represents a person's need or requirement.

[0091] 2. Emotion-related common sense knowledge: For the emotion clause graph, this embodiment uses three types related to emotion expression: xReact, oReact, and xAttr. Among them, xReact represents one's or others' feelings and reactions to an event; xAttr represents an attribute or trait. Figure 4 An example of generating common sense knowledge through xReact relations is given.

[0092] Considering that the results generated by COMET are noisy, and the underlying reasons are often contained in the input clauses with consistent emotions, this embodiment proposes to filter these noises by emotion type. Specifically, this embodiment performs emotion recognition on the knowledge generated by COMET in the newly added knowledge node, divides the knowledge according to emotion categories, and then selects the knowledge that matches the emotion categories in the document. Emotions are mapped to emotion polarity, and SentiWordNet is used to calculate the emotion score. For a certain common sense knowledge, the positive score, negative score, and objective score of each word in SentiWordNet are queried, and then the average of the three scores is calculated to obtain r pos ,r neg and r neu . Then according to the formula:

[0093]

[0094] Calculate the sentiment score r of this common sense knowledge s , if r s >0 means common sense knowledge is positive, r s <0 is negative, otherwise it is neutral. After calculating all the common sense knowledge sentiments, the common sense knowledge is divided into three groups according to the sentiments, and the matching is selected according to the sentiments contained in the input document.

[0095] The other steps of this embodiment are the same as those of the first embodiment and will not be described again here.

[0096] Embodiment 3 The difference between this embodiment and embodiment 2 is that, based on embodiment 2, this embodiment further explains step S2.

[0097] S2. For the expanded sentiment clause graph and cause clause graph, the nodes are updated through the calculation of multiple layers of graph attention layers. During the calculation process, the information of the clause context and its corresponding external common sense knowledge are incorporated into the node representation to obtain the updated sentiment clause graph and cause clause graph.

[0098] In order to find the most relevant reasons for emotions, this step models the structural knowledge and potential common sense associations in the graph. Specifically, the structural information of the graph is represented by the graph attention layer, and the common sense knowledge and contextual knowledge are fused and represented to calculate the correlation between emotions and reasons.

[0099] The graph interaction attention models the relationship between sentences by stacking multiple layers of graph attention. Taking the cause clause graph as an example, the number of nodes n in the cause graph after knowledge enhancement is the sum of the number of clauses in the original document and the newly added adjacent knowledge nodes of all nodes. Assume represents the input node representation of the t-th layer graph attention, For node v i The output of the t-1th layer is represented by . The input of the first layer of graph attention is Each node in the graph is updated by the following aggregation method, as shown in Formula 4.

[0100]

[0101] in, is the output representation, W t and b t is the learning parameter, N(i) represents the node v i Then, the attention weights can be calculated Used to represent node v i and node v j of relevance.

[0102]

[0103]

[0104] Among them, [,;,] is a concatenation operation. By stacking T layers of graph attention layers to model the relationship between sentences, we get the output clause representation of the last layer of graph attention, denoted as h T =(h1,h2,...,h n ) T ∈R n×d .

[0105] This step updates the graph nodes through the calculation of multiple layers of graph attention layers, and incorporates the information of the clause context and the corresponding external common sense knowledge into the node representation during the calculation process. This can enhance the clause representation ability of the model. At the same time, the common sense knowledge introduced from the outside is fully interacted with the original document clauses, realizing the transfer of knowledge in the graph during the node attention calculation process, thereby assisting the model in understanding semantics. In step S3, the model has sufficient background common sense information and contextual information to infer the deep causes of emotions. The other steps of this embodiment are the same as those of Example 2 and will not be repeated here.

[0106] Embodiment 4 The difference between this embodiment and embodiment 3 is that, based on embodiment 3, this embodiment further explains step S3.

[0107] S3. For the updated emotion clause graph and reason clause graph, first filter out the nodes used for combination and pairing, then pair the filtered nodes of the emotion clause graph with the nodes of the reason clause graph to obtain multiple candidate emotion-reason combinations; after obtaining a candidate emotion-reason combination, concatenate the hidden vector representations of the emotion clause graph nodes and the reason clause graph nodes of the candidate combination in the graph structure to obtain a joint representation vector of the candidate combination; then perform multi-head attention interaction calculation on the candidate emotion-reason combination to calculate the emotion-reason vector combination with the highest correlation; decode the vector of the emotion-reason vector combination with the highest correlation to obtain the deep emotion cause.

[0108] Step S3 first designs rules to select candidate combinations of emotion-cause pairs, and then decodes the deep-level emotion causes based on the combination of emotion sentences and cause sentences represented by the graph. Specifically, firstly, the combination pairing rules of emotion and cause are designed to filter out non-deep causes; then the interactive attention module is used to select combinations with strong causal associations; finally, the cause node representation in the combination is decoded to output the deep-level causes.

[0109] (a) Filtering: Considering that there is a lot of noise in the candidate emotion reason combinations, the filtering rules designed in this embodiment are as follows:

[0110] 1. Considering that deep-level reasons generally do not appear in the original text, for the reason clause graph, the nodes of the original document clauses are not considered, and only the expanded knowledge nodes are retained to avoid discovering some shallow reasons.

[0111] 2. Considering that the emotions corresponding to the deep reasons are generally reflected in the original text, for the sentiment clause graph, only the nodes of the original document clauses in the sentiment clause graph are considered, and the extended knowledge nodes are not considered to ensure the accuracy of the original document's emotional expression.

[0112] 3. In order to explore the potential reasons behind emotions, this module starts from the nodes of the emotion clause graph and combines them with the reason sentences. Considering that emotions and reasons are generally close, we constrain the relative position d between emotions and reason sentences. Only the extended adjacent knowledge nodes of the reason clauses with a relative position d≤2 with the emotion clause in the original document are considered. The extended nodes in the reason graph are included in the scope of pairing with the emotion sentence as an independent reason.

[0113] After obtaining a candidate emotional reason combination, the emotional sentence c of the candidate combination is i With reason c j The hidden vector representations in the graph structure are concatenated to obtain the joint representation vector of the candidate combination

[0114] (b) Interaction: This embodiment performs multi-head attention interaction calculation on candidate emotion-cause pairs to calculate emotion-cause combinations with strong causal relationships. All candidate combinations are represented by the matrix H = [H1, H2, ..., H N ]∈R t×2d . Where t is the number of all candidate emotion-reason combinations that meet the conditions. In order to fully obtain the global information of an emotion-reason combination, this embodiment uses a multi-head attention mechanism on H, as shown in the following formula 7:

[0115]

[0116] in,

[0117] Among them, N h represents the number of attention heads, d k is the dimension of the multi-head attention hidden layer vector. In order to explicitly introduce relative position information, this module adds relative position encoding And through the formula p i,j = For splicing, where W p and b p are the learned parameters.

[0118] (c) Generation: This embodiment is responsible for decoding the most relevant emotion-reason vector combination vector calculated by the above module to obtain the deep emotion reason. The decoder part uses a gated recurrent unit (GRU) based on the attention mechanism. The GRU unit is mainly used to help the model capture contextual information and language structure and generate high-quality text sequences. Specifically, this embodiment first initializes the hidden state h of the decoder i sequence, and then calculate the context vector of the decoder at time step t At each time step t, the decoder GRU layer accepts the input vector and obtains the hidden state s at time step t t , the attention distribution is obtained by formulas 8 and 9:

[0119]

[0120]

[0121] Among them, v t , W h , W s and b attn is a learnable parameter. Next, the obtained attention distribution is weighted and summed with the hidden state of the encoder to obtain the context vector Will With s tAfter concatenation, it is input into two linear layers to obtain the vocabulary distribution P vocab , Among them, V', V, b', b are learnable parameters, P vocab is the probability distribution of all words in the vocabulary.

[0122] For each time step t, the probability of generating a sentence P gen Through the context vector Decoder status s t and decoder input x t The three get in, b gen is a learnable parameter, and σ is the Sigmoid activation function. Next, P gen is a soft switch, according to the vocabulary probability P vocab to decide whether to generate words from the vocabulary or according to the attention distribution a t Copy the words from the source text. For the final vocabulary probability distribution, we use Formula 10 to express it:

[0123]

[0124] In this formula, if w is a word in the vocabulary, P vocab greater than zero; if w does not appear in the source text, then will be equal to zero. During training, the loss value at time step t is the target word The negative log-likelihood of : The overall loss for the entire sequence is:

[0125] In order to avoid repetition in the generated text, we introduce a Coverage mechanism that records the generated content and penalizes repeated content by changing the attention. Specifically, a coverage vector c is defined based on the sum of the attention of all past time steps. t : Where c represents the coverage of these words obtained from the attention mechanism up to time t. The coverage vector is used as an additional input of the attention mechanism and the formula of the coverage vector is replaced by w c is a learnable parameter vector with the same length as v, in such a way that attention does not repeatedly focus on the same position, thus avoiding generating the same content.

[0126] This embodiment defines coverage loss, and when the same position is focused on, it will be penalized: in, is the attention distribution at time t, cov lissBy adding the hyperparameter λ, the final loss function is

[0127] The other steps of this embodiment are the same as those of the third embodiment and will not be described again here.

[0128] Embodiment 5

[0129] like Figure 5 As shown, this embodiment provides a device for identifying the deep causes of text emotions based on common sense reasoning, including:

[0130] The common sense causal graph construction unit is used to extract potential sentiment clauses and potential cause clauses from sentences in the text, and then construct a sentiment clause graph and a cause clause graph respectively by taking clauses as nodes and the dependencies between clauses as edges; for each node in the sentiment clause graph and the cause clause graph, first retrieve the common sense, and then expand the original graph by adding the retrieved common sense as an adjacent knowledge node of the corresponding node to obtain the expanded sentiment clause graph and cause clause graph; the common sense causal graph construction unit is used to implement the above step S1.

[0131] The sentiment semantic graph representation unit is used to update the nodes of the expanded sentiment clause graph and cause clause graph through calculations of multiple layers of graph attention layers. During the calculation process, the clause context information and the corresponding external common sense knowledge information are incorporated into the node representation to obtain the updated sentiment clause graph and cause clause graph. The sentiment semantic graph representation unit is used to implement the above step S2.

[0132] The graph interactive reasoning generation unit is used to first screen out the nodes used for combination and pairing of the updated sentiment clause graph and cause clause graph, and then pair the screened nodes of the sentiment clause graph with the nodes of the cause clause graph to obtain multiple candidate sentiment-reason combinations; after obtaining a candidate sentiment-reason combination, the sentiment clause graph nodes of the candidate combination and the hidden vector representations of the cause clause graph nodes in the graph structure are concatenated to obtain a joint representation vector of the candidate combination; then, multi-head attention interaction calculation is performed on the candidate sentiment-reason combination to calculate the sentiment-reason vector combination with the highest correlation; the vector of the sentiment-reason vector combination with the highest correlation is decoded to obtain the deep sentiment cause; the graph interactive reasoning generation unit is used to implement step S3.

[0133] In summary, the embodiment of the present invention provides a method and device for identifying the deep causes of text emotions based on common sense reasoning, which first identifies potential emotion clauses and potential cause clauses in the text, and constructs corresponding emotion clause graphs and cause clause graphs; then, retrieves the emotions and causal common sense related to these clauses to expand the graph structure, and obtains two graph neural networks that represent the contextual semantics and common sense knowledge of the emotion and cause graphs respectively; and uses the interactive attention mechanism to find the emotion-cause combination clause pair with the greatest correlation, and further decodes the deep causes and corresponding emotions with strong causal relationships. Due to the full characterization of the text grammatical structure and the integration of relevant external common sense, the present invention can better decode the deep emotional causes, realize the mining of the potential deep emotional causes behind the surface emotional cause events of the text, and effectively improve the accuracy and reliability of emotional cause inference.

[0134] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and substitutions can be made without departing from the technical principles of the present invention. These improvements and substitutions should also be regarded as the scope of protection of the present invention.

Claims

1. A method for identifying the underlying causes of text emotions based on common sense reasoning, characterized in that: include: S1. First, extract potential sentiment clauses and potential cause clauses from the sentences in the text, and then construct sentiment clause graph and cause clause graph respectively by taking clauses as nodes and dependencies between clauses as edges; for each node in the sentiment clause graph and cause clause graph, first retrieve common sense, and expand the original graph by adding the retrieved common sense as the adjacent knowledge node of the corresponding node, so as to obtain the expanded sentiment clause graph and cause clause graph; S2. For the expanded sentiment clause graph and reason clause graph, the nodes are updated through the calculation of multiple layers of graph attention layers. During the calculation process, the information of the clause context and the corresponding external common sense knowledge are integrated into the node representation to obtain the updated sentiment clause graph and reason clause graph; S3. For the updated emotion clause graph and reason clause graph, first filter out the nodes used for combination and pairing, then pair the filtered nodes of the emotion clause graph with the nodes of the reason clause graph to obtain multiple candidate emotion-reason combinations; after obtaining a candidate emotion-reason combination, concatenate the hidden vector representations of the emotion clause graph nodes and the reason clause graph nodes of the candidate combination in the graph structure to obtain a joint representation vector of the candidate combination; then perform multi-head attention interaction calculation on the candidate emotion-reason combination to calculate the emotion-reason vector combination with the highest correlation; decode the vector of the emotion-reason vector combination with the highest correlation to obtain the deep emotion cause.

2. The method for identifying the deep causes of text emotions based on common sense reasoning according to claim 1 is characterized in that: In step S1, the sentences in the text are preprocessed and segmented, and the obtained words are searched in the sentiment dictionary SentiWordNet. The clauses in which the words appear in the sentiment dictionary SentiWordNet are regarded as potential sentiment clauses, and the potential sentiment clause set is obtained. And regard all sentences in the text as potential cause clauses to obtain the set of potential cause clauses 3. The method for identifying the deep causes of text emotions based on common sense reasoning according to claim 2 is characterized in that: Use the pre-trained model RoBERTa to encode all clauses in the text, with the goal of obtaining each clause c i The vector representation v i , in order to better understand and process natural language. Before inputting into RoBERTa, special characters [CLS] and [SEP] are added to the front and back of the clause to mark the beginning and end of the sentence, respectively. Each clause is represented as Among them, w i Indicates the words in a clause.

4. The method for identifying the deep causes of text emotions based on common sense reasoning according to claim 3 is characterized in that: When generating common sense knowledge for a clause, the clause is replaced with a placeholder and used as a prompt to input into the GPT large model. Through sampling, a set of common sense descriptions K = {k1, k2, ..., k 10 }; Considering that these descriptions may contain noise, they are filtered by point mutual information PMI, which can calculate the clause v i And the correlation between each description k, refer to formula (1), Because v i and k are sentences, use PrLM to estimate the probability, and use the clauses as conditions to calculate the mutual information between the common sense description and the clauses: PMI measures the dependency between clauses and knowledge. The greater the correlation, the greater the PMI value. That is, when the PMI score is positive, there is a positive correlation between the two. When the PMI is zero, there is no correlation. When the PMI is negative, the clause and knowledge may be contradictory. This is achieved by retaining only knowledge with a positive PMI score and expanding it into adjacent knowledge nodes of the corresponding clause nodes.

5. The method for identifying the deep causes of text emotions based on common sense reasoning according to claim 4 is characterized in that: In step S1, the COMET model is used to retrieve common sense related to each clause from the knowledge base; for the cause clause graph, four types related to causality are used: xIntend, xWant, xNeed, and xEffect, where xIntend describes the intention or purpose behind the behavior; xEffect describes the impact caused by an event or behavior; xWant represents a goal or desire that a person wants to achieve; xNeed represents someone's need or requirement; for the emotion clause graph, three types related to emotional expression are used: xReact, oReact, and xAttr, where xReact represents one's own or others' feelings and reactions to an event; and xAttr represents an attribute or trait.

6. The method for identifying the deep causes of text emotions based on common sense reasoning according to claim 5 is characterized in that: Emotion recognition is performed on the knowledge generated by COMET in the newly added knowledge node. The knowledge is divided according to the emotion category, and then the knowledge that matches the emotion category in the document is selected. The emotion is mapped to the emotion polarity, and the emotion dictionary SentiWordNet is used to calculate the emotion score. For a piece of common sense knowledge, query the positive score, negative score, and objective score of each word in the sentiment dictionary SentiWordNet, and then calculate the average of the three scores to get r pos ,r neg and r neu . According to formula (3): Calculate the sentiment score r of this common sense knowledge s , if r s >0 means common sense knowledge is positive, r f <0 is negative, otherwise it is neutral. After calculating all the common sense knowledge emotions, the common sense knowledge is divided into three groups according to the emotions, and the common sense that matches the emotions contained in the input text is selected.

7. The method for identifying the deep causes of text emotions based on common sense reasoning according to claim 6 is characterized in that: In step S2, for the reason clause graph, the number of nodes n in the expanded reason clause graph is the sum of the number of clauses in the original document and the newly added adjacent knowledge nodes of all nodes. Assumptions represents the input node representation of the t-th layer graph attention, For node v i The output of the t-1th layer of is represented by the first layer of graph attention. Each node in the graph is updated by the following aggregation method, as shown in Formula 4: in, is the output representation, W t and b t is the learning parameter, N(i) represents the node v i Connected neighbors, then, the attention weights can be calculated Used to represent node v i and node v j Relevance Among them, [,;,] is a concatenation operation. By stacking T layers of graph attention layers to model the relationship between sentences, we get the output clause representation of the last layer of graph attention, denoted as h T =(h1,h2,...,h n ) T ∈R n×d .

8. The method for identifying the deep causes of text emotions based on common sense reasoning according to claim 7 is characterized in that: In step S3, the node screening rules of the sentiment clause graph and the cause clause graph are as follows: For the cause clause graph, the nodes of the original document clause are not considered, and only the expanded knowledge nodes are retained to avoid discovering some shallow causes; For the sentiment clause graph, only the nodes of the original document clauses in the sentiment clause graph are considered, and the expanded knowledge nodes are not considered; Only the extended adjacent knowledge nodes of the reason clause whose relative position with the sentiment clause in the original document is ≤2 are considered, and the extended nodes in the reason clause graph are included in the scope of pairing with the sentiment sentence as an independent reason.

9. The method for identifying the deep causes of text emotions based on common sense reasoning according to claim 8, characterized in that: In step S3, the joint representation vector of the candidate combination is All candidate combinations are represented as a matrix H = [H1, H2, ..., H N ]∈R t×2d , where t is the number of all candidate emotion-reason combinations that meet the conditions. In order to fully obtain the global information of an emotion-reason combination, a multi-head attention mechanism is used on H, as shown in the following formula (7): in, N h represents the number of attention heads, d k is the dimension of the multi-head attention hidden layer vector. In order to explicitly introduce relative position information, relative position encoding is added And through the formula For splicing, where W p and b p is the learning parameter; The emotion-reason vector combination is decoded by the decoder: First, initialize the decoder's hidden state h i sequence, and then calculate the context vector of the decoder at time step t At each time step t, the decoder GRU layer accepts the input vector and obtains the hidden state s at time step t t , the attention distribution is obtained by formulas 8 and 9: α t =Softmax(e t ) Formula (9) Among them, v t , W h , W s and b attn is a learnable parameter. Next, the obtained attention distribution is weighted and summed with the hidden state of the encoder to obtain the context vector Will With s t After concatenation, it is input into two linear layers to obtain the vocabulary distribution P vocab , Among them, V', V, b', b are learnable parameters, P vocab is the probability distribution of all words in the vocabulary; For each time step t, the probability of generating a sentence P gen Through the context vector Decoder status s t and decoder input x t The three get in, b gen is a learnable parameter, σ is the Sigmoid activation function; next, P gen is a soft switch, according to the vocabulary probability P vocab to decide whether to generate words from the vocabulary or according to the attention distribution a t Copy the words from the source text; for the final vocabulary probability distribution, use Equation 10 to express it: In this formula, if w is a word in the vocabulary, P vocab greater than zero; if w does not appear in the source text, then will be equal to zero; during training, the loss value at time step t is the target word The negative log-likelihood of : The overall loss for the entire sequence is:

10. A device for identifying the underlying causes of text emotions based on common sense reasoning, characterized in that: include: The common sense causal graph construction unit is used to extract potential sentiment clauses and potential cause clauses from sentences in the text, and then construct sentiment clause graphs and cause clause graphs respectively by taking clauses as nodes and dependencies between clauses as edges; for each node in the sentiment clause graph and cause clause graph, common sense is first retrieved, and the retrieved common sense is added as an adjacent knowledge node of the corresponding node to expand the original graph, thereby obtaining the expanded sentiment clause graph and cause clause graph; The sentiment semantic graph representation unit is used to update the nodes of the expanded sentiment clause graph and the cause clause graph through the calculation of multiple layers of graph attention layers. During the calculation process, the information of the clause context and the corresponding external common sense knowledge are integrated into the node representation to obtain the updated sentiment clause graph and the cause clause graph. The graph interactive reasoning generation unit is used to first screen out the nodes used for combination and pairing of the updated sentiment clause graph and cause clause graph, and then pair the screened nodes of the sentiment clause graph with the nodes of the cause clause graph to obtain multiple candidate sentiment-reason combinations; after obtaining a candidate sentiment-reason combination, the latent vector representations of the sentiment clause graph nodes and the cause clause graph nodes of the candidate combination in the graph structure are concatenated to obtain a joint representation vector of the candidate combination; then, multi-head attention interactive calculations are performed on the candidate sentiment-reason combinations to calculate the sentiment-reason vector combination with the highest correlation; the vector of the sentiment-reason vector combination with the highest correlation is decoded to obtain the deep sentiment cause.

Citation Information

Patent Citations

  • Knowledge assistance-based emotion-reason pair extraction system

    CN113486657A

  • Emotion cause clause pair extraction method based on semantic decision graph neural network

    CN113505583A

  • Emotional reason pair extraction method based on multi-round machine reading and understanding

    CN113988048A

  • Emotional factors influence the training methods, devices, equipment, and media of extraction models.

    CN114065769B

  • Emotion-reason pair extraction method, device and equipment and readable storage medium

    CN114357164A

Cited By

  • Multi-modal emotion recognition method based on graph dynamic fusion and mutual information maximization

    CN121302288A

  • A multimodal emotion recognition method based on graph dynamic fusion and mutual information maximization

    CN121302288B

  • Emotion reason fragment identification method and device

    CN122287649A

  • A method and apparatus for identifying an emotional cause segment

    CN122287649B