Intention reasoning method and apparatus
Patent Information
- Application Number
- CN202111627755.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2041-12-28
AI Technical Summary
[0004]鉴于此,本发明提出了一种意图推理方法及装置,旨在解决现有相关技术无法深度理解文本信息以及准确地进行意图推理
[0018] The intention reasoning method and apparatus provided in this invention combine reasoning graphs with emotion knowledge, enabling the calculation of user emotions and understanding the reasons for those emotions. This allows for more accurate intention reasoning and the generation of strategies that both soothe users and evoke empathy. The method and apparatus can be used in precision marketing, social networks, and customer service quality management, and are of great significance to the final decision-making of human-computer interaction systems.
Smart Images

Figure CN114492391B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and more specifically, to an intention reasoning method and apparatus. Background Technology
[0002] Human-computer dialogue is a core area of human-computer interaction technology, aiming to mimic human-to-human conversations as closely as possible, enabling humans to communicate with machines in a more natural way. It represents a new type of interaction between humans and machines. Human-computer dialogue first requires understanding what the user mainly said, how they said it, and the logical flow of the dialogue. Then, by leveraging an understanding of the business and data analysis of the dialogue text, a semantic understanding definition of the user's speech is abstracted—this is the semantic understanding module.
[0003] Intent recognition is a crucial subtask of natural language understanding in dialogue systems. The accuracy of intent recognition directly impacts subsequent decision-making within the dialogue system. Currently, most intent recognition methods based on event graphs infer intent by analyzing relationships between events, thus only capturing partial user intent and enabling simple communication aimed at completing a task. Summary of the Invention
[0004] In view of this, the present invention proposes an intention reasoning method and apparatus, which aims to solve the problem that existing related technologies cannot deeply understand text information and accurately perform intention reasoning.
[0005] In a first aspect, embodiments of the present invention provide an intention reasoning method, comprising: acquiring text data; classifying the text data into emotions to obtain emotion-classified text data; extracting causal relationships from the emotion-classified text data to obtain causal relationship event tuple pairs; establishing a reasoning graph based on the causal relationship event tuple pairs; inferring the emotion level based on the reasoning graph; and performing intention reasoning based on the emotion level.
[0006] Furthermore, the step of classifying the text data by emotion to obtain emotion-classified text data includes: using a text emotion classification model to identify the emotion information of the text data, and classifying the text data into three categories: positive, negative, and neutral based on the emotion information.
[0007] Furthermore, the step of extracting causal relationships from the emotion classification text data to obtain causal event tuple pairs includes: determining whether the emotion classification text data contains causal cue words; if it contains causal cue words, then performing explicit causal relationship extraction to obtain explicit causal event pairs; otherwise, performing implicit causal relationship extraction to obtain implicit causal event pairs; and merging the explicit causal event pairs and the implicit causal event pairs to obtain causal event tuple pairs.
[0008] Furthermore, the step of establishing a causal graph based on the causal event tuple pairs includes: forming causal chains based on the causal event tuple pairs; calculating causal transition probabilities based on the causal chains; and generating a causal graph graphic based on the causal chains and the causal transition probabilities to represent the event node construction of the causal event tuple pairs and the causal relationships between events.
[0009] Furthermore, the step of inferring the emotion level based on the reasoning graph includes: calculating the emotion level based on the path length and corresponding transition probability in the reasoning graph.
[0010] Furthermore, the intention reasoning based on the emotion level includes: invoking a pre-built intention reasoning strategy based on the emotion level to perform intention reasoning in order to obtain more potential dialogue intentions.
[0011] Secondly, embodiments of the present invention also provide an intent reasoning device, comprising: a text acquisition unit for a user to acquire text data; an emotion classification unit for classifying the text data into emotions to obtain emotion-classified text data; a causal relationship extraction unit for extracting causal relationships from the emotion-classified text data to obtain causal relationship event tuple pairs; a reasoning graph unit for establishing a reasoning graph based on the causal relationship event tuple pairs; an emotion level inference unit for inferring the emotion level based on the reasoning graph; and an intent reasoning unit for performing intent reasoning based on the emotion level.
[0012] Furthermore, the emotion classification unit is also used to: identify the emotion information of the text data using a text emotion classification model, and classify the text data into three categories: positive, negative, and neutral based on the emotion information.
[0013] Furthermore, the causal relationship extraction unit is also used to: determine whether the emotion classification text data contains causal prompt words; if it contains causal prompt words, then perform explicit causal relationship extraction to obtain explicit causal relationship event pairs; otherwise, perform implicit causal relationship extraction to obtain implicit causal relationship event pairs; and merge the explicit causal relationship event pairs and the implicit causal relationship event pairs to obtain causal relationship event tuple pairs.
[0014] Furthermore, the event graph unit is also used to: form a causal chain based on the causal event tuple pairs; calculate the causal transition probability based on the causal chain; and generate an event graph based on the causal chain and the causal transition probability to represent the event node construction of the causal event tuple pairs and the causal relationship between events.
[0015] Furthermore, the emotion level inference unit is also used to calculate the emotion level based on the path length and corresponding transition probability in the reasoning graph.
[0016] Furthermore, the intent reasoning unit is also used to invoke a pre-built intent reasoning strategy to perform intent reasoning based on the emotion level, so as to obtain more potential dialogue intents.
[0017] Thirdly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, characterized in that the program, when executed by a processor, implements the methods provided in the embodiments of the present invention.
[0018] The intention reasoning method and apparatus provided in this invention combine reasoning graphs with emotion knowledge, enabling the calculation of user emotions and understanding the reasons for those emotions. This allows for more accurate intention reasoning and the generation of strategies that both soothe users and evoke empathy. The method and apparatus can be used in precision marketing, social networks, and customer service quality management, and are of great significance to the final decision-making of human-computer interaction systems. Attached Figure Description
[0019] Figure 1 A flowchart of an intent reasoning method provided as an exemplary embodiment of the present invention; Figure 2 A schematic diagram illustrating event generalization provided as an exemplary embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an intent reasoning device provided as an exemplary embodiment of the present invention. Detailed Implementation
[0020] Detailed embodiments are now described with reference to the accompanying drawings. However, the invention can be embodied in many different forms and is not limited to the embodiments described herein. These embodiments are provided to fully and completely disclose the invention and to fully convey its scope to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the drawings is not intended to limit the invention. In the drawings, the same units / elements are referred to by the same reference numerals.
[0021] Unless otherwise stated, the terms used herein (including technical terms) have their common meaning as understood by one of ordinary skill in the art. Furthermore, it is understood that terms defined in commonly used dictionaries should be understood to have a meaning consistent with the context of their relevant field, and not to be interpreted as having an idealized or overly formal meaning.
[0022] Emotion and intention may seem like two different concepts, but they are related in many ways. For example, a user's emotions and feelings towards a certain product are directly related to their decision to buy it. First, a user's intention is revealed through expressing emotions, such as "I really want to like this movie!", which expresses the intention to "watch the movie" by expressing liking the film. Second, when a user strongly desires to buy a product, it usually expresses positive emotions and feelings towards the product, such as "I want to buy a computer!", which expresses the user's expectation of a computer and indicates that the user has a good impression of computers. Third, users can express emotions through intentions, such as "I'm going to smash my phone, it's so laggy!", where the intention to "smash the phone" expresses the user's anger and dislike. This indicates a possible behavior and also implies the user's intention to repair the phone or buy a new one.
[0023] Emotion recognition often relies on emotional keywords, interjections, or punctuation marks. Such methods only understand the intensity of a user's emotion, not the reason behind it, and fail to evoke empathy. Furthermore, when users lack explicit emotional expression, dialogue systems struggle to capture it. Therefore, this invention combines event graphs with emotion knowledge, aligning events with user descriptions and graph paths. This allows for the calculation of user emotions while simultaneously understanding the reasons behind them, resulting in strategies that both soothe the user and evoke empathy. These strategies can be applied in precision marketing, social networks, and customer service quality management, and are of significant importance to the final decision-making of human-computer interaction systems.
[0024] Figure 1 A flowchart of an intent reasoning method provided as an exemplary embodiment of the present invention.
[0025] like Figure 1 As shown, the method includes: Step S101: Obtain text data.
[0026] In this embodiment of the invention, session extraction is performed on the raw information of the network platform to extract an information stream containing one or more short texts. A web crawler is written in Python to crawl data related to the events. The crawled raw data is preprocessed, including deduplication, word segmentation, part-of-speech tagging, and dependency parsing, to obtain file data for intent reasoning.
[0027] Step S102: Classify the text data by emotion to obtain emotion-classified text data.
[0028] Further, step S102 includes: A text sentiment classification model is used to identify the sentiment information in the text data, and the text data is divided into three categories: positive, negative, and neutral based on the sentiment information.
[0029] In this embodiment of the invention, the text information can first be converted into a vector matrix to facilitate feature extraction in the next step. The conversion model can be the widely used Word2vec model. Then, the features are input into a text classification model for emotion classification, and the text is divided into three emotion categories: positive, negative, and neutral, based on the emotion information. , and Commonly used text classification models include TextCNN, LSTM, BiLSTM, and Transformer.
[0030] Step S103: Extract causal relationships from the emotion classification text data to obtain causal event tuple pairs.
[0031] In this embodiment of the invention, non-empty validation can be performed on each field of the first information.
[0032] Further, step S103 includes: Determine whether the sentiment classification text data contains causal cue words; If causal prompts are included, explicit causal relationships are extracted to obtain explicit causal event pairs. Otherwise, implicit causal relationships are extracted to obtain implicit causal event pairs; By merging explicit causal event pairs and implicit causal event pairs, we obtain causal event tuple pairs.
[0033] In this embodiment of the invention, causal relationship extraction is an important prerequisite for causal relationship analysis and is the foundation and core work for constructing a causal graph. Based on whether a sentence contains causal cue words, causal relationships are divided into explicit causal relationships and implicit causal relationships; therefore, causal relationship extraction involves two parts.
[0034] Determining whether a sentence contains causal indicator words requires sentence segmentation and word segmentation. Especially in word segmentation, a custom-designed specialized lexicon can be used to ensure accuracy. If a sentence contains causal indicator words, it is considered an explicit causal sentence, and causal event pairs are extracted using explicit causal relationship extraction methods. Otherwise, implicit causal relationship extraction methods are used.
[0035] Explicit causal relationship extraction is performed as follows: Explicit causal relationship extraction adopts a pattern matching-based method, mainly including the extraction of causal relationship clauses and the extraction of event tuples in the clauses. The input is an explicit causal sentence. First, the cause clause and result clause in the sentence are extracted according to the syntactic pattern and matching rules. Then, the events described by the cause clause and result clause are extracted in a structured form, i.e., presented as {event, relation, event}, ultimately forming event pairs with causal relationships.
[0036] Implicit causal relationship extraction is performed as follows: The difference between implicit and explicit causal relationship extraction lies in the fact that the boundary between the cause and effect parts cannot be determined in implicit causal sentences. Therefore, the extraction process differs from that of explicit causal relationships. Implicit causal relationship extraction first extracts the event tuples contained in the text, and then determines whether a causal relationship exists between any two event tuples. In this embodiment, implicit causal relationship extraction uses a machine learning-based method, such as the self-attention mechanism proposed by the Google Machine Translation team. This mechanism ignores the distance between words and directly calculates dependencies, enabling it to better learn the internal structure of sentences and obtain implicit causal event pairs.
[0037] Specifically, the implicit causal event pairs can be obtained using the BERT (bidirectional encoder representations from transformers) model as follows: First, the input sentence is transformed into a feature vector using word embedding methods such as Word2V; then, the feature vector is used as the input to the BERT model, which captures forward and backward semantic information and extracts high-level features; the high-level features are then input into a conditional random field (CRF) layer to output the final prediction result, which is the optimal causal label sequence, effectively extracting causal event pairs.
[0038] Finally, explicit causal event pairs and implicit causal event pairs are merged to form causal event tuple pairs.
[0039] Step S104: Establish a causal relationship event tuple pair to construct a causal graph.
[0040] Further, step S104 includes: A causal chain is formed based on pairs of causal event tuples. Calculate the probability of causal transition based on the causal chain; Based on causal chains and causal transition probabilities, a causal graph is generated to represent the construction of event nodes in causal event tuple pairs and the causal relationships between events.
[0041] Furthermore, based on the causal event tuples, a causal chain is formed, including: The language used to describe the same event can vary, meaning there are different wordings referring to the same event. Therefore, the extracted causal relationships may appear to be sets of relatively independent causal event pairs, but in reality, these pairs are interconnected. By unifying the semantic and textual expressions of these causal event pairs—that is, by generalizing the events—independent causal event pairs are linked into causal chains through the consistency of cause and effect events.
[0042] The key to the formation of causal chains is the generalization of causal event pairs. Figure 2 This is a schematic diagram illustrating event generalization provided as an exemplary embodiment of the present invention. (As shown...) Figure 2 As shown, event generalization, also known as coreference resolution in natural language processing, refers to the normalization of different textual descriptions of the same entity in the real world, which increases the ambiguity in the event graph and more comprehensively shows the causal relationship of the event.
[0043] The core of event generalization is to calculate the semantic similarity between two events. In this embodiment of the invention, the semantic similarity calculation method can be one of the following two types: (1) calculating semantic similarity by statistically analyzing the probability distribution of word context in the corpus, and (2) calculating semantic similarity between words by analyzing the hierarchical structure of the semantic dictionary. Preferably, the dictionary-based semantic similarity calculation method is adopted because this method is simple, effective and can intuitively calculate the semantic similarity between words. The process of calculating semantic similarity between words based on HowNet is as follows: (1) calculating semantic primitive similarity, (2) calculating semantic item similarity, and (3) calculating word similarity. Among them, HowNet is a common sense knowledge base that uses the concepts (senses) represented by Chinese and English words as the description object and reveals the relationship between concepts and the attributes of concepts as the basic content. It is a large Chinese-English dictionary. In HowNet, each word contains several concepts (senses), and the concepts (senses) are defined by semantic primitives. There are up to 16 kinds of relationships between semantic primitives.
[0044] Furthermore, based on the causal chain, the probability of causal transition is calculated, including: The next step in creating a cyclic graph of events is to determine the transition probabilities between events, which are used to measure the likelihood of the event's subsequent development.
[0045] After generalization, events can be represented at a higher level, showing the relationships between them. Using the generalized events as nodes and the relationships between these nodes as edges, a logic graph is constructed. This logic graph can be represented as follows: ,in, It is a collection of events, events , It is a set of edges. and These represent the number of events and the number of edges, respectively. In this embodiment of the invention, events are used. , The number of co-occurrences measures the degree of association between two events, i.e., each Both are directed edges weight This weight is the causal transition probability, which can be calculated using the following formula: ; in, Indicates an event , The number of times they co-occur.
[0046] Furthermore, based on causal chains and causal transition probabilities, a causal graph is generated to represent the construction of event nodes in causal event tuple pairs and the causal relationships between events, including: The modeling definition of an event graph is a representation of {event, relation, event}. Based on the extracted events and the causal relationships between them, the event graph is constructed using causal events and result events as nodes, and the relationships between causal events and result events as directed edges. The Python Networkx package is used to generate the graphical representation of the event graph. By constructing event nodes from causal event tuples and representing the causal relationships between events, a graphical representation of the event graph is obtained.
[0047] Step S105: Infer the emotional level based on the reasoning graph.
[0048] Further, step S105 includes: The emotion level is calculated based on the path length and corresponding transition probability in the reasoning graph.
[0049] Based on the initial event's emotion category (emo, positive, negative, neutral), and based on the path length in the event graph... and the corresponding transition probability w Calculate the current mood level The specific formula is as follows: ; It can be seen that the longer the path, the greater the absolute value of the emotion level.
[0050] Step S106: Infer intent based on emotion level.
[0051] Further, step S106 includes: Based on the emotion level, a pre-built intention reasoning strategy is invoked to infer intentions in order to obtain more potential dialogue intentions.
[0052] Intent inference is performed based on emotion levels. After identifying the user's intent, the emotion level is used to infer the user's intent and obtain more potential dialogue intentions. Intent inference strategies can be pre-set by professionals according to different scenarios. For example, the table below shows a simple strategy example.
[0053] The above embodiments, by combining reasoning graphs with emotion knowledge, can calculate user emotions and understand the reasons for those emotions, thereby enabling more accurate intent reasoning and yielding strategies that both soothe users and evoke empathy. These strategies can be applied in fields such as precision marketing, social networks, and customer service quality management, and are of great significance to the final decision-making of human-computer interaction systems.
[0054] Figure 3 This is a schematic diagram of the structure of an intent reasoning device provided as an exemplary embodiment of the present invention.
[0055] like Figure 3 As shown, the device includes: The text acquisition unit 301 is used to acquire text data.
[0056] In this embodiment of the invention, session extraction is performed on the raw information of the network platform to extract an information stream containing one or more short texts. A web crawler is written in Python to crawl data related to the events. The crawled raw data is preprocessed, including deduplication, word segmentation, part-of-speech tagging, and dependency parsing, to obtain file data for intent reasoning.
[0057] The emotion classification unit 302 is used to classify text data into emotions to obtain emotion-classified text data.
[0058] Furthermore, the emotion classification unit 302 is also used for: A text sentiment classification model is used to identify the sentiment information in the text data, and the text data is divided into three categories: positive, negative, and neutral based on the sentiment information.
[0059] In this embodiment of the invention, the text information can first be converted into a vector matrix to facilitate feature extraction in the next step. The conversion model can be the widely used Word2vec model. Then, the features are input into a text classification model for emotion classification, and the text is divided into three emotion categories: positive, negative, and neutral, based on the emotion information. , and Commonly used text classification models include TextCNN, LSTM, BiLSTM, and Transformer.
[0060] The causal relationship extraction unit 303 is used to extract causal relationships from the emotion classification text data to obtain causal relationship event tuple pairs.
[0061] In this embodiment of the invention, non-empty validation can be performed on each field of the first information.
[0062] Furthermore, the causal relationship extraction unit 303 is also used for: Determine whether the sentiment classification text data contains causal cue words; If causal prompts are included, explicit causal relationships are extracted to obtain explicit causal event pairs. Otherwise, implicit causal relationships are extracted to obtain implicit causal event pairs; By merging explicit causal event pairs and implicit causal event pairs, we obtain causal event tuple pairs.
[0063] In this embodiment of the invention, causal relationship extraction is an important prerequisite for causal relationship analysis and is the foundation and core work for constructing a causal graph. Based on whether a sentence contains causal cue words, causal relationships are divided into explicit causal relationships and implicit causal relationships; therefore, causal relationship extraction involves two parts.
[0064] Determining whether a sentence contains causal indicator words requires sentence segmentation and word segmentation. Especially in word segmentation, a custom-designed specialized lexicon can be used to ensure accuracy. If a sentence contains causal indicator words, it is considered an explicit causal sentence, and causal event pairs are extracted using explicit causal relationship extraction methods. Otherwise, implicit causal relationship extraction methods are used.
[0065] Explicit causal relationship extraction is performed as follows: Explicit causal relationship extraction adopts a pattern matching-based method, mainly including the extraction of causal relationship clauses and the extraction of event tuples in the clauses. The input is an explicit causal sentence. First, the cause clause and result clause in the sentence are extracted according to the syntactic pattern and matching rules. Then, the events described by the cause clause and result clause are extracted in a structured form, i.e., presented as {event, relation, event}, ultimately forming event pairs with causal relationships.
[0066] Implicit causal relationship extraction is performed as follows: The difference between implicit and explicit causal relationship extraction lies in the fact that the boundary between the cause and effect parts cannot be determined in implicit causal sentences. Therefore, the extraction process differs from that of explicit causal relationships. Implicit causal relationship extraction first extracts the event tuples contained in the text, and then determines whether a causal relationship exists between any two event tuples. In this embodiment, implicit causal relationship extraction uses a machine learning-based method, such as the self-attention mechanism proposed by the Google Machine Translation team. This mechanism ignores the distance between words and directly calculates dependencies, enabling it to better learn the internal structure of sentences and obtain implicit causal event pairs.
[0067] Specifically, the implicit causal event pairs can be obtained using the BERT (bidirectional encoder representations from transformers) model as follows: First, the input sentence is transformed into a feature vector using word embedding methods such as Word2V; then, the feature vector is used as the input to the BERT model, which captures forward and backward semantic information and extracts high-level features; the high-level features are then input into a conditional random field (CRF) layer to output the final prediction result, which is the optimal causal label sequence, effectively extracting causal event pairs.
[0068] Finally, explicit causal event pairs and implicit causal event pairs are merged to form causal event tuple pairs.
[0069] Event graph unit 304 is used to build an event graph based on event tuple pairs with causal relationships.
[0070] Furthermore, the principle graph unit 304 is also used for: A causal chain is formed based on pairs of causal event tuples. Calculate the probability of causal transition based on the causal chain; Based on causal chains and causal transition probabilities, a causal graph is generated to represent the construction of event nodes in causal event tuple pairs and the causal relationships between events.
[0071] Furthermore, based on the causal event tuples, a causal chain is formed, including: The language used to describe the same event can vary, meaning there are different wordings referring to the same event. Therefore, the extracted causal relationships may appear to be sets of relatively independent causal event pairs, but in reality, these pairs are interconnected. By unifying the semantic and textual expressions of these causal event pairs—that is, by generalizing the events—independent causal event pairs are linked into causal chains through the consistency of cause and effect events.
[0072] The key to the formation of causal chains is the generalization of causal event pairs. Figure 2 This is a schematic diagram illustrating event generalization provided as an exemplary embodiment of the present invention. (As shown...) Figure 2 As shown, event generalization, also known as coreference resolution in natural language processing, refers to the normalization of different textual descriptions of the same entity in the real world, which increases the ambiguity in the event graph and more comprehensively shows the causal relationship of the event.
[0073] The core of event generalization is to calculate the semantic similarity between two events. In this embodiment of the invention, the semantic similarity calculation method can be one of the following two types: (1) calculating semantic similarity by statistically analyzing the probability distribution of word context in the corpus, and (2) calculating semantic similarity between words by analyzing the hierarchical structure of the semantic dictionary. Preferably, the dictionary-based semantic similarity calculation method is adopted because this method is simple, effective and can intuitively calculate the semantic similarity between words. The process of calculating semantic similarity between words based on HowNet is as follows: (1) calculating semantic primitive similarity, (2) calculating semantic item similarity, and (3) calculating word similarity. Among them, HowNet is a common sense knowledge base that uses the concepts (senses) represented by Chinese and English words as the description object and reveals the relationship between concepts and the attributes of concepts as the basic content. It is a large Chinese-English dictionary. In HowNet, each word contains several concepts (senses), and the concepts (senses) are defined by semantic primitives. There are up to 16 kinds of relationships between semantic primitives.
[0074] Furthermore, based on the causal chain, the probability of causal transition is calculated, including: The next step in creating a cyclic graph of events is to determine the transition probabilities between events, which are used to measure the likelihood of the event's subsequent development.
[0075] After generalization, events can be represented at a higher level, showing the relationships between them. Using the generalized events as nodes and the relationships between these nodes as edges, a logic graph is constructed. This logic graph can be represented as follows: ,in, It is a collection of events, events , It is a set of edges. and These represent the number of events and the number of edges, respectively. In this embodiment of the invention, events are used. , The number of co-occurrences measures the degree of association between two events, i.e., each Both are directed edges weight This weight is the causal transition probability, which can be calculated using the following formula: ; in, Indicates an event , The number of times they co-occur.
[0076] Furthermore, based on causal chains and causal transition probabilities, a causal graph is generated to represent the construction of event nodes in causal event tuple pairs and the causal relationships between events, including: The modeling definition of an event graph is a representation of {event, relation, event}. Based on the extracted events and the causal relationships between them, the event graph is constructed using causal events and result events as nodes, and the relationships between causal events and result events as directed edges. The Python Networkx package is used to generate the graphical representation of the event graph. By constructing event nodes from causal event tuples and representing the causal relationships between events, a graphical representation of the event graph is obtained.
[0077] The emotion level inference unit 305 is used to infer the emotion level based on the reasoning graph.
[0078] Furthermore, the emotion level inference unit 305 is also used for: The emotion level is calculated based on the path length and corresponding transition probability in the reasoning graph.
[0079] Based on the initial event's emotion category (emo, positive, negative, neutral), and based on the path length in the event graph... and the corresponding transition probability w Calculate the current mood level The specific formula is as follows: ; It can be seen that the longer the path, the greater the absolute value of the emotion level.
[0080] Intention reasoning unit 306 is used to reason about intentions based on emotion levels.
[0081] Furthermore, the intention reasoning unit 306 is also used for: Based on the emotion level, a pre-built intention reasoning strategy is invoked to infer intentions in order to obtain more potential dialogue intentions.
[0082] Intent inference is performed based on emotion levels. After identifying the user's intent, the emotion level is used to infer the user's intent and obtain more potential dialogue intentions. Intent inference strategies can be pre-set by professionals according to different scenarios. For example, the table below shows a simple strategy example.
[0083] The above embodiments, by combining reasoning graphs with emotion knowledge, can calculate user emotions and understand the reasons for those emotions, thereby enabling more accurate intent reasoning and yielding strategies that both soothe users and evoke empathy. These strategies can be applied in fields such as precision marketing, social networks, and customer service quality management, and are of great significance to the final decision-making of human-computer interaction systems.
[0084] The present invention also provides a computer-readable storage medium storing one or more programs that, when executed by one or more processors, implement any of the above-described intent reasoning methods.
[0085] The invention has been described with reference to a few embodiments. However, as will be known to those skilled in the art, and as defined in the appended claims, other embodiments besides those disclosed above fall equivalently within the scope of the invention.
[0086] Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the art, unless otherwise expressly defined herein. All references to “a / the / the [device, component, etc.]” are openly interpreted as at least one instance of said device, component, etc., unless otherwise expressly stated. The steps of any method disclosed herein need not be performed in the exact order disclosed unless explicitly stated otherwise.
[0087] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0088] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0089] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0090] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. An intention reasoning method, characterized in that, The method includes: Get text data; The text data is classified into sentiment categories to obtain sentiment-categorized text data. The causal relationships are extracted from the emotion classification text data to obtain causal relationship event tuples; Based on the causal event tuple pairs, construct a causal graph; Infer the emotion level based on the aforementioned reasoning graph; Intention inference is made based on the stated emotion level; The step of inferring the emotion level based on the reasoning graph includes: The emotion level is calculated based on the path length and corresponding transition probability in the aforementioned reasoning graph.
2. The method according to claim 1, characterized in that, The step of classifying the text data by emotion to obtain emotion-classified text data includes: A text sentiment classification model is used to identify the sentiment information of the text data, and the text data is divided into three categories: positive, negative, and neutral based on the sentiment information.
3. The method according to claim 1, characterized in that, The step of extracting causal relationships from the emotion classification text data to obtain causal event tuple pairs includes: Determine whether the emotion classification text data contains causal cue words; If causal prompts are included, explicit causal relationships are extracted to obtain explicit causal event pairs. Otherwise, implicit causal relationships are extracted to obtain implicit causal event pairs; The explicit causal event pairs and the implicit causal event pairs are combined to obtain causal event tuple pairs.
4. The method according to claim 1, characterized in that, The step of establishing a causal graph based on the causal event tuple pairs includes: Based on the causal event tuples, a causal chain is formed; Calculate the causal transition probability based on the aforementioned causal chain; Based on the causal chain and the causal transition probability, a causal graph is generated to represent the event node construction of the causal event tuple pairs and the causal relationships between events.
5. The method according to claim 1, characterized in that, The intention reasoning based on the emotion level includes: Based on the stated emotion level, a pre-built intention reasoning strategy is invoked to perform intention reasoning in order to obtain more potential dialogue intentions.
6. An intention reasoning device, characterized in that, The device includes: The text acquisition unit allows users to obtain text data. An emotion classification unit is used to classify the text data according to emotions to obtain emotion-classified text data. The causal relationship extraction unit is used to extract causal relationships from the emotion classification text data to obtain causal relationship event tuple pairs. The event graph unit is used to establish an event graph based on the causal event tuple pairs; An emotion level inference unit is used to infer the emotion level based on the aforementioned reasoning graph. An intention reasoning unit is used to perform intention reasoning based on the emotion level. The emotion level inference unit is further configured to: The emotion level is calculated based on the path length and corresponding transition probability in the aforementioned reasoning graph.
7. The apparatus according to claim 6, characterized in that, The causal relationship extraction unit is also used for: Determine whether the emotion classification text data contains causal cue words; If causal prompts are included, explicit causal relationships are extracted to obtain explicit causal event pairs. Otherwise, implicit causal relationships are extracted to obtain implicit causal event pairs; The explicit causal event pairs and the implicit causal event pairs are combined to obtain causal event tuple pairs.
8. The apparatus according to claim 6, characterized in that, The principle graph unit is also used for: Based on the causal event tuples, a causal chain is formed; Calculate the causal transition probability based on the aforementioned causal chain; Based on the causal chain and the causal transition probability, a causal graph is generated to represent the event node construction of the causal event tuple pairs and the causal relationships between events.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.