Conversation method, device and equipment based on hierarchical intention capture and interaction control
Through a dialogue method based on hierarchical intention capture and interactive control, the problems of inaccurate answers and high computing resource consumption caused by unclear user intention expression in the prior art are solved, and efficient and accurate user intention detection and targeted response are achieved, reducing the number of problems of inaccurate answers in the prior art. interaction cost and resource consumption.
Patent Information
- Application Number
- CN202411513695.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-01-14
AI Technical Summary
Existing language interaction systems are difficult to generate accurate answers when user intentions are unclear, and adding large model training data or multiple rounds of interactions to improve intention comprehension will lead to increased computing resource consumption and interaction costs.
Using a dialogue method based on hierarchical intent capture and interaction control, language interaction indication is generated through natural language rewriting, intent capture and key slot capture processing, so as to achieve efficient and accurate detection of user intentions and targeted responses, reducing computing resource consumption and interaction cost.
It realizes efficient and accurate detection and targeted responses to user intentions, reduces interaction costs, has better real-time and adaptability, and avoids the loss of information and restart process requirements when users interrupt and continues conversations.
Smart Images

Figure CN119312933A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a dialogue method, device and equipment based on hierarchical intent capture and interactive control. Background Art
[0002] Intelligent language interaction is an important research field of artificial intelligence technology. Most existing language interaction methods directly feed user input into a large language model (hereinafter referred to as the large model), and directly feed back the response generated by the large language model to the user.
[0003] However, large language models trained on public data sets often have difficulty generating accurate responses when faced with unclear user intent due to the lack of professional domain knowledge and user profiles. In order to clarify user intent, related technologies often use methods such as increasing large model training data or multiple rounds of interaction to improve the system's ability to understand intent.
[0004] However, increasing the amount of large model training or multiple rounds of large model interaction will greatly increase the system's computing resource consumption. In addition, when the user interrupts and resumes the conversation, the interactive system often cannot give a correct response due to the lack of information such as the user's historical interaction intentions. The user needs to restart the interaction process and identify the intention, which reduces the overall efficiency of the system and increases the interaction cost. Summary of the invention
[0005] The present invention provides a dialogue method, device and equipment based on hierarchical intent capture and interaction control, so as to solve the technical problem in the prior art that in order to accurately identify the user's intention for each round of interaction, additional training and multiple rounds of interaction lead to a significant increase in system computing resource consumption and interaction costs.
[0006] The present invention provides a dialogue method based on hierarchical intention capture and interactive control, comprising: rewriting the interactive text input by the user into natural language to obtain an initial input standard sentence; performing intention capture and key slot capture processing on the initial input standard sentence to obtain intention word features and answer key-value pairs; performing language interaction processing according to the intention word features and answer key-value pairs to obtain language interaction instructions, generate language interaction text and feed it back to the user.
[0007] According to a dialogue method based on hierarchical intent capture and interactive control provided by the present invention, the initial input standard sentence is subjected to intent capture and key slot capture processing to obtain intent word features and answer key-value pairs, including: the initial input standard sentence is subjected to intent capture processing to obtain intent word features; the initial input standard sentence is subjected to key slot capture processing, and combined with the intent word features, to obtain answer key-value pairs.
[0008] According to a dialogue method based on hierarchical intent capture and interactive control provided by the present invention, an initial input standard sentence is processed for intent capture to obtain intent word features, including: inputting the initial input standard sentence into a hierarchical intent capture module; the initial input standard sentence is processed by the hierarchical intent capture module for coarse-grained intent screening and fine-grained intent capture to obtain intent word features.
[0009] According to a dialogue method based on hierarchical intent capture and interactive control provided by the present invention, the initial input standard sentence is subjected to key slot capture processing, and combined with the intent word features, an answer key-value pair is obtained, including: the initial input standard sentence is input into a key slot extraction module, the initial input standard sentence is captured through the key slot information of the key slot extraction module, and combined with the intent word features, an answer key-value pair is obtained.
[0010] According to a dialogue method based on hierarchical intent capture and interactive control provided by the present invention, language interaction indications are obtained after language interaction processing according to intent word features and answer key-value pairs, and language interaction text is generated and fed back to the user, including: inputting intent word features and answer key-value pairs into a language interaction control module, the language interaction control module outputs language interaction indications, wherein the language interaction indications include reply fields, multi-round interaction states, reply forms, reply intentions and user information; and a language interaction generation module generates language interaction text according to the language interaction indications and a knowledge base and feeds back to the user.
[0011] A dialogue method based on hierarchical intent capture and interactive control provided by the present invention also includes: determining the intent type according to the intent word features, wherein the intent type includes question-and-answer intent, task flow intent or chat intent; and performing interactive responses according to the intent type.
[0012] The present invention also provides a dialogue device based on hierarchical intent capture and interactive control, including: an input module, used to rewrite the interactive text input by the user into natural language to obtain an initial input standard sentence; an intermediate processing module, used to perform intent capture and key slot capture processing on the initial input standard sentence to obtain intent word features and answer key-value pairs; an output module, used to perform language interaction processing based on the intent word features and answer key-value pairs to obtain language interaction instructions, generate language interaction text and feed it back to the user.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the dialogue method based on hierarchical intent capture and interactive control as described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described dialogue methods based on hierarchical intent capture and interactive control.
[0015] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned dialogue methods based on hierarchical intent capture and interactive control.
[0016] The present invention provides a dialogue method, device and equipment based on hierarchical intent capture and interactive control. The dialogue method based on hierarchical intent capture and interactive control includes: rewriting the interactive text input by the user in natural language to obtain an initial input standard sentence; performing intent capture and key slot capture processing on the initial input standard sentence to obtain intent word features and answer key-value pairs; performing language interaction processing based on the intent word features and answer key-value pairs to obtain language interaction instructions, generate language interaction text and feed it back to the user. According to the scheme of the present invention, the dialogue system can efficiently and accurately detect the user's intent through the hierarchical intent capture method, and generate targeted dialogue content based on the user's intent and user questions, without consuming additional computing resources, reducing the interaction cost, and having better real-time and adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 This is one of the flow charts of the dialogue method based on hierarchical intent capture and interactive control provided in an embodiment of the present invention.
[0019] Figure 2 This is the second flow chart of the dialogue method based on hierarchical intent capture and interactive control provided in an embodiment of the present invention.
[0020] Figure 3 It is a schematic diagram of the data content of the knowledge base provided by an embodiment of the present invention.
[0021] Figure 4 It is a flowchart of the hierarchical intent capture process provided by an embodiment of the present invention.
[0022] Figure 5 It is a schematic diagram of an interactive control flow provided by an embodiment of the present invention.
[0023] Figure 6It is a schematic diagram of the TaskFlow execution process provided by an embodiment of the present invention.
[0024] Figure 7 It is a schematic diagram of the system framework for executing a dialogue method based on hierarchical intent capture and interactive control provided by an embodiment of the present invention.
[0025] Figure 8 It is a structural diagram of a dialogue device based on hierarchical intention capture and interactive control provided by an embodiment of the present invention.
[0026] Fig. 9 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] In the description of the embodiments of the present invention, it should be noted that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limitations on the embodiments of the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.
[0029] In the description of the embodiments of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "connected" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments of the present invention can be understood according to specific circumstances.
[0030] In the embodiments of the present invention, unless otherwise clearly specified and limited, the first feature being "above" or "below" the second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, the first feature being "above", "above" and "above" the second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. The first feature being "below", "below" and "below" the second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0031] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0032] It should be noted that all actions of acquiring signals, information or data in the present invention are performed in compliance with the corresponding data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.
[0033] When faced with scenarios where users initiate interactions with long and difficult sentences, multiple intentions, and other unclear statements, related technologies often find it difficult to give accurate answers to users' vague questions, resulting in the inability to resolve the issues that users are concerned about during the interaction, and a poor interactive experience. Related technologies often use methods such as increasing large model intent training data or multiple rounds of interactions to improve the system's ability to capture interactive intents, but increasing the amount of large model training or multiple rounds of large model interactions will greatly increase the system's computing resource consumption. In addition, when a user interrupts and resumes a conversation, the interactive system is often unable to give a correct response due to a lack of information such as the user's historical interactive intents, requiring the user to restart the interaction process and identify the intent, which reduces the overall efficiency of the system and increases the cost of interaction.
[0034] In order to solve the above technical problems, the present invention provides a dialogue method based on hierarchical intent capture and interaction control, which is used to solve the technical problem that in order to accurately identify the user's intention in each round of interaction, the related technology often adopts the method of increasing training data or multiple rounds of large model interaction, but increasing training and multiple rounds of interaction will lead to a significant increase in system computing resource consumption and interaction costs.
[0035] See also Figure 1 , Figure 1 This is one of the flow charts of the dialogue method based on hierarchical intention capture and interactive control provided by an embodiment of the present invention. In this embodiment, the dialogue method based on hierarchical intention capture and interactive control includes steps S110 to S130, and each step is as follows: S110: rewriting the interactive text input by the user into natural language to obtain an initial input standard sentence.
[0036] S120: Perform intent capture and key slot capture processing on the initial input standard sentence to obtain intent word features and answer key-value pairs.
[0037] S130: After language interaction processing is performed according to the intended word features and the answer key-value pairs, a language interaction indication is obtained, and a language interaction text is generated and fed back to the user.
[0038] Specifically, a user text may be obtained as input, and a vocabulary processing module based on the knowledge base module may be used to perform natural language rewriting on the user input to obtain an initial input standard sentence.
[0039] Natural language paraphrase refers to the process of restating text in a different way while maintaining the original meaning. This process usually involves adjusting sentence structure, vocabulary selection and language style to enhance readability, adapt to a specific context, eliminate ambiguity, or better convey information.
[0040] Intent capture is a processing step in natural language processing (NLP), which refers to the process of extracting and understanding the potential intent from the user's input and taking corresponding actions or generating responses based on the intent.
[0041] Key slot capture processing refers to the process of identifying and extracting key information (i.e., "slots") from user input in a natural language processing (NLP) system and filling it into a predefined template or structure. This process is usually closely integrated with intent recognition in order to better understand user requests and provide more precise and targeted services or responses.
[0042] Key-Value Pair is a basic data structure in which data appears in pairs in the form of "key" and "value", and the key is used to uniquely identify a value.
[0043] Language interaction processing includes natural language understanding, dialogue management, natural language generation and other functions. It is responsible for obtaining language interaction instructions and thus generating language interaction text for user input.
[0044] Through the above method, in an embodiment of the present invention, the dialogue system can efficiently and accurately detect user intentions through a hierarchical intent capture method, and generate targeted dialogue content based on user intentions and user questions, without consuming additional computing resources, reducing interaction costs, and having better real-time and adaptability.
[0045] Based on any of the above embodiments, the steps of performing intent capture and key slot capture processing on the initial input standard sentence to obtain the intent word features and answer key-value pairs may specifically include: The initial input standard sentence is processed for intent capture to obtain the intent word feature; the initial input standard sentence is processed for key slot capture, and combined with the intent word feature to obtain the answer key-value pair.
[0046] Based on any of the above embodiments, the step of performing intent capture processing on the initial input standard sentence to obtain the intent word feature may specifically include: The initial input standard sentence is input into the hierarchical intent capture module; the initial input standard sentence is processed by the hierarchical intent capture module through coarse-grained intent screening and fine-grained intent capture to obtain the intent word features.
[0047] Based on any of the above embodiments, the steps of performing key slot capture processing on the initial input standard sentence and obtaining answer key-value pairs in combination with the intended word features may specifically include: The initial input standard sentence is input into the key slot extraction module. The key slot information of the initial input standard sentence is captured by the key slot extraction module and combined with the intended word features to obtain the answer key-value pair.
[0048] Based on any of the above embodiments, the steps of obtaining a language interaction indication after performing language interaction processing according to the intended word features and the answer key-value pairs, generating a language interaction text and feeding back to the user may specifically include: The intent word features and answer key-value pairs are input into the language interaction control module, which outputs language interaction instructions, which include reply domain, multi-round interaction status, reply form, reply intention and user information; the language interaction generation module generates language interaction text based on the language interaction instructions and the knowledge base and feeds it back to the user.
[0049] Based on any of the above embodiments, the dialogue method based on hierarchical intent capture and interactive control also includes: Determine the intent type based on the features of the intent word, where the intent types include question-and-answer intent, task flow intent, or chat intent; and make interactive responses based on the intent type.
[0050] See also Figure 2 , Figure 2 This is the second flow chart of the dialogue method based on hierarchical intent capture and interactive control provided in an embodiment of the present invention.
[0051] S210: Obtain user interaction text as input, and rewrite the user interaction question in natural language through a vocabulary processing module based on a knowledge base to obtain an initial input standard sentence.
[0052] S220: Send the initial input standard sentence to the hierarchical intent capture module; the initial input standard sentence is processed by coarse-grained intent screening and fine-grained intent capture to obtain intent word features.
[0053] S230: Send the initial input standard sentence to the key slot extraction module; the initial input standard sentence is captured by the key slot information and combined with the intention word features to obtain the answer key-value pair.
[0054] S240: Input the intended word features and the answer key-value pairs into the language interaction control module, and output the language interaction instructions; the language interaction instructions include the reply domain, multi-round interaction status, reply form, reply intention and user information.
[0055] S250: The language interaction generation module generates a language interaction text according to the language interaction instruction and the knowledge base and feeds it back to the user.
[0056] In this embodiment, a user text is obtained as input, and the user input is rewritten into natural language by the vocabulary processing module to obtain an initial standard sentence; the initial standard sentence is input into the hierarchical intent capture module; the initial standard sentence is processed by the hierarchical intent capture module to output the intent word feature; the initial standard sentence is input into the key slot capture module to output the answer key-value pair; the intent word feature and the answer key-value pair are input into the language interaction control module; the intent word feature and the answer key-value pair are processed by the language interaction control module to obtain a language interaction indication; the language interaction indication is input into the language interaction generation module to obtain a language interaction text and feedback to the user. According to the scheme of the embodiment of the present invention, the dialogue system can efficiently and accurately detect the user's intent through the hierarchical intent capture method, and generate targeted dialogue content according to the user's intent and the user's question.
[0057] Specifically, the knowledge base stores data content, including a vocabulary, an intent library, and an answer library; in this embodiment, ElasticSearch and redis are used to store data.
[0058] See also Figure 3 , Figure 3 It is a schematic diagram of the data content of the knowledge base provided by an embodiment of the present invention.
[0059] The knowledge base can be divided into four parts: vocabulary, standard questions, answer library and intent library. Among them, the content stored in ElasticSearch includes proprietary vocabulary, synonym vocabulary, similar vocabulary, must-have vocabulary, removed vocabulary, standard questions and their corresponding answers, intents and similar questions; redis stores keywords; standard questions include standard question ID, standard intent, business category and the channel where the standard questions take effect; similar questions and their corresponding standard questions use the same knowledge index.
[0060] In this embodiment, the input user interaction text is firstly calculated by the semantic similarity calculation algorithm to calculate the similarity between all similar questions stored in the knowledge base ElasticSearch and the input text; the semantic similarity calculation algorithm firstly encodes the user interaction text into a vector form through the encoding model to obtain the user interaction text vector. ; Encode the similarity question to be calculated into a vector form through the same encoding model to obtain the similarity question vector ; Calculate the dot product of the user interaction text vector and the similar question vector, and use the dot product as the approximation between the user interaction text and the similar question , the calculation formula is as follows: ; Among them, Encoder(·) represents the encoding model, Represents user interaction text in text form, Represent similar questions in text form; sort all similar questions and the user interaction text in descending order of similarity; take the first K similar questions in descending order of similarity and the corresponding standard questions and standard intentions to form a similar question set; perform vocabulary processing on the user interaction text and all similar question texts in the similar question set.
[0061] In this embodiment, the word list processing is divided into two parts, one is keyword interception, and the other is the preprocessing of proprietary words, synonyms, similar words, must-have words and removed words. Keywords are stored in a hash structure, and each piece of data includes keywords, knowledge corresponding to keywords, and robot information; keyword matching rules include precise keyword matching and pre-fuzzy keyword matching. The precise keyword matching rule is that the user question and the keyword are exactly the same, and the pre-fuzzy keyword matching rule is that the user question contains the keyword, which means the match is successful. The priority of precise keyword matching is higher than that of pre-fuzzy keyword matching.
[0062] After the user interactive text is input, all keywords are first read from the knowledge base and matched among all precise keywords. If no match is found, they are matched among the preceding fuzzy keywords. If the preceding fuzzy keyword match results in multiple keywords being matched at the same time, the keyword with the longest matching length is selected. If the match is successful, the knowledge corresponding to the keyword is output. If no match is found, the preprocessing of proprietary words, synonyms, similar words, necessary words, and removed words is entered.
[0063] The preprocessing of proprietary words, synonyms, similar words, must-have words and removed words includes: proprietary words are generally business-related words, and are forcibly grouped together during the word segmentation process; synonyms and similar words replace irregular or typos in user questions with standardized business words. Synonyms are one-to-one structures, similar words are one-to-many, and one word can be expanded to multiple words; must-have words support both one-to-one and one-to-many structures, and play a filtering role in the candidate knowledge sorting process; removed words are used to remove some meaningless words that are irrelevant to the business and will not affect the meaning of the sentence after deletion.
[0064] In this embodiment, the word list of proprietary words, synonyms, similar words, must-have words and removed words is stored in ElasticSearch; each data in the word list contains the robot's index, word list type and words; a dictionary tree is established for proprietary words; for a user question, the proprietary word dictionary tree is first used to match the proprietary words in the user question using the longest match method; after the word segmentation is completed, the removed words are removed from the matching word segmentation results, and then synonyms and similar words are replaced to obtain the final word segmentation result of the input user question. In this embodiment, the word list processing process acts on all knowledge base outputs.
[0065] See also Figure 4 , Figure 4 It is a flowchart of the hierarchical intent capture process provided by an embodiment of the present invention.
[0066] In this embodiment, after obtaining the initial input standard sentence, the input user question is rewritten through natural language, and the input hierarchical intention capture method captures the user intention.
[0067] First, the similarity between the user questions and similar questions is compared through the coarse-grained intent screening layer. The similarity of the two sets is expressed by traversing all elements in the two sets and counting the number of identical elements in the two sets. The minimum hashing method is used to hash the standardized sentences of the user questions and the intent library in the knowledge base, and then the Jaccard similarity is calculated.
[0068] After the standard sentence user questions are coarsely filtered by intent, they are sent to the fine-grained intent capture layer, and the word vector network is used to extract the word vector of each word in the user questions and similar questions obtained by the coarse-grained intent filtering; the dot product of the word vectors is calculated word by word to obtain the word similarity score.
[0069] When two word vectors are exactly the same, the similarity score is 1, and if one of them is an unregistered word and is different from the other word, the similarity score is 0. In other cases, the dot product of the word vectors is calculated. Through the word vector similarity score function, the similarity scores of the word vectors in the user query and similar question posts are calculated in turn to obtain the word vector similarity matrix. The scores of each pair of user questions and similar questions are calculated using the scores of each row and column in the word vector similarity matrix. In order to solve the problem of the same user question and multiple similar questions having the same score, the distance calculation score is increased to reorder the similar questions.
[0070] Specifically, the intention coarse-grained screening layer is used to compare the similarity between the user questions and similar questions. It expresses the similarity of the sets by traversing all elements in the two sets and counting the number of identical elements in the two sets.
[0071] Optionally, due to the huge amount of knowledge and similar questions, the complexity of calculating the similarity between the user question and the entire set of similar questions is too high. Therefore, the minimum hash can be used to perform hash transformation on the standardized sentence of the user question and the intent library in the knowledge base, and then calculate the Jaccard similarity: ; Wherein, Jaccard(·) is the Jaccard similarity function, A is the hash transformation set of the user's standardized questions, and B is the hash transformation set of similar questions.
[0072] The intent fine-grained capture layer is used to extract the word vector of each word in the user question set A and the similar question set B obtained by the coarse-grained intent screening using the word vector network after the coarse-grained intent screening. For example, the word2vec network is used to obtain the word vector of each word in the user question and similar questions; the word vector is dot-producted word by word to obtain the word similarity score as follows: ; in, is the word vector similarity score function, and are the word vectors of user question a and similar question b, respectively. , When the two word vectors are exactly the same, the similarity score is 1, and if one of them is an unknown word and is different from the other word, it is 0. In other cases, the dot product of the word vectors is calculated.
[0073] The user asks a query consisting of n words: .
[0074] Similar question post consists of m words; .
[0075] Through the word vector similarity score function , calculate the similarity scores of the word vectors in the user question and similar questions in turn, and obtain the word vector similarity matrix Sim as follows: ; The scores of each pair of user questions and similar questions are calculated using the scores of each row and column in the word vector similarity matrix, that is: ; Among them, qsize represents the number of query words, and psize represents the number of post words.
[0076] To solve the problem that the same user question and multiple similar questions have the same score, the distance calculation score is added to re-rank the similar questions. The distance calculation includes: Distance1(query,post): Calculates the sum of the word vector distances (position differences) of the same words in the query and post. The formula is: ; in, Represents the word vector of the i-th word in the query, Indicates that the post Word vectors of the same words; Distance2(query,post): Calculate the number of the same words in the query and post. If the query and post are long sentences, the words in them are only calculated once. The formula is: ; in, represents the i-th word in the query, Indicates that the post The number of identical words, and Represents the query and post after text cleaning; Distance3(query,post): Calculates the number of identical words in the query and post, but does not perform cleaning before calculation, such as RemoveFiltered, and the formula is: ; Among them, the score range of Distance1, Distance2 and Distance3 distance scores is [0,1], and the sorting priority is arranged in the order of Distance1, Distance2, Distance3; after obtaining the accurately sorted similar questions list, according to the similar question score, the intent word features corresponding to the similar questions are sorted in descending order. If there are similar questions with the same similar question score, they are sorted in descending order according to the priority of the distance scores Distance1, Distance2, Distance3; select the top K candidate similar questions and corresponding intents from the descending list; construct user intent word features according to the corresponding intent; output user intent word features.
[0077] In the above step S230, the initial input standard sentence is sent to the key slot extraction module; the initial input standard sentence is captured by the key slot information and combined with the intention word feature to obtain the answer key-value pair, wherein the key slot information capture module receives the user's input. In this embodiment, the Phoenix Parser framework is used to extract the user's question such as money, time, traffic, business and other custom slot information. And configure the Grammer grammar when using it, configure the required slot extraction rules into frame framework files and grammar rule files according to business needs, and then compile and generate network grammar files. The key slot information capture module outputs and returns the key-value pair of [key]=[value] according to the network and text content to be parsed configured according to specific grammar and business needs. In this embodiment, for example, the user asks: Check the bill for February, and the key-value pair is output: [month]=202002.
[0078] In the above step S240, the intended word features and the answer key-value pairs are input into the language interaction control module, and a language interaction indication is output; the language interaction indication includes the reply domain, multi-round interaction status, reply form, reply intention and user information.
[0079] In this embodiment, interactive state tracking uses redis to save state data. Interactive state tracking maintains the user's previous round of status, including intention, entity, slot, user basic information, front-end channel type, and current dialogue node of the task flow. After the interactive control module is completed, the data is updated according to the corresponding key key. At the same time, the previous round of data is obtained before starting calculation and analysis for logical judgment.
[0080] In this embodiment, the interactive control module includes two parts: the central control (DialogBrain) and the task flow (TaskFlow). The central control is responsible for interacting with the upstream service through Thrift, receiving user questions, calling the hierarchical intent capture module and the key slot extraction module to parse the user question intent and slot value, and obtain the FAQ, TASK and chat intention scores and slot analysis results; according to the intent score, the preset threshold and the current task flow status, it is determined whether it is a FAQ intention, a task flow intention or a chat intention.
[0081] See also Figure 5 , Figure 5 It is a schematic diagram of an interactive control flow provided by an embodiment of the present invention.
[0082] In this embodiment, the user intention feature words are input into the intention scoring deep network to obtain the intention score, and the type of user intention is determined. If the task flow intention score is greater than the high-frequency question and answer intention score, the task flow is performed. If only the high-frequency question and answer intention score meets a preset higher threshold in the task flow process, the high-frequency question and answer is performed. Otherwise, if the slot meets the requirement to continue the task flow, prompt guidance is performed. When the user's question does not meet the task flow or high-frequency question and answer intentions but also meets a recommendation threshold, the intention recommendation is performed. If none of them are met, the chat intention is returned. If the chat intention is not met, a bottom-up recovery is performed.
[0083] The reply intent indicator is as follows: ; in, is the intention word feature, For mapping matching; in this embodiment, the reply field is matched in the knowledge base according to the answer key-value pair and the intention word feature, and the reply field indication is output; the multi-round interaction status and user information are tracked through the central control, and the user's multi-round interaction status flag and user information are extracted by redis, and the multi-round interaction status indication and user information indication are output; the reply form generates the corresponding reply form indication according to different reply intention indications and answer key-value pairs.
[0084] In some embodiments, when the reply intention is a task flow, the central control first extracts the task information, captures the task keywords in the user input, and matches the corresponding task process; then, the key slots in the user input are extracted according to the task process, and the business slot key information is captured; mapping and matching are performed in the knowledge base according to the business slot key information, and a reply form indication is generated.
[0085] See also Figure 6 , Figure 6 It is a schematic diagram of the TaskFlow execution process provided by an embodiment of the present invention.
[0086] In the input and output display, S represents system output and U represents user input. Figure 6 .
[0087] In this embodiment, if the reply intent is a high-frequency question-and-answer intent or a small talk intent, the knowledge base is directly queried and the answer is returned. If it is a task flow intent, the task flow module is called. First, the historical session is read from redis by the user ID. If the session is not empty, the dialog stack is updated according to the session status, and the top node of the dialog stack is continued to be executed in sequence and the slot value is updated. If the session is empty, the task flow is obtained from ElasticSearch according to the task flow intent, the task flow is organized in a tree form, the dialog stack is initialized, the task flow nodes to be executed are stacked in order, the top node of the dialog stack is executed in sequence and the slot value is updated. Finally, the corresponding reply form indication is generated and the task flow status is recorded.
[0088] In this embodiment, if the user's question is not one of the above three intentions, a fallback reply instruction is directly returned.
[0089] In the above step S250, the answer generation module generates a language interaction text based on the knowledge base according to the language interaction indication in step S240 and feeds it back to the user. First, the answer generation module saves the knowledge base standard question index, the corresponding answer to the standard question and the answer effectiveness channel; then the intention index, the standard question and its corresponding similar question index are input into the answer generation module; the corresponding pre-edited answer index is found in the knowledge base answer library through the index and channel encoding, and the answer is transmitted to the front end for display to the user.
[0090] See also Figure 7 , Figure 7 It is a schematic diagram of the system framework for executing a dialogue method based on hierarchical intent capture and interactive control provided by an embodiment of the present invention.
[0091] The system framework may include a knowledge base module, a vocabulary preprocessing module, a hierarchical intent capturing module, a key slot extraction module, an interaction control module and an answer generation module.
[0092] Specifically, the knowledge base module is configured to store data content, including vocabulary, intent library and answer library. The intent library includes standard questions and their corresponding similar questions and effective channels; the answer library includes business answers and effective channels; the knowledge base module can provide visual task flow configuration and configure standardized customer service processes; The vocabulary preprocessing module is used to obtain user interaction text as input, and use the dictionary tree method to build a vocabulary dictionary tree for the vocabulary in the knowledge base. The vocabulary dictionary tree includes a proprietary word dictionary tree, a synonym dictionary tree, a similar word dictionary tree, a removed word dictionary tree, a must-have word dictionary tree, and a keyword dictionary tree; the user interaction text is sequentially subjected to keyword detection, word segmentation, removed word deletion, similar word replacement, synonym replacement, and must-have word detection, and the interactive text is preprocessed through the vocabulary, and non-standard sentence patterns such as dialects and colloquialisms are converted into standard sentence patterns, and the initial input standard sentence is output; The hierarchical intent capture module is configured to send the initial input standard sentence to the hierarchical intent capture module, which includes a coarse-grained intent screening layer and a fine-grained intent capture layer. The coarse-grained intent screening layer uses the minimum hash algorithm to perform hash transformation on the initial input standard sentence and the intent library in the knowledge base, and then calculates the Jaccard similarity; the fine-grained intent capture layer obtains the top N items of the coarse-grained intent screening to perform intent sorting, converts the initial input standard sentence into a word vector, and calculates the text similarity with the intent filtered by the coarse-grained screening, and sorts the scores from high to low to obtain the user's intended word features; The key slot extraction module is configured to extract specific entities, slot values and other information in the text from the initial input standard sentence, and convert the extracted information into key-value pairs according to the network configured according to specific grammar and business requirements to obtain a number of key-value pairs.
[0093] The interaction control module is configured to input the user intention word features and key-value pairs into the interaction control module based on the interaction state, and output an interaction reply form indication.
[0094] The interactive control module based on the interactive state includes an interactive state tracking module and a session control module; the interactive state tracking module is configured to update the user state information and save the historical interactive state of the same user in the same session; the interactive state includes historical intent, entity, slot value and user basic information; the user basic information includes user phone number, login channel and front-end type; the session control module combines the user's intention word features, key-value pairs and interactive state to perform domain judgment, multi-round judgment, reply form judgment and interactive state update; the domain judgment uses the intention word features to determine whether the system is chatting, question and answer or multi-round interaction, and outputs the reply domain indication; the multi-round judgment uses the interactive state and key-value pairs to determine whether the next multi-round interactive state is satisfied, and outputs the multi-round state indication; the reply form judgment comprehensively considers the domain judgment output, the multi-round judgment output and the user's intention word features, determines whether to directly give an answer, provide the user with similar questions and suggestions or conduct multi-round dialogue guidance, and outputs the interactive reply form indication; the interactive state is updated when the interactive control module completes various judgment tasks, clarifies the next step of the system's instructions, and calls the interactive state tracking module to update the user's interactive state in this session; The answer generation module is configured to receive interaction indications, search and generate interaction text from the knowledge base according to the reply field indication, multi-round status indication, reply form indication, reply intention indication and user status information, and feed back to the user.
[0095] Through the above-mentioned manner, the intelligent language interaction method and system based on hierarchical intent capture and interactive control provided by the embodiment of the present invention accurately capture the user's question intent and key information through hierarchical intent capture and key slot information extraction, and realize multiple rounds of interaction with the user through language interactive control, so that the system has functions such as chatting, question and answer, and multiple rounds of dialogue, which solves the technical problem that in order to accurately identify the user's interaction intention in each round, the method of increasing training data or multiple rounds of large model interaction is often adopted in the prior art, but the increase of training and multiple rounds of interaction will lead to a significant increase in system computing resource consumption and interaction costs.
[0096] In addition, the natural language rewriting method designed in the present invention processes user input by using a vocabulary, so that the system can be robust to scenarios such as dialects and professional terms, and at the same time realizes real-time tuning of bad cases. Compared with the regular training model system in the prior art, it has better real-time and adaptability.
[0097] Finally, a concise knowledge base and task flow visualization configuration platform is provided to help users maintain the knowledge base and tasks, which simplifies the knowledge base maintenance and task flow configuration process and significantly reduces system costs.
[0098] The embodiments of the present invention can be applied in scenarios such as marketing, operation, and solving user problems. Whether the dialogue system in the intelligent dialogue can quickly and effectively meet user needs is the core value realization and goal of the intelligent dialogue system. The dialogue system proposed in the embodiments of the present invention can accurately capture user intentions, generate targeted dialogue replies and generate accurate user intention guidance, thereby improving system efficiency and user satisfaction. In the scenario where the intelligent dialogue system solves user problems, whether the dialogue system has memory ability, accurate reply ability, and smooth answers during the interaction process are important indicators of the interactive ability of the dialogue system. The interactive control method proposed in the technology of this application can achieve consistency and accuracy in user interaction, thereby reducing the cost of user interaction.
[0099] The present invention also provides a dialogue device based on hierarchical intent capture and interactive control. The dialogue device based on hierarchical intent capture and interactive control provided by the present invention is described below. The dialogue device based on hierarchical intent capture and interactive control described below and the dialogue method based on hierarchical intent capture and interactive control described above can be referenced to each other.
[0100] See also Figure 8 , Figure 88 is a schematic diagram of the structure of a dialogue device based on hierarchical intention capture and interactive control provided by an embodiment of the present invention. In this embodiment, the dialogue device based on hierarchical intention capture and interactive control includes an input module 810, an intermediate processing module 820 and an output module 830.
[0101] The input module 810 is used to rewrite the interactive text input by the user into natural language to obtain an initial input standard sentence.
[0102] The intermediate processing module 820 is used to perform intent capture and key slot capture processing on the initial input standard sentence to obtain intent word features and answer key-value pairs.
[0103] The output module 830 is used to obtain a language interaction indication after performing language interaction processing according to the intended word features and the answer key-value pairs, generate a language interaction text and feed it back to the user.
[0104] Based on any of the above embodiments, the intermediate processing module 820 may be specifically used for: The initial input standard sentence is processed for intent capture to obtain the intent word feature; the initial input standard sentence is processed for key slot capture, and combined with the intent word feature to obtain the answer key-value pair.
[0105] Based on any of the above embodiments, the initial input standard sentence is processed for intent capture to obtain the intent word features, including: The initial input standard sentence is input into the hierarchical intent capture module; the initial input standard sentence is processed by the hierarchical intent capture module through coarse-grained intent screening and fine-grained intent capture to obtain the intent word features.
[0106] Based on any of the above embodiments, the initial input standard sentence is processed by key slot capture, and combined with the intended word features, an answer key-value pair is obtained, including: The initial input standard sentence is input into the key slot extraction module. The key slot information of the initial input standard sentence is captured by the key slot extraction module and combined with the intended word features to obtain the answer key-value pair.
[0107] Based on any of the above embodiments, the output module 830 may be specifically used for: The intent word features and answer key-value pairs are input into the language interaction control module, which outputs language interaction instructions, which include reply domain, multi-round interaction status, reply form, reply intention and user information; the language interaction generation module generates language interaction text based on the language interaction instructions and the knowledge base and feeds it back to the user.
[0108] Based on any of the above embodiments, the intermediate processing module 820 may also be used for: Determine the intent type based on the features of the intent word, where the intent types include question-and-answer intent, task flow intent, or chat intent; and make interactive responses based on the intent type.
[0109] On the other hand, an embodiment of the present invention further provides an electronic device, see Fig. 9 , Fig. 9 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Fig. 9 As shown, the electronic device may include: the electronic device may include a memory 920, a processor 910, and a computer program stored in the memory 920 and executable on the processor 910. When the processor 910 executes the program, the dialogue method based on hierarchical intent capture and interactive control provided by the above methods is implemented.
[0110] Optionally, the electronic device may further include a communication bus 930 and a communication interface (CommunicationsInterface) 940, wherein the processor 910, the communication interface 940, and the memory 920 communicate with each other through the communication bus 930. The processor 910 may call a computer program in the memory 920 to execute a dialogue method based on hierarchical intent capture and interactive control, and the method may include: The interactive text input by the user is rewritten in natural language to obtain the initial input standard sentence; the initial input standard sentence is processed for intent capture and key slot capture to obtain the intent word features and answer key-value pairs; language interaction processing is performed based on the intent word features and answer key-value pairs to obtain language interaction instructions, generate language interaction text and feed it back to the user.
[0111] In addition, the logic instructions in the above-mentioned memory 920 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0112] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the dialogue method based on hierarchical intent capture and interactive control provided by the above-mentioned methods. Its steps and principles have been introduced in detail in the above-mentioned methods and will not be repeated here.
[0113] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the dialogue method based on hierarchical intent capture and interactive control provided by the above-mentioned methods. The steps and principles thereof have been introduced in detail in the above-mentioned methods and will not be repeated here.
[0114] Non-transitory computer-readable storage media can be any available media or data storage devices that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO)), optical storage (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drives (SSDs)), etc.
[0115] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0116] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A dialogue method based on hierarchical intention capture and interactive control, characterized in that: include: Rewrite the interactive text input by the user into natural language to obtain the initial input standard sentence; The initial input standard sentence is processed for intent capture and key slot capture to obtain intent word features and answer key-value pairs; After language interaction processing is performed according to the intended word features and the answer key-value pairs, a language interaction indication is obtained, and a language interaction text is generated and fed back to the user.
2. The dialogue method based on hierarchical intention capture and interactive control according to claim 1 is characterized in that: The initial input standard sentence is processed for intent capture and key slot capture to obtain intent word features and answer key-value pairs, including: Performing intent capture processing on the initial input standard sentence to obtain intent word features; The initial input standard sentence is processed by capturing key slots, and combined with the intended word features to obtain answer key-value pairs.
3. The dialogue method based on hierarchical intention capture and interactive control according to claim 2 is characterized in that: The initial input standard sentence is subjected to intention capture processing to obtain intention word features, including: The initial input standard sentence is input into the hierarchical intention capture module; the initial input standard sentence is processed by the hierarchical intention capture module for coarse-grained intention screening and fine-grained intention capture to obtain the intention word feature.
4. The dialogue method based on hierarchical intention capture and interactive control according to claim 2 is characterized in that: The key slot capture processing is performed on the initial input standard sentence, and combined with the intended word feature to obtain the answer key-value pair, including: The initial input standard sentence is input into the key slot extraction module, the key slot information of the initial input standard sentence is captured by the key slot extraction module, and combined with the intention word feature, the answer key-value pair is obtained.
5. The dialogue method based on hierarchical intention capture and interactive control according to claim 1 is characterized in that: The step of performing language interaction processing according to the intended word feature and the answer key-value pair to obtain a language interaction indication, generating a language interaction text and feeding it back to the user includes: Inputting the intention word feature and the answer key-value pair into a language interaction control module, the language interaction control module outputting the language interaction indication, wherein the language interaction indication includes a reply domain, a multi-round interaction state, a reply form, a reply intention and user information; The language interaction generation module generates the language interaction text according to the language interaction instruction and the knowledge base and feeds back to the user.
6. The dialogue method based on hierarchical intention capture and interactive control according to claim 5 is characterized in that: Also includes: Determine an intent type according to the intent word feature, wherein the intent type includes question-answering intent, task flow intent, or chat intent; Respond interactively based on the intent type.
7. A dialogue device based on hierarchical intention capture and interactive control, characterized in that: include: An input module is used to rewrite the interactive text input by the user into natural language to obtain an initial input standard sentence; An intermediate processing module, used for performing intent capture and key slot capture processing on the initial input standard sentence to obtain intent word features and answer key-value pairs; The output module is used to obtain a language interaction indication after performing language interaction processing according to the intended word features and the answer key-value pairs, generate a language interaction text and feed it back to the user.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements the dialogue method based on hierarchical intent capture and interactive control as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the dialogue method based on hierarchical intent capture and interactive control as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the dialogue method based on hierarchical intent capture and interactive control as described in any one of claims 1 to 6 is implemented.