Response method and device based on intention tree, computer equipment, readable storage medium and program product

By adopting an intent tree-based response method in the dialogue system, the problem that existing systems are difficult to understand and respond to complex user intentions is solved, and more efficient user experience and flexible demand adaptation is achieved.

CN119577092APending Publication Date: 2025-03-07CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411700997.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

Existing dialogue systems are difficult to accurately understand and respond to users’ complex intentions, resulting in poor user experience and difficult to update and adapt to new user needs in real time.

Method used

The response method based on the intent tree is adopted to accurately locate the question answer by receiving inquiry information, analyzing intent, matching intent tree nodes, and navigating along the intent tree path.

Benefits of technology

It realizes accurate understanding and response to user complex intentions, improves user experience, and can dynamically update the intention tree to adapt to new user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577092A_ABST
    Figure CN119577092A_ABST
Patent Text Reader

Abstract

The invention relates to a response method and device based on an intention tree, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: receiving inquiry information; analyzing the inquiry information to obtain an inquiry intention; matching the inquiry intention with each node in each intention tree in a demand library, and determining a target intention tree and a target node; the intention tree is constructed in advance; and performing path navigation step by step from the target node along the structure of the target intention tree to obtain an inquiry answer. By adopting the method, the inquiry answer can be accurately generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big prediction technology, and in particular to a response method, apparatus, computer device, computer-readable storage medium and computer program product based on an intent tree. Background Art

[0002] With the rapid development of information technology, users are facing increasingly complex demands when obtaining information and services. Traditional question-answering systems often fail to accurately understand user intent, resulting in poor user experience. Users often express a variety of needs during consultation, including specific questions, information queries, and personalized suggestions. In order to meet this growing demand, it is particularly important to build a system that can intelligently understand and respond to user intent.

[0003] Current dialogue systems mostly rely on preset rules or simple keyword matching, lacking a deep understanding of user intent. This approach not only fails to handle complex queries, but can also result in incorrect responses, which can affect user satisfaction. In addition, as user query content diversifies, existing technologies are difficult to update and adapt to new user needs in real time, resulting in inaccurate query content. Summary of the invention

[0004] Based on this, it is necessary to provide an intent tree-based answering method, apparatus, computer device, computer-readable storage medium and computer program product that can accurately generate answers to queries in response to the above technical problems.

[0005] In a first aspect, the present application provides a response method based on an intent tree, the method comprising:

[0006] Receive enquiry information;

[0007] Parsing the inquiry information to obtain the inquiry intention;

[0008] Matching the query intent with each node in each intent tree in the demand library to determine a target intent tree and a target node; the intent tree is pre-constructed;

[0009] Starting from the target node, path navigation is performed level by level along the structure of the target intention tree to obtain the query answer.

[0010] In one embodiment, the process of constructing the intent tree includes:

[0011] Get sample data;

[0012] Extracting multiple question-answer pairs from the sample data to obtain a question-answer pair set;

[0013] Dividing the question-answer pair set into a plurality of question-answer clusters, and obtaining a corresponding intent root node from each of the question-answer clusters;

[0014] Perform multi-dimensional analysis on the query statements in each of the question-answer clusters to obtain the intent sub-nodes corresponding to each of the intent root nodes;

[0015] Each of the intent trees is obtained according to each of the intent root nodes and the intent child nodes corresponding to each of the intent root nodes.

[0016] In one embodiment, dividing the question-answer pair set into a plurality of question-answer clusters includes:

[0017] Calculating the semantic similarity between each of the question-answer pairs in the question-answer pair set to obtain a similarity value;

[0018] The question-answer pairs are clustered based on the similarity values ​​to obtain the question-answer clusters.

[0019] In one embodiment, obtaining a corresponding intention root node from each of the question-answer clusters includes:

[0020] Extracting keywords from the query sentences in each of the question-answer clusters;

[0021] The semantic relevance between the keywords is calculated, and aggregation is performed according to the semantic relevance to obtain the intention root node.

[0022] In one embodiment, the multi-dimensional analysis of the query statements in each of the question-answer clusters to obtain the intent sub-nodes corresponding to each of the intent root nodes includes:

[0023] Extracting intent elements from the query sentences in each of the question-answer clusters;

[0024] Querying the context related to the intention element in the question-answer cluster, and determining the user's query dimension through the context;

[0025] The intent sub-node is generated according to each of the query dimensions and the context.

[0026] In one embodiment, after extracting a plurality of question-answer pairs from the sample data to obtain a set of question-answer pairs, the method further includes:

[0027] Deduplication is performed on the question-answer pair set;

[0028] Deduplication of the question-answer pair set includes:

[0029] Calculate the hash signature of each question-answer pair in the question-answer pair set according to a preset hash function;

[0030] The question-answer pairs are deduplicated based on the hash signature and preset screening rules.

[0031] In a second aspect, the present application provides a response device based on an intent tree, the device comprising:

[0032] A receiving module, used for receiving inquiry information;

[0033] A parsing module, used to parse the inquiry information to obtain the inquiry intention;

[0034] An intention tree matching module, used to match the query intention with each node in each intention tree in the demand library, and determine the target intention tree and the target node; the intention tree is pre-built;

[0035] The query module is used to perform path navigation step by step along the structure of the target intention tree starting from the target node to obtain the query answer.

[0036] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0037] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0038] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

[0039] After receiving the inquiry information, the above-mentioned intent tree-based answering method, device, computer device, computer-readable storage medium and computer program product will parse the inquiry information to obtain the inquiry intent representing the core of the inquiry information, and match the corresponding target intent tree and target intent node according to the inquiry intent. Finally, based on the target node and the target intent tree, step-by-step path navigation is started to gradually go deep into the core problem of the user, so that the inquiry answer can be accurately located. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0041] Figure 1Schematic diagram of a flow chart of a response method based on an intent tree in one embodiment;

[0042] Figure 2 A schematic diagram of a process of constructing an intent tree in one embodiment;

[0043] Figure 3 is a structural block diagram of a response device based on an intent tree in one embodiment;

[0044] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0046] In one embodiment, Figure 1 As shown, a response method based on an intent tree is provided. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0047] Step 102, receiving inquiry information.

[0048] Optionally, the user can input inquiry information in the front-end interface, and after the back-end receives the inquiry information, it generates a corresponding inquiry answer based on the inquiry information.

[0049] Step 104: parse the inquiry information to obtain the inquiry intention.

[0050] When receiving the user's query information, the system first needs to parse the information to accurately identify the user's query intention.

[0051] Optionally, the system can parse the inquiry information through a preset analysis model. Exemplarily, first, text preprocessing is performed on the inquiry information. The text preprocessing includes one or more of removing stop words, word segmentation, and part-of-speech tagging. Among them, stop words refer to words that have no actual meaning in a sentence, such as "de", "shi", "zai", etc.; word segmentation refers to splitting the input text into individual words or phrases; part-of-speech tagging refers to tagging the part of speech of each word, such as noun, verb, adjective, etc. Next, keywords are extracted from the inquiry information after text preprocessing. These keywords are the core of the user's intention and can reflect the user's needs. When extracting keywords, the system usually combines word frequency, syntactic analysis, and context information to identify the most meaningful words. For example, in the query "I want to book a flight ticket to Beijing", the keywords may include "book", "flight ticket", and "Beijing". In addition, the system also performs entity recognition, identifying that "Beijing" is a geographical entity or that "flight ticket" is a commodity or service entity. These keywords and entities provide important information for subsequent intention matching. In the syntax analysis stage, the system needs to analyze the syntactic structure of the user's query to further understand the grammatical relationships in the sentence. By constructing a syntactic tree or a dependency syntactic tree, the system can identify the subject, predicate, object, etc. in the sentence and infer the relationships between various words. For example, in the sentence "I want to book a flight ticket to Beijing", the system can analyze that "I" is the subject, "want" is a verb, "book" is the predicate verb, and "flight ticket to Beijing" is the object. This step is crucial for understanding the basic structure of the sentence and further extracting key information. After completing the syntax analysis, the system performs a deeper semantic understanding. This is not just an understanding of the sentence structure, but an inference of the actual meaning of the sentence. The system needs to understand the meaning of each word and phrase and map it to the user's real needs. For example, in "I want to book a flight ticket to Beijing", the system will understand that "book" represents an action, "flight ticket" is a commodity, and "Beijing" is a destination. Based on the extracted keywords and the results of syntactic analysis, the system can start intention recognition. The goal of intention recognition is to determine the core need of the user's query based on the content input by the user and match it with a predefined intention model. For example, if the user's query is "I want to book a flight ticket to Beijing", the system may identify the intention of this query as "flight ticket booking" and further infer that the user's needs may be about flight information, departure time, price, etc.

[0052] Optionally, in other embodiments, the query intent can also be identified through rule-based and template-based methods. For example, some patterns can be pre-defined to match specific structures or keywords in user input like regular expressions. If the user input meets a certain rule (such as "order [product name]" or "query [service name]"), the system can determine the corresponding intent. The rules can be manually defined or automatically generated through machine learning.

[0053] Step 106, matching the query intent with each node in each intent tree in the demand library, and determining the target intent tree and the target node; the intent tree is pre-constructed.

[0054] The requirement library refers to a related database for storing intent trees, which includes multiple pre-built intent trees.

[0055] Among them, the intent tree refers to a structure that represents user intent in a hierarchical manner. In the intent tree, each node represents an intent. The root node is usually the most extensive user demand, while the child nodes represent more specific needs. For example, the root node is travel, and the child nodes may be refined into flight reservations, accommodation arrangements, travel guides, etc. Each node can be further refined into more child nodes to form a multi-level structure.

[0056] The matching process is mainly to find the most relevant target node by comparing the user's query intent with the semantics of each node in the intent tree. The target node can be a root node or a child node. In this process, the system's task is to analyze the user needs represented by the query intent and find the most matching intent tree and target node in the demand library. This matching process no longer relies solely on superficial keyword matching, but rather compares the semantic understanding of the query intent with the semantic representation of the intent tree node to determine the most matching target node.

[0057] Specifically, when the query intent matches any node, the node is used as the target node, and the intent tree where the target node is located is used as the target intent tree.

[0058] Step 108, starting from the target node, path navigation is performed level by level along the structure of the target intention tree to obtain the query answer.

[0059] Optionally, after the target node is determined, path navigation will be performed along the hierarchical structure of the target intent tree. The intent tree is a hierarchical structure with parent-child relationships between nodes. Parent nodes represent broader intents, while child nodes represent more specific needs. During the path navigation process, starting from the target node, the child nodes of the next level are checked step by step until a node that meets the user's specific needs is found.

[0060] Optionally, whenever navigating from one node to the next sub-node, the system will further analyze the content of the node. For example, under the "Airline Booking" node, there may be multiple sub-nodes such as "Online Booking" and "Phone Booking". If the user's query involves "Online Booking", the system will continue to navigate down to the "Online Booking" sub-node.

[0061] Optionally, when the most specific child or grandchild node is reached, a complete answer is generated based on the information included in that node.

[0062] In this way, the structured hierarchy of the intent tree enables the system to clearly break down problems and provide step-by-step feedback when faced with complex queries, rather than just simplified answers. This is especially effective for dealing with multi-dimensional and multi-level problems.

[0063] For example, suppose the query information is "I want to know the process of air ticket booking". The user's query expresses a demand for air ticket booking. Based on the semantic understanding of the user's query, the system matches it to the root node "travel" or "travel" in the intent tree, and more specifically, to the target node "air ticket booking". Once the target node "air ticket booking" is determined, the system begins to navigate down the intent tree. The hierarchical structure of the intent tree may include multiple child nodes. For example, starting from the "air ticket booking" node, the system may enter the next level of child nodes, such as "online booking" or "phone booking", or "domestic flights" and "international flights" and other child nodes. Finally, the system reaches a specific child node, such as "online booking process", which may contain detailed steps on how to make an online air ticket booking: for example, the first step is to select a flight, the second step is to enter passenger information, the third step is to pay the ticket, and the fourth step is to confirm and obtain the ticket. The system organizes this information into a fluent answer: "The air ticket booking process includes: selecting a flight, filling in passenger information, paying the ticket, and confirming the reservation." This answer will be returned to the user to solve his query.

[0064] In the above embodiment, after receiving the inquiry information, the inquiry information is parsed to obtain the inquiry intent representing the core of the inquiry information, and the corresponding target intent tree and target intent node are matched according to the inquiry intent. Finally, based on the target node and the target intent tree, step-by-step path navigation is started to gradually go deep into the core problem of the user, so that the inquiry answer can be accurately located.

[0065] In one embodiment, a method for constructing an intent tree is provided, including: obtaining sample data; extracting multiple question-answer pairs from the sample data to obtain a question-answer pair set; dividing the question-answer pair set into multiple question-answer clusters, and obtaining a corresponding intent root node from each question-answer cluster; performing multi-dimensional analysis on the question statements in each question-answer cluster to obtain intent sub-nodes corresponding to each intent root node; and obtaining each intent tree according to each intent root node and the intent sub-nodes corresponding to each intent root node.

[0066] When constructing an intent tree, you first need to obtain sample data. The sample data can be a single or multiple document input uploaded by the user. In this embodiment, multiple document formats are supported, such as PDF, Word, TXT, etc. In other embodiments, the sample data can also be historical question and answer data, user behavior logs, open data sets, and public corpora.

[0067] After obtaining sample data, multiple question-answer pairs are extracted from the sample data. By extracting question-answer pairs, the intent behind each query can be clearly understood, and the intent can be learned from real user behavior, which enhances the accuracy of the intent tree.

[0068] Optionally, multiple question-answer pairs may be extracted from the sample data using a preset screening rule or a preset template.

[0069] Optionally, question-answer pairs are extracted from the sample data using preset filtering rules, where the preset filtering rules may be regular expressions or keyword matching.

[0070] Optionally, the preset templates may be some fixed-format question-answer templates to extract question-answer pairs. For example, for the question of "booking a flight ticket", the template may be "I want to (book / buy) a flight ticket". Questions matching the template may automatically generate a set of answers.

[0071] Optionally, you can also extract question-answer pairs using a pre-trained question-answer extraction model. The pre-trained question-answer extraction model understands the sample data and then identifies the question-answer relationship based on the knowledge learned during training. These training processes usually include a large amount of question-answer pair sample data. The model learns how to extract question-answer pairs from new, unseen text by analyzing the relationship between questions and answers in the sample data.

[0072] After obtaining the set of question-answer pairs, it is necessary to divide the set of question-answer pairs into multiple question-answer clusters. This is because the sample data may include queries or requirements of the same type, so it is necessary to classify them and obtain multiple types of question-answer clusters. Each type of question-answer cluster will respond to an intent root node, that is, each type of question-answer cluster corresponds to an intent tree. Among them, the intent root node refers to the core meaning that can represent the entire question-answer cluster.

[0073] Optionally, a semantic-based clustering method is used to analyze the keywords or common sentence patterns of the question-answer cluster, identify the common core intent of these question-answer pairs through natural language processing technology, and then extract the root node that can summarize the entire cluster.

[0074] After determining the intent root node, the query statements in the question-answer cluster will be analyzed in multiple dimensions, analyzing different dimensions in the query statements, such as the purpose of the query, specific needs, potential expectations, etc. Through multi-dimensional analysis, the intents of different dimensions can be obtained, and the intents of different dimensions can be used as the intent sub-nodes of the question-answer cluster.

[0075] Optionally, the method of generating sub-nodes includes using a natural language processing (NLP) model to extract semantics, analyze the specific content and context of the query, and automatically generate intent sub-nodes related to different dimensions. For example, by analyzing the query "booking air tickets to Beijing", the system can generate sub-nodes such as "domestic air ticket booking", "date selection" and "price inquiry", which correspond to different user demand dimensions.

[0076] Finally, according to the root nodes corresponding to each question and answer cluster and the intention sub-nodes corresponding to the root nodes, the corresponding intention tree is constructed, and the constructed intention tree is saved to the demand library.

[0077] In the above embodiment, the system identifies the core intent behind different queries by extracting question-answer pairs from sample data and dividing them into multiple question-answer clusters. Each question-answer cluster represents a specific intent root node, which is then further refined into sub-intents through multi-dimensional analysis. In this way, an intent tree can be accurately constructed.

[0078] Furthermore, in one embodiment, the question-answer pair set is divided into a plurality of question-answer clusters, including: calculating the similarity between each question-answer pair in the question-answer pair set to obtain a similarity value; and performing clustering based on the similarity value to obtain question-answer clusters.

[0079] Optionally, similarities between question-answer pairs are calculated to obtain similarity values ​​between question-answer pairs, and then clustering is performed based on the similarity data to obtain question-answer clusters.

[0080] Optionally, similarities between the query statements corresponding to each question-answer pair may be calculated to obtain similarity values ​​between the question-answer pairs, and then clustering may be performed based on the similarity data to obtain question-answer clusters.

[0081] For example, assuming that the question-answer pair set includes {question-answer pair 1, question-answer pair 2, question-answer pair 3}, then it is necessary to calculate the similarity value of question-answer pair 1 relative to question-answer pair 2 and question-answer pair 3, the similarity value of question-answer pair 2 relative to question-answer pair 1 and question-answer pair 3, and the similarity value of question-answer pair 3 relative to question-answer pair 1 and question-answer pair 2.

[0082] Optionally, similarity calculation based on word embeddings can be performed. For example, the words in each question-answer pair are represented as a vector, and then the similarity values ​​of the two question-answer pairs are calculated.

[0083] Optionally, a pre-trained model such as BERT can be used to generate a context embedding vector for the question-answer pair, and then the context embedding vectors of the two question-answer pairs are pre-calculated for similarity to obtain a similarity value.

[0084] Optionally, the similarity values ​​between each question-answer pair may be stored as a similarity matrix.

[0085] Next, the question-answer pairs are classified based on the similarity values ​​to obtain multiple question-answer clusters.

[0086] Optionally, the question-answer pairs may be divided into a predetermined number of clusters, and the question-answer pairs may be assigned to different clusters based on similarity values. The cluster centers may then be recalculated and the differences between the question-answer pairs within each question-answer cluster may be minimized by iteratively updating the cluster centers.

[0087] Optionally, clustering can be done based on a similarity matrix. Question-answer pairs are considered nodes in a graph, and the edge weights between nodes are determined by the values ​​in the similarity matrix. That is, the edge weight connecting two data points with high similarity in the graph is large, and vice versa. The Laplacian matrix is ​​obtained by symmetric regularization of the similarity matrix. The eigenvectors of the Laplacian matrix help the system understand which data points are connected in the graph (i.e., they are semantically similar), so that each question-answer cluster can be obtained.

[0088] In the above embodiment, dividing the question-answer pair set into multiple question-answer clusters helps to classify queries according to different user needs and intentions, thereby more accurately matching users' specific questions and improving the system's response accuracy and efficiency.

[0089] In one embodiment, the above-mentioned obtaining the corresponding intent root node from each question and answer cluster includes: extracting keywords from the query sentences in each question and answer cluster; calculating the semantic relevance between the keywords, and aggregating them according to the semantic similarity to obtain the intent root node.

[0090] Since the query includes the user's original intention and needs, and the answer part of the question-answer pair is the response content generated based on these needs, if keywords are extracted from the question-answer pair, some original information about the user's needs will be lost.

[0091] Optionally, keywords may be extracted from the query statement using keyword extraction algorithms such as TF-IDF (Term Frequency-Inverse Document Frequency) and TextRank (a keyword extraction method based on a graph algorithm).

[0092] Optionally, keywords can be extracted from the query statements through a pre-trained model. The pre-trained model needs to understand the meaning of all queries in each cluster and use its powerful semantic understanding ability to identify keywords in each query.

[0093] After extracting keywords from the query statements in each Q&A cluster, multiple keywords will be obtained, and these keywords cannot all be used as intent root nodes. Since there is a certain semantic correlation between these keywords, a concise and accurate phrase or word will be generated based on the aggregated keywords to represent the core intent of this cluster, and this core intent will be used as the intent root node.

[0094] For example, the keywords after clustering include "ticket", "flight", "flight", "fare", etc. By analyzing the semantic relevance of these keywords, it can be concluded that they all involve travel-related content, so a more concise phrase or word can be used to represent the core meaning of this intent cluster. A suitable concise representative phrase is "travel". And "travel" is used as the intent root node of the question-answer cluster.

[0095] In the above embodiment, not only keywords are extracted, but also keyword aggregation is performed through advanced semantic relationship analysis to generate a highly summarized and accurate intent root node.

[0096] In one embodiment, the above-mentioned multi-dimensional analysis of the query statements in each question and answer cluster is performed to obtain the intent sub-nodes corresponding to each intent root node, including: extracting intent elements from the query statements in each question and answer cluster; querying the context related to the intent elements in the question and answer cluster, and determining the user's query dimension through the context; generating intent sub-nodes according to each query dimension and context.

[0097] Optionally, since the query statement usually includes information such as the user's needs, questions, and purpose, the model will identify the intent elements through natural language processing (NLP) technology. For example, it can identify key actions involved in the user query, such as "booking", "query", objects, such as "air tickets", "hotels", and emotional tendencies, such as "urgent".

[0098] After obtaining the intent elements, a deeper analysis is performed in combination with the context. The context can be the previous conversation history, the user's query background, possible multi-round conversation information, etc., all of which help to confirm the specific intent of the user's query. For example, if a user queries "I need a cheap air ticket", the system will use context information to identify that the query dimension may be the price factor rather than other factors such as flight time or airline. At this point, the system analyzes the dimensions that the user is concerned about based on the context and determines the specific query dimension.

[0099] Optionally, after confirming the query dimensions, the system will use these dimensions and contextual information to refine the intent. For example, if the user's query involves "air tickets" but the dimension of interest is "price", the system will generate a new intent sub-node based on this dimension, such as "cheap air ticket query" or "price optimization". Each sub-intent represents a refined requirement extracted from the query. At this stage, deep learning models, such as BERT or GPT, can be used to generate concise and accurate phrases or words as corresponding intent sub-nodes.

[0100] Optionally, the above step of generating intent sub-nodes can also be obtained through a pre-trained intent recognition model.

[0101] Exemplarily, the question-answer pairs under the same intent root node are provided to the intent recognition model, prompting the model to recognize refined sub-intents, that is, intent sub-nodes.

[0102] In the above embodiment, the intent elements are extracted from the query sentences in the question-answer cluster, and further refined in combination with the context analysis to generate one or more specific intent sub-nodes.

[0103] In one embodiment, after extracting multiple question-answer pairs from the sample data to obtain a question-answer pair set, the method further includes: deduplicating the question-answer pair set; deduplicating the question-answer pair set, including: calculating the hash signature of each question-answer pair in the question-answer pair set according to a preset hash function; deduplicating the question-answer pairs based on the hash signature and preset screening rules.

[0104] The preset hash function refers to one or more hash functions that are predefined by the system based on specific needs or algorithm requirements before starting to process data. These hash functions are used to map the question-answer pair to a hash signature of a fixed size. The main function of the hash function is to convert the original data into a short, fixed-length hash signature that can effectively represent the original data.

[0105] Optionally, for each question-answer pair, a hash value is generated by a preset hash function. Each hash function generates a hash value for the keywords in the question-answer pair, and finally a MinHash signature is formed by taking the "minimum hash value".

[0106] For example, the question-answer pair "How to buy a plane ticket" may generate corresponding hash values ​​through multiple hash functions (such as hash function 1, hash function 2, etc.): [hash value 1, hash value 2, hash value 3]. The MinHash signature of the question-answer pair is formed by selecting the minimum value generated by each hash function.

[0107] Optionally, a MinHash signature can be generated for each question-answer pair. The similarity of these signatures is compared to determine whether the question-answer pairs are similar. Generally, question-answer pairs with high signature similarity can be considered to be repeated question-answer pairs. For example, the MinHash signatures of the question-answer pairs "how to book a flight" and "how to buy a flight" may be very similar, indicating that their contents are repeated or similar.

[0108] Finally, the question-answer pairs are deduplicated by combining the signatures and the preset screening rules. The preset screening rules may be preset thresholds. For example, question-answer pairs with signature similarity higher than the set threshold are considered duplicates and are removed from the set, leaving only unique question-answer pairs. In other embodiments, the preset screening rules may be set according to actual application scenarios.

[0109] In the above embodiment, deduplication of question-answer pairs can remove redundant question-answer pairs, which can improve the efficiency of subsequent processing of question-answer pairs.

[0110] Combination Figure 2 , Figure 2 The following is a flow chart of constructing an intent tree in one embodiment. The following steps are included:

[0111] 1. Input layer: Receive and parse single / multiple document inputs uploaded by users, and convert the input data into large model input text, that is, sample data.

[0112] Extraction of Query-Answer Pairs from Large Models

[0113] Utilize the generative capability of the pre-trained large model to extract query-answer pairs. Input the parsed document text into the large model G to obtain m query-answer pairs, represented as a set Q = {(q1, a1), (q2, a2), ..., (qm, am)}.

[0114] 3.QA deduplication module

[0115] This module uses the MinHash algorithm to deduplicate Q and obtain the final Query-Answer pair set Q*.

[0116] 4. Intent clustering to obtain question and answer clusters

[0117] Calculate the semantic similarity of all queries {q1, q2,...,qm} in Q* to obtain a similarity matrix. Then use the K-means clustering algorithm to divide the queries into k clusters C = {C1, C2,...,Ck}.

[0118] 5. Keyword aggregation

[0119] The goal is to extract keywords from a bunch of queries (i.e., "clusters Ci") and use these keywords to generate a "root node Ni" that represents the user's core intent. First, the big model needs to understand the meaning of all queries in each cluster Ci. Using its powerful semantic understanding ability, it can identify the keywords in each query. After extracting the keywords, the big model needs to analyze the semantic relationship between these keywords and aggregate keywords with similar or related meanings. For example, "air tickets" and "flights" can be combined into a more general keyword "travel".

[0120] 6. Intent root node generation

[0121] Finally, the big model will generate a concise and accurate phrase or word based on the aggregated keywords to represent the core intent of this cluster, which is your "intent root node Ni". For example, "travel", "accommodation", and "travel" in the above example can be used as the intent root node of this "tourism" cluster.

[0122] 7. Intent Node Generation

[0123] In this step, the big model will generate more specific sub-intents by analyzing different aspects of the query (such as the purpose of the inquiry, specific needs, etc.), and segmenting them. The big model will generate a corresponding sub-node Nij for each sub-intent and describe the sub-node with a concise phrase or word.

[0124] For example, assume that there is the following Query data cluster related to tourism:

[0125] Cluster C1: ["What documents do I need to prepare for traveling to Bali?", "What materials do I need to apply for a Bali tourist visa?", "Do I need a visa to travel to Bali?"]

[0126] Cluster C2: ["Recommend some attractions in Bali suitable for family travel", "What attractions in Bali are suitable for children?", "Bali family travel guide"]

[0127] Cluster C3: ["What are the recommended hotels in Bali?", "Recommended family hotels in Bali", "Where is the best place to stay in Bali?"]

[0128] Cluster C4: ["How to book the cheapest flight to Bali?", "What are the direct flights from Shanghai to Bali?", "When is the peak tourist season in Bali?"]

[0129] Through the above steps, we may get the following intent nodes and subnodes:

[0130] Intent node N1: "Travel to Bali"

[0131] Subnode N11: "Airline Ticket Booking"

[0132] Child node N12: "Flight information"

[0133] Intent Node N2: "Bali Accommodation"

[0134] Subnode N21: "Hotel recommendation"

[0135] Child node N22: "Family hotel"

[0136] Intent node N3: "Bali tour"

[0137] Subnode N31: "Attractions Recommendation"

[0138] Child node N32: "Family travel guide"

[0139] Intent Node N4: "Bali Travel Preparation"

[0140] Subnode N41: "Visa processing"

[0141] Subnode N42: "Required Materials"

[0142] In the above embodiment, using a pre-trained large-scale language model, the system extracts question (Query) and answer (Answer) pairs from the document on the basis of understanding and processing the text to form a knowledge unit set Q. This process does not require manual pre-defined rules, and does not require the collection of historical dialogue pairs. In the case of cold start, the efficiency and accuracy of information extraction are significantly improved. Moreover, in this embodiment, not only keywords are extracted, but also keyword aggregation is performed through advanced semantic relationship analysis to generate a highly summarized and accurate "intent root node". Finally, all generated intent nodes and sub-nodes are integrated to construct a dynamic intent tree with clear hierarchy and strict logic.

[0143] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0144] Based on the same inventive concept, the embodiment of the present application also provides an intent-tree-based response device for implementing the intent-tree-based response method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more intent-tree-based response device embodiments provided below can refer to the limitations of the intent-tree-based response method above, and will not be repeated here.

[0145] In an exemplary embodiment, Figure 3 As shown, a response device based on an intent tree is provided, comprising: a receiving module 310, a parsing module 320, an intent tree matching module 330 and a query module 340, wherein:

[0146] The receiving module 310 is used to receive inquiry information.

[0147] The parsing module 320 is used to parse the inquiry information to obtain the inquiry intention.

[0148] The intention tree matching module 330 is used to match the query intention with each node in each intention tree in the demand library to determine the target intention tree and the target node; the intention tree is pre-constructed.

[0149] The query module 340 is used to perform path navigation level by level along the structure of the target intention tree starting from the target node to obtain the query answer.

[0150] In one embodiment, the apparatus further includes an intention tree construction module, wherein the intention tree construction module includes:

[0151] The sample acquisition unit is used to acquire sample data.

[0152] The extraction unit is used to extract multiple question-answer pairs from the sample data to obtain a question-answer pair set.

[0153] The cluster division unit is used to divide the question-answer pair set into multiple question-answer clusters, and obtain a corresponding intention root node from each question-answer cluster.

[0154] The analysis unit is used to perform multi-dimensional analysis on the question statements in each of the question-answer clusters to obtain the intent sub-nodes corresponding to each of the intent root nodes.

[0155] The tree generation unit is used to obtain each of the intent trees according to each of the intent root nodes and the intent child nodes corresponding to each of the intent root nodes.

[0156] In one embodiment, the cluster division unit includes:

[0157] The similarity calculation subunit is used to calculate the semantic similarity between each question and answer pair in the question and answer pair set to obtain a similarity value.

[0158] The clustering subunit is used to cluster the question-answer pairs based on the similarity values ​​to obtain the question-answer clusters.

[0159] In one embodiment, the cluster division unit further includes:

[0160] The keyword extraction subunit is used to extract keywords from the query sentences in each of the question-answer clusters.

[0161] The aggregation subunit is used to calculate the semantic relevance between the keywords, and perform aggregation according to the semantic relevance to obtain the intention root node.

[0162] In one embodiment, the above molecular unit comprises:

[0163] The element extraction subunit is used to extract the intention elements from the query sentences in each of the question-answer clusters.

[0164] The associated query subunit is used to query the context related to the intention element in the question and answer cluster, and determine the user's query dimension through the context.

[0165] The sub-node generation sub-unit is used to generate the intention sub-node according to each of the query dimensions and the context.

[0166] In one embodiment, the intention tree building module further includes a deduplication unit.

[0167] A deduplication unit is used to deduplicate the question-answer pair set.

[0168] In one embodiment, the deduplication unit includes:

[0169] The signature subunit is used to calculate the hash signature of each question and answer pair in the question and answer pair set according to a preset hash function.

[0170] A filtering subunit is used to remove duplicates from the question and answer pairs based on the hash signature and preset screening rules.

[0171] Each module in the above-mentioned intention tree-based response device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0172] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 4 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store an intention tree. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a response method based on an intention tree is implemented.

[0173] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0174] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the method in any one of the above embodiments when executing the computer program.

[0175] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in any one of the above embodiments are implemented.

[0176] In one embodiment, a computer program product is provided, including a computer program, which implements the steps of the method in any one of the above embodiments when executed by a processor.

[0177] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0178] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0179] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A response method based on an intention tree, characterized in that: The method comprises: Receive enquiry information; Parsing the inquiry information to obtain the inquiry intention; Matching the query intent with each node in each intent tree in the demand library to determine a target intent tree and a target node; the intent tree is pre-constructed; Starting from the target node, path navigation is performed level by level along the structure of the target intention tree to obtain the query answer.

2. The method according to claim 1, characterized in that The process of constructing the intention tree includes: Get sample data; Extracting multiple question-answer pairs from the sample data to obtain a question-answer pair set; Dividing the question-answer pair set into a plurality of question-answer clusters, and obtaining a corresponding intent root node from each of the question-answer clusters; Perform multi-dimensional analysis on the query statements in each of the question-answer clusters to obtain the intent sub-nodes corresponding to each of the intent root nodes; Each of the intent trees is obtained according to each of the intent root nodes and the intent child nodes corresponding to each of the intent root nodes.

3. The method according to claim 2, characterized in that The step of dividing the question-answer pair set into a plurality of question-answer clusters comprises: Calculating the semantic similarity between each of the question-answer pairs in the question-answer pair set to obtain a similarity value; The question-answer pairs are clustered based on the similarity values ​​to obtain the question-answer clusters.

4. The method according to claim 2, characterized in that: The step of obtaining a corresponding intention root node from each of the question-answer clusters includes: Extracting keywords from the query sentences in each of the question-answer clusters; The semantic relevance between the keywords is calculated, and aggregation is performed according to the semantic relevance to obtain the intention root node.

5. The method according to claim 2, characterized in that: The multi-dimensional analysis of the query statements in each of the question-answer clusters to obtain the intent sub-nodes corresponding to each of the intent root nodes includes: Extracting intent elements from the query sentences in each of the question-answer clusters; Querying the context related to the intention element in the question-answer cluster, and determining the user's query dimension through the context; The intent sub-node is generated according to each of the query dimensions and the context.

6. The method according to claim 2, characterized in that After extracting a plurality of question-answer pairs from the sample data to obtain a set of question-answer pairs, the method further includes: Deduplication is performed on the question-answer pair set; Deduplication of the question-answer pair set includes: Calculate the hash signature of each question-answer pair in the question-answer pair set according to a preset hash function; The question-answer pairs are deduplicated based on the hash signature and preset screening rules.

7. A response device based on an intention tree, characterized in that: The device comprises: A receiving module, used for receiving inquiry information; A parsing module, used to parse the inquiry information to obtain the inquiry intention; An intention tree matching module, used to match the query intention with each node in each intention tree in the demand library, and determine the target intention tree and the target node; the intention tree is pre-built; The query module is used to perform path navigation step by step along the structure of the target intention tree starting from the target node to obtain the query answer.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Intelligent question and answer guiding method and device based on reasoning path, computer equipment, readable storage medium and program product

    CN119938812A