A response method, device, server and storage medium

By constructing intention trees and intention chains, the problem of inaccurate answers when the intelligent response system responds to multiple intentions in a single sentence is solved, achieving more accurate responses and improving user experience.

CN111753063BActive Publication Date: 2024-10-22BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202010129533.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-28
Publication Date
2024-10-22
Estimated Expiration
2040-02-28

AI Technical Summary

Technical Problem

When existing intelligent response systems deal with multiple intentions in a single sentence, the answers are inaccurate and cannot effectively identify and match multiple intentions, resulting in the problem of words that do not convey the intended meaning.

Method used

By constructing an intention tree and an intention chain, the current business intention of the question to be answered is obtained, and the answer answer is generated based on the matching result of the intention tree and the intention chain, including the node answer and intention guidance of the last intention node, to improve the accuracy of the answer.

Benefits of technology

It improves the answer accuracy of the intelligent response system in the case of multiple intentions in a single sentence, ensuring the accuracy of the answer and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111753063B_ABST
    Figure CN111753063B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a response method, device, server and storage medium. The method includes: obtaining a question to be answered and preset data, wherein the preset data includes an intent tree, the intent tree is constructed according to the intent chain to be matched and the response answer to the intent chain to be matched, and the intent chain to be matched is constructed according to the historical response questions; identifying the current business intent of the question to be answered, if the number of current business intents is at least two, then obtaining the current intent chain of the question to be answered according to the current business intent; matching the current intent chain with the intent tree, and obtaining the response answer to the question to be answered according to the matching result. The technical solution of the embodiment of the present invention can solve the problem of inaccurate response answers when the question to be answered is a single sentence with multiple intents, and improves the accuracy of the response answers of the intelligent response system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer application technology, and in particular to a response method, device, server and storage medium. Background Art

[0002] After obtaining the questions to be answered raised by the user, the intelligent answering system can classify the user's intention for the question through natural language understanding (NLU). If it is a policy consultation question, the question-answering robot (QABot) will be used to answer it. Otherwise, the task-based robot (TaskBot) will be used for multiple rounds of interactive answers. TaskBot can match and output the answer based on the identified user's intention in the conversation management (DM). If the user's intention is ambiguous, intention guidance can be performed. For example, as shown in Table 1.

[0003] In the process of implementing the present invention, the inventors found that the following technical problems exist in the prior art: NLU can only identify the user's main intention of the question to be answered, that is, the user's single intention. At this time, when the question to be answered is a single sentence with multiple intentions, the response answer is still the response answer matched according to the user's main intention, which will lead to problems such as inadequate words and inaccurate responses, as shown in Table 2 for example.

[0004] Table 1 Example of TaskBot response

[0005]

[0006] Table 2 Examples of single sentence with multiple intents

[0007] Summary of the invention

[0008] The embodiments of the present invention provide a response method, device, server and storage medium, which solve the problem of inaccurate response answers when the question to be answered is a single sentence with multiple intents.

[0009] In a first aspect, an embodiment of the present invention provides a response method, which may include:

[0010] Obtaining questions to be answered and preset data, wherein the preset data includes an intent tree, which is constructed based on the intent chain to be matched and the answers to the intent chain to be matched, and the intent chain to be matched is constructed based on historical answers to the questions;

[0011] Identify the current business intent of the question to be answered, and if the number of the current business intents is at least two, obtain the current intent chain of the question to be answered according to the current business intent;

[0012] Match the current intent chain with the intent tree, and obtain the answer to the question based on the matching result.

[0013] Optionally, the answer to the question to be answered is obtained based on the matching result, which may include:

[0014] In the intent tree, if the number of matched intent chains that matches the current intent chain is one, the node answer corresponding to the last intent node of the matched intent chain is used as the answer to the question to be answered, or the first intent guide is generated according to the sub-intent node of the last intent node, and the first intent guide and the node answer are used as the answer to the question to be answered;

[0015] If the number of matched intent chains is at least two, a second intent guidance is generated according to the sub-intent node of the last intent node of each matched intent chain, and the second intent guidance is used as the answer to the question to be answered.

[0016] Optionally, the preset data further includes preset mapping data, the preset mapping data including a mapping relationship between historical word segments and historical intentions of historical answer questions;

[0017] Identify the current business intent of the question being answered, which may include:

[0018] Obtain the user's main intention and the first word segmentation result of the question to be answered, filter out the initial intention of the question to be answered from multiple historical intentions according to the first word segmentation result and preset mapping data, and filter out the target intention that matches the user's main intention from each initial intention;

[0019] According to the preset mapping data, the target word segmentation results corresponding to the target intent in the question to be answered are generalized, and the question to be answered is updated according to the generalization results;

[0020] The steps of obtaining the user's main intention of the question to be answered and the first word segmentation result are repeatedly performed until the user's main intention is non-business intention, so as to obtain the current business intention of the question to be answered.

[0021] Optionally, the preset mapping data may be pre-generated by the following steps:

[0022] Obtain the second word segmentation results in the historical answer questions, calculate the intention weight of each second word segmentation result, and filter out the historical word segmentation from each second word segmentation result according to the calculation result;

[0023] Generate preset mapping data based on the historical segmentation and the historical intention of the historical answer question where the historical segmentation is located.

[0024] Optionally, calculating the intent weight IntentWeight(w) of the current word segmentation result w in each second word segmentation result may include:

[0025] Get the number of times w appears in each historical answer question WordTotal(w) and the number of historical answer questions that contain w and have an intention Itent(w);

[0026] According to WordTotal(w) and Itent(w), IntentWeight(w) of w is calculated by the following formula:

[0027] IntentWeight(w)=WordTotal(w) / Itent(w)*lg(Itent(w)).

[0028] Optionally, the intent tree can be pre-constructed by following the steps below:

[0029] For the target historical questions with intent in the historical answer questions, based on the questioning order of each target historical question, a to-be-matched intent chain is constructed according to the historical intent of each target historical question, and an intent tree is constructed based on the to-be-matched intent chain and the answer to the to-be-matched intent chain.

[0030] Optionally, the current intent chain of the question to be answered is obtained according to the current business intent, which may include:

[0031] At least two current business intentions are fully sorted, and the current intention chain of the question to be answered is obtained according to the full sorting result.

[0032] Optionally, the current intent chain of the question to be answered is obtained according to the current business intent, which may include:

[0033] If there is a first answered intention or a first answered intention chain in the current answering session where the question to be answered is located, the current intention chain of the question to be answered is obtained according to the current business intention and the first answered intention or the first answered intention chain.

[0034] Optionally, based on the above method, the method may further include:

[0035] If the current number of business intentions is one, and there is a second answered intention or a second answered intention chain in the current answer session where the question to be answered is located, then the current intention chain of the question to be answered is obtained based on the current business intention and the second answered intention or the second answered intention chain.

[0036] In a second aspect, an embodiment of the present invention further provides a response device, which may include:

[0037] An acquisition module is used to acquire questions to be answered and preset data, wherein the preset data includes an intent tree, the intent tree is constructed based on the intent chain to be matched and the answer to the intent chain to be matched, and the intent chain to be matched is constructed based on historical answer questions;

[0038] A obtaining module is used to identify the current business intent of the question to be answered, and if the number of the current business intents is at least two, obtain the current intent chain of the question to be answered according to the current business intent;

[0039] The answer module is used to match the current intent chain with the intent tree and obtain the answer to the question based on the matching result.

[0040] In a third aspect, an embodiment of the present invention further provides a server, which may include:

[0041] one or more processors;

[0042] A memory for storing one or more programs;

[0043] When one or more programs are executed by one or more processors, the one or more processors implement the response method provided by any embodiment of the present invention.

[0044] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the response method provided by any embodiment of the present invention.

[0045] The technical solution of the embodiment of the present invention obtains the question to be answered and identifies the current business intent of the question to be answered. This current business intent can present the current intent of all the substantive businesses of the question to be answered; when the number of current business intents is at least two, the current intent chain of the question to be answered can be obtained according to the current business intent, and the current intent chain and the intent tree can be fully matched. Since the intent tree is constructed according to the intent chain to be matched and the answer to the intent chain to be matched, the answer to the question to be answered can be obtained according to the matching result. The above technical solution solves the problem of inaccurate answer when the question to be answered is a single sentence with multiple intents, and improves the accuracy of the answer of the intelligent answering system. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 is a flow chart of a response method in Embodiment 1 of the present invention;

[0047] Figure 2a This is a first schematic diagram of an intent tree in a response method in Embodiment 1 of the present invention;

[0048] Figure 2b This is a second schematic diagram of an intent tree in a response method in Embodiment 1 of the present invention;

[0049] Figure 3 is a flow chart of a response method in Embodiment 2 of the present invention;

[0050] Figure 4a It is a structural block diagram of a preferred embodiment of a response method in Embodiment 2 of the present invention;

[0051] Figure 4b It is a flow chart of a preferred embodiment of a response method in Embodiment 2 of the present invention;

[0052] Figure 5 is a structural block diagram of a response device in Embodiment 3 of the present invention;

[0053] Figure 6 It is a structural diagram of a server in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0054] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It is also necessary to explain that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0055] Embodiment 1

[0056] Figure 1 This is a flow chart of a response method provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of responding to a single sentence with multiple intentions to be answered. The method can be executed by a response device provided in an embodiment of the present invention, which can be implemented by software and / or hardware, and can be integrated in various user terminals or servers.

[0057] See also Figure 1 The method of the embodiment of the present invention specifically includes the following steps:

[0058] S110. Obtain questions to be answered and preset data, wherein the preset data includes an intent tree, the intent tree is constructed based on intent chains to be matched and answers to the intent chains to be matched, and the intent chains to be matched are constructed based on historical answered questions.

[0059] Among them, the questions to be answered and the preset data are obtained. The questions to be answered may be questions to be answered by the user, and the preset data may be pre-set data, such as an intent tree, preset mapping data, etc. The intent tree may be pre-constructed according to the intent chain to be matched and the answer to the intent chain to be matched, and the intent chain to be matched may be pre-constructed according to the historical answer questions.

[0060] Exemplarily, taking the historical answer questions involved in a historical answer session of a user in the intelligent answer system, especially the target historical questions with intentions in the historical answer questions as an example, based on the questioning order of each target historical question, the intention chain to be matched can be constructed according to the historical intention of each target historical question. The historical intention of this target historical question can be obtained in advance through a preset intention classification model, and this preset intention classification model can be a convolutional neural network (CNN) model, a recurrent neural network (RNN) model, etc. In this way, a historical answer session of a user may construct an intention chain to be matched. When there are multiple historical answer sessions, multiple intention chains to be matched can be constructed, and these multiple intention chains can construct multiple intention trees without configured answer answers according to overlapping intentions. On this basis, after configuring the corresponding answer answer for the intention chain to be matched in the intention tree, multiple intention trees with configured answer answers can be obtained. For example, the intent chains to be matched are [invoice and reimbursement] → [refund Jingdou], [invoice and reimbursement] → [refund red envelope], and [logistics abnormality consultation] → [after-sales freight]. Among them, "invoice and reimbursement" is an overlapping intent. After configuring the corresponding response answer for each intent chain to be matched, the following can be generated: Figure 2a The intent tree shown, Figure 2a There are two intent trees included.

[0061] Specifically, in practical applications, optionally, on the one hand, the target historical questions can also be those historical answer questions in the historical answer sessions that require manual transfer, because these historical answer sessions that require manual transfer are mostly situations where users are dissatisfied with their answers, and the target historical questions are more likely to have multiple intents in a single sentence, and the optimization of such historical answer sessions is more targeted. On the other hand, the historical intents, the intent chains to be matched, and the intent trees without configured answers can be cleaned. For example, for the historical intents of the target historical questions, non-business intents such as no intent, ambiguous intent, and transfer to manual intent can be eliminated, and then the intent chains to be matched can be constructed based on the elimination results; for example, for each of the intent chains to be matched that have been obtained, the heat of each intent chain to be matched can also be counted, for example, the number of occurrences of each intent chain to be matched is counted, and those intent chains to be matched whose heat is greater than a preset heat threshold are retained; for another example, the branches without business answer requirements can be first eliminated from the intent tree without configured answers, and answers can be configured on the branches with business answer requirements; and so on.

[0062] S120: Identify the current business intent of the question to be answered, and if the number of the current business intent is at least two, obtain the current intent chain of the question to be answered according to the current business intent.

[0063] Among them, the current business intent of the question to be answered is identified. For example, it can be identified based on recursive intent recognition and intent word generalization, or it can be identified based on other methods, which are not specifically limited here. The number of current business intents can be one or more, which can present all the current intents of the question to be answered that have substantive business, such as logistics abnormality consultation, red envelope refund, after-sales freight, etc. In practical applications, the current intent of the question to be answered can be identified first. The current intent can include the current business intent and the current non-business intent. The current non-business intent is the current intent that does not have substantive business, such as no intent, intent model, transfer to manual intent, etc.; then, the current business intent is filtered out from the current intent. The significance of setting the current business intent is that, under normal circumstances, the intent chain to be matched in the intent tree is composed of various business intents, which usually do not include non-business intents. This is because non-business intents will interfere with the recognition of multiple intents in a single sentence and have no substantive meaning. Therefore, the current intent chain can be constructed according to the current business intent.

[0064] On this basis, when the number of current business intentions is at least two, the current intention chain of the question to be answered can be obtained according to the current business intention. The number of the current intention chain can be one or more. For example, a current intention chain can be constructed based on the recognition order of the current business intention. The advantage of this setting is that it can simplify the operation; for another example, at least two current business intentions can be fully sorted, and at least two current intention chains of the question to be answered can be obtained according to the full sorting results. The advantage of this setting is that it can improve the recognition accuracy of multiple intentions in a single sentence. For example, if the current business intentions are "issuing invoices and reimbursement" and "refunding Beijing beans", the current intention chains can be [issuing invoices and reimbursement]→[refunding Beijing beans] and [refunding Beijing beans]→[issuing invoices and reimbursement].

[0065] S130: Match the current intent chain with the intent tree, and obtain the answer to the question to be answered based on the matching result.

[0066] Among them, the current intent chain and the intent tree are matched. Optionally, the current intent chain and the intent tree can be matched based on the KMP (Knuth-Morris-Pratt) algorithm, and the answer to the question to be answered is obtained according to the matching result. In practical applications, the matching results may include a variety of situations, and different strategies can be used to obtain the answer to the question to be answered in different situations. It should be noted that the following situations to be explained are only possible situations in the matching results, which are only exemplary descriptions and are not specific limitations on the matching results.

[0067] Case 1) If no matched intent chain that completely matches the current intent chain is found in the intent tree, that is, the intent tree matching fails, then the answer to the question to be answered can be directly obtained based on the user's main intention of the question to be answered. For example, the question to be matched corresponding to the user's main intention can be searched in the preset question-and-answer knowledge base, and the answer to the question to be matched can be used as the answer to the question to be answered.

[0068] Case 2a) If a matched intent chain is matched in the intent tree, the node answer corresponding to the last intent node of the matched intent chain can be used as the answer to the question to be answered. For example, if the current business intent is "logistics abnormality consultation" and "after-sales freight", the current intent chain can be [logistics abnormality consultation] → [after-sales freight] and [after-sales freight] → [logistics abnormality consultation]. Figure 2b In the intent tree shown, the matched intent chain that completely matches the current intent chain is [Logistics Abnormality Consultation] → [After-sales Freight]. Then, the last intent node of the matched intent chain is [After-sales Freight]. The node answer corresponding to [After-sales Freight] is "Hello, if the mistake is caused by the seller, the round-trip freight is borne by the seller. If the seller refuses to bear it, you can complain", which can be used as the response to the question to be answered.

[0069] Case 2b) On this basis, since the matched intent chain can be a part of a certain intent tree, on this intent tree, if the last intent node of the matched intent chain still has a child intent node, this child intent node is an intent node on the intent tree rather than an intent node on the matched intent chain, then the first intent guidance can also be generated according to the child intent node of the last intent node, and the node answers corresponding to the first intent guidance and the last intent node can be used as the answers to the questions to be answered at the same time. This first intent guidance can guide the user's intent for potential questions to be answered. Of course, if there is no corresponding node answer to the last intent node, only the first intent guidance can be used as the answer to the question to be answered. For example, continuing with the above example, in the case Figure 2b In the intent tree shown, the matched intent chain that fully matches the current intent chain is [Logistics Abnormality Consultation] → [After-sales Freight]. At this time, its last intent node [After-sales Freight] also has a corresponding child intent node [Complaint about the Merchant]. Therefore, the first intent guidance "You may also want to consult: How to complain about the merchant?" can be generated based on [Complaint about the Merchant].

[0070] Case 3) If the number of matched intent chains is at least two, then multiple matched intent chains may not be able to determine a unique node answer. Therefore, a second intent guidance can be generated based on the sub-intent node of the last intent node of each matched intent chain, and the second intent guidance can be used as the answer to the question to be answered. It should be noted that compared to the prior art, which only provides intent guidance when the intent is ambiguous, the above-mentioned first intent guidance and / or second intent guidance settings can provide intent guidance for potential questions to be answered while giving the answer, which can significantly improve the answering experience of the intelligent answering system.

[0071] The technical solution of the embodiment of the present invention obtains the question to be answered and identifies the current business intent of the question to be answered. This current business intent can present the current intent of all the substantive businesses of the question to be answered; when the number of current business intents is at least two, the current intent chain of the question to be answered can be obtained according to the current business intent, and the current intent chain and the intent tree can be fully matched. Since the intent tree is constructed according to the intent chain to be matched and the answer to the intent chain to be matched, the answer to the question to be answered can be obtained according to the matching result. The above technical solution solves the problem of inaccurate answer when the question to be answered is a single sentence with multiple intents, and improves the accuracy of the answer of the intelligent answering system.

[0072] On this basis, a possible application scenario is that in the current answering session, the user is likely to ask multiple questions to be answered in sequence, and the intentions of these multiple questions to be answered are continuously related intentions. At this time, the prior art usually directly gives the answer according to the user's main intention (that is, the intention recognition result) of each question to be answered, without considering the intention correlation between these multiple questions to be answered, which will cause the problem of inaccurate words and inaccurate answers. For example, as shown in Table 3, the answer to the second round of answers does not refer to the answer to the first round of answers, that is, the two rounds of answers are independent of each other and there is no correlation. Therefore, in response to the problem of inaccurate answers to multiple rounds of continuously related intentions, the embodiment of the present invention proposes a technical solution to construct the current intention chain by assembling the answered intention / answered intention chain and the current business intention. It is based on single-sentence multi-intention recognition and can support multiple rounds of multi-intention answers. The specific implementation process of the technical solution is described as follows. It should be noted that there may or may not be continuous related intentions for each round of questions to be answered. However, this can be done by first constructing the current intention chain based on the above solution and matching the current intention chain with the intention tree. At this time, if the match is successful (i.e., there are continuous related intentions for each round of questions to be answered), the answers to the questions to be answered can be given according to the corresponding node answers and / or intention guidance in the intention tree; if the match fails (i.e., there are no continuous related intentions for each round of questions to be answered), the answers to the questions to be answered can be directly obtained according to the current business intentions of the questions to be answered.

[0073] Table 3 Examples of continuous related intents

[0074]

[0075] On this basis, an optional technical solution is that in the current answering session, for each question to be answered, the intelligent answering system will give a corresponding answer. At this time, the question to be answered can be transformed into an answered question, and the current business intention of the question to be answered can be transformed into an answered intention. Therefore, in the current answering session, if there is a question to be answered and at least one answered question with an intention, that is, there is a first answered intention of the answered question (that is, the number of the first answered intention is one, which cannot constitute a first answered intention chain) or a first answered intention chain (that is, the number of the first answered intention is at least two, which can constitute a first answered intention chain), then the current intention chain of the question to be answered is obtained according to the current business intention, which may specifically include: according to the current business intention, and the first answered intention or the first answered intention chain, the current intention chain of the question to be answered is obtained. For example, if the first responded intent is "return and exchange consultation", and the current business intent is "invoicing and reimbursement" and "return of Jingdou", then the current intent chain can be [return and exchange consultation] → [invoicing and reimbursement] → [return of Jingdou] and [return and exchange consultation] → [return of Jingdou] → [invoicing and reimbursement].

[0076] Correspondingly, optionally, if the number of current business intentions is one, and there is no second answered intention or second answered intention chain in the current answering session where the question to be answered is located, that is, there is no answered question with intention in the current answering session, then the current intention chain cannot be formed at this time, and the answer to the question to be answered can be directly obtained according to the user's main intention of the question to be answered. Optionally again, if the number of current business intentions is one, and there is a second answered intention or a second answered intention chain in the current answering session where the question to be answered is located, the current intention chain of the question to be answered can be obtained according to the current business intention, and the second answered intention or the second answered intention chain. Exemplarily, if the second answered intention chain is [Modify order] → [Modify order address], and the current business intention is "Cancel order", then the current intention chain is [Modify order] → [Modify order address] → [Cancel order].

[0077] Embodiment 2

[0078] Figure 3It is a flow chart of an answering method provided in the second embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, the preset data may also include preset mapping data, and the preset mapping data may include a mapping relationship between historical word segmentation and historical intent of historical answer questions; accordingly, identifying the current business intent of the question to be answered may specifically include: obtaining the user's main intention and the first word segmentation result of the question to be answered, filtering out the initial intention of the question to be answered from multiple historical intents according to the first word segmentation result and the preset mapping data, and filtering out the target intention matching the user's main intention from each initial intention; generalizing the target word segmentation result corresponding to the target intention in the question to be answered according to the preset mapping data, and updating the question to be answered according to the generalized result; repeating the steps of obtaining the user's main intention and the first word segmentation result of the question to be answered until the user's main intention is a non-business intention, so as to obtain the current business intention of the question to be answered. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.

[0079] See also Figure 3 The method of this embodiment may specifically include the following steps:

[0080] S210. Obtain questions to be answered and preset data, wherein the preset data includes an intent tree and preset mapping data. The intent tree is constructed based on the intent chain to be matched and the response answers to the intent chain to be matched. The intent chain to be matched is constructed based on historical answered questions. The preset mapping data includes the mapping relationship between historical word segmentations of historical answered questions and historical intents.

[0081] Among them, the preset mapping data may include a mapping relationship between historical word segmentation and historical intent of the historical answer question, and this mapping relationship may be one-to-one, one-to-many, many-to-one and / or many-to-many. For example, each historical word segmentation may correspond to at least one historical intent, and each historical intent may also correspond to at least one historical word segmentation. On this basis, optionally, the preset mapping data can be pre-generated by the following steps: first, the historical answer question is segmented, for example, the historical answer question can be segmented by Jieba, Pangu, Yaha, Tsinghua THULAC, etc., to obtain the second word segmentation result in the historical answer question, which can be a user corpus selected from the online conversation corpus of the intelligent answer system, especially a user corpus with intent; calculate the intent weight of each second word segmentation result, and select the historical word segmentation from each second word segmentation result according to the calculation result, for example, the second word segmentation result with an intent weight greater than the preset weight threshold can be used as the historical word segmentation; generate the preset mapping data according to the historical word segmentation and the historical intent of the historical answer question where the historical word segmentation is located, and the preset mapping data can be a word segmentation intent mapping table, exemplarily, as shown in Table 4. It should be noted that each historical answer question may have one or more historical segmentation words, which correspond to the same historical intent. Whether there is an intent in the historical answer question and what the intent is can be obtained in advance through a preset intent classification model, which can be a Convolutional Neural Network (CNN) model, a Recurrent Neural Network (RNN) model, etc.

[0082] Table Four-part word intention mapping table

[0083] Second participle result Historical Intentions change Modify order Revise Modify order address Order Modify order address Modify order address Delivery Modify order address …… ……

[0084] On this basis, optionally, the intent weight IntentWeight(w) of the current word segmentation result w in each second word segmentation result is calculated, which may specifically include: obtaining the number of times w appears in each historical answer question WordTotal(w) and the number of historical answer questions Itent(w) that contain w and have intent; based on WordTotal(w) and Itent(w), calculating IntentWeight(w) of w by the following formula: IntentWeight(w) = WordTotal(w) / Itent(w)*lg(Itent(w)).

[0085] S220, obtaining the user's main intention and the first word segmentation result of the question to be answered, filtering out the initial intention of the question to be answered from multiple historical intentions based on the first word segmentation result and preset mapping data, and filtering out the target intention that matches the user's main intention from each initial intention.

[0086] Among them, the user's main intention of the question to be answered can be obtained through a preset intention classification model, and the first word segmentation result of the question to be answered can be obtained through jieba word segmentation, Pangu word segmentation, Yaha word segmentation, Tsinghua THULAC, etc. Filter out the filtered word segmentation results belonging to historical word segmentation from the first word segmentation result according to the preset mapping data, and filter out the historical intentions corresponding to each filtered word segmentation result from the multiple historical intentions of the preset mapping data, which can be used as the initial intention of the question to be answered, and the number of these initial intentions can be one or more. Then, compare each initial intention with the user's main intention to filter out the target intention that completely matches the user's main intention from each initial intention.

[0087] S230. According to preset mapping data, generalize the target word segmentation result corresponding to the target intent in the question to be answered, and update the question to be answered according to the generalization result.

[0088] Among them, according to the preset mapping data, the target word segmentation result corresponding to the target intent is screened out from the first word segmentation result, which is the intent word related to the user's main intention. The target word segmentation result is generalized. For example, the target word segmentation result can be generalized to "IntentWord". Of course, "IntentWord" is just an example. In the preset intent classification model, "IntentWord" can be any word that has never appeared or rarely appears in the model training set. Such words have the least impact on the preset intent classification model when identifying intent. Of course, if there is no target word segmentation result, it means that each first word segmentation result in the question to be answered does not need to be generalized.

[0089] S240, repeatedly executing the step of obtaining the user's main intention of the question to be answered and the first word segmentation result until the user's main intention is non-business intention, so as to obtain the current business intention of the question to be answered.

[0090] Among them, the above steps are repeatedly executed. When the user's main intention is a non-business intention, this repeated execution process can be exited, and the current business intention of the question to be answered is determined according to each target intention that appears in the repeated execution process. Exemplarily, as shown in Table 5, if the question to be answered is "I have issued a VAT invoice, can I still refund Jingdou?", the target word segmentation result obtained according to the above steps is "issue, VAT, invoice", and the user's main intention is a business intention, then "issue, VAT, invoice" in the question to be answered can be generalized to obtain "IntentWord IntentWord IntentWord, can I still refund Jingdou?"; repeat the execution until it is identified that the user's main intention of "IntentWord IntentWord IntentWord, can I still IntentWord?" is non-intentional (one of non-business intentions), jump out of this repeated execution process, and obtain the current business intention "issue, VAT, invoice, refund Jingdou" according to the target word segmentation result in each repeated execution process.

[0091] Table 5. Examples of identifying current business intent in questions to be answered

[0092]

[0093] S250. If the number of current business intentions is at least two, obtain the current intention chain of the question to be answered according to the current business intention, match the current intention chain with the intention tree, and obtain the answer to the question to be answered according to the matching result.

[0094] The technical solution of the embodiment of the present invention can screen out the initial intent of the question to be answered from multiple historical intentions based on the first word segmentation result of the question to be answered and preset mapping data, and then screen out the target intent that matches the user's main intention of the question to be answered from each initial intention; thereby, the target word segmentation result corresponding to the target intent in the question to be answered can be generalized according to the preset mapping data, and this target word segmentation result is an intention word related to the user's main intention, and the question to be answered is updated according to the generalization result; this process is repeated until the user's main intention is a non-business intention, thereby accurately determining the current business intention of the question to be answered based on each target intention that appears during the repeated execution process.

[0095] In order to better understand the specific implementation process of the above steps, the following is an exemplary description of the response method of this embodiment with reference to a specific example. Figure 4a and Figure 4bAs shown, first, the data initialization module can extract online user corpora, especially those online user corpora that require manual conversion, and clean the online user corpora to eliminate non-business intentions such as no intent, ambiguous intent, and manual conversion intent, and construct the remaining business intents in sequence to form a to-be-matched intent chain with a heat greater than a preset heat threshold; retain the to-be-matched intent chains that have business response requirements, and configure corresponding response answers for these retained to-be-matched intent chains, and construct an intent tree according to the overlapping intents.

[0096] Secondly, for the questions to be answered raised by the user, the current intention chain identification module can identify the user's main intention for the questions to be answered, and when the user's main intention is a non-business intention, generalize the target word segmentation result in the question to be answered. This target word segmentation result is an intention word related to the user's main intention. Repeat this process until the user's main intention is a non-business intention, filter out the various non-business intentions involved in the repeated execution process, and obtain the current intention. At this time, the following situations may occur: there is no business intention in the current intention (that is, each user's main intention is a non-business intention), and answer directly based on the current intention; or, there is a business intention in the current intention, then the current intention chain can be constructed based on the current intention, or based on the current intention and the historical intention / historical intention chain.

[0097] Again, after receiving the current intent chain, the intent tree response module can compare the current intent chain and the intent tree based on the KMP algorithm and output the matching result. If the matching result is a successful match, the corresponding intent guidance and / or node answer can be output according to the matching result; otherwise, a direct response can be given based on the current intent. The technical solution of the embodiment of the present invention identifies multiple intents in a single sentence based on recursive intent recognition and generalization of intent words, and responds and provides intent guidance for multiple rounds of related continuous intents by assembling the current intent chain and matching the intent tree based on the KMP algorithm, thereby achieving accurate responses and intent guidance for multiple intents in a single sentence and multiple rounds of continuous related intents, and improving the user experience of the intelligent response system.

[0098] Embodiment 3

[0099] Figure 5 This is a structural block diagram of a response device provided in Embodiment 3 of the present invention. The device is used to execute the response method provided in any of the above embodiments. The device and the response method of the above embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the response device, refer to the embodiment of the above response method. Figure 5 The device may specifically include: an acquisition module 310, a obtaining module 320 and a response module 330.

[0100] The acquisition module 310 is used to acquire questions to be answered and preset data, wherein the preset data includes an intent tree, the intent tree is constructed based on the intent chain to be matched and the answer to the intent chain to be matched, and the intent chain to be matched is constructed based on the historical answer questions;

[0101] The obtaining module 320 is used to identify the current business intention of the question to be answered, and if the number of the current business intentions is at least two, obtain the current intention chain of the question to be answered according to the current business intention;

[0102] The answer module 330 is used to match the current intention chain with the intention tree and obtain the answer to the question to be answered according to the matching result.

[0103] Optionally, the response module 330 may specifically include:

[0104] A first answering unit is used for, in the intent tree, if the number of matched intent chains matching the current intent chain is one, using the node answer corresponding to the last intent node of the matched intent chain as the answer to the question to be answered, or generating a first intent guide according to the sub-intent node of the last intent node, and using the first intent guide and the node answer as the answer to the question to be answered;

[0105] The second answering unit is used to generate a second intention guidance according to the sub-intention node of the last intention node of each matched intention chain if the number of matched intention chains is at least two, and use the second intention guidance as the answer to the question to be answered.

[0106] Optionally, the preset data further includes preset mapping data, and the preset mapping data includes a mapping relationship between historical word segments and historical intentions of historical answer questions; obtaining module 320 may specifically include:

[0107] A target intent screening unit is used to obtain the user's main intent and the first word segmentation result of the question to be answered, screen the initial intent of the question to be answered from multiple historical intents according to the first word segmentation result and preset mapping data, and screen the target intent matching the user's main intent from each initial intent;

[0108] The waiting-to-be-answered question updating unit is used to generalize the target word segmentation result corresponding to the target intent in the waiting-to-be-answered question according to the preset mapping data, and update the waiting-to-be-answered question according to the generalization result;

[0109] The current business intention obtaining unit is used to repeatedly execute the steps of obtaining the user's main intention of the question to be answered and the first word segmentation result until the user's main intention is non-business intention, so as to obtain the current business intention of the question to be answered.

[0110] Optionally, based on the above device, the device may further include:

[0111] The historical word segmentation screening module is used to obtain the second word segmentation results in the historical answer questions, calculate the intention weight of each second word segmentation result, and screen out the historical word segmentation from each second word segmentation result according to the calculation result;

[0112] The preset mapping data generation module is used to generate preset mapping data according to the historical segmentation and the historical intention of the historical answer question where the historical segmentation is located.

[0113] Optional, historical word segmentation filtering module, which can be used for:

[0114] Get the number of times w appears in each historical answer question WordTotal(w) and the number of historical answer questions that contain w and have an intention Itent(w);

[0115] According to WordTotal(w) and Itent(w), IntentWeight(w) of w is calculated by the following formula:

[0116] IntentWeight(w)=WordTotal(w) / Itent(w)*lg(Itent(w)).

[0117] Optionally, based on the above device, the device may further include:

[0118] The intention tree construction module is used to construct a to-be-matched intention chain according to the historical intentions of each target historical question based on the questioning order of each target historical question for the target historical question that has intention in the historical answer question, and to construct an intention tree based on the to-be-matched intention chain and the answer to the to-be-matched intention chain.

[0119] Optionally, obtaining module 320 may include:

[0120] The first current intention chain obtaining unit is used to fully sort at least two current business intentions and obtain the current intention chain of the question to be answered according to the full sorting result.

[0121] Optionally, obtaining module 320 may include:

[0122] The second current intention chain obtaining unit is used to obtain the current intention chain of the question to be answered based on the current business intention and the first answered intention or the first answered intention chain if there is a first answered intention or a first answered intention chain in the current answering session where the question to be answered is located.

[0123] Optionally, based on the above device, the device may further include:

[0124] Then obtain a module, which is used to obtain the current intention chain of the question to be answered based on the current business intention and the second answered intention or the second answered intention chain if the number of current business intentions is one and there is a second answered intention or a second answered intention chain in the current answer session where the question to be answered is located.

[0125] The answering device provided in the third embodiment of the present invention can obtain the question to be answered through the acquisition module, and identify the current business intent of the question to be answered, and this current business intent can present the current intent of all the existing substantive business of the question to be answered; when the number of current business intents is at least two, the acquisition module can obtain the current intent chain of the question to be answered according to the current business intent; the answering module can completely match the current intent chain with the intent tree, because the intent tree is constructed according to the intent chain to be matched and the answer to the intent chain to be matched, the answer to the question to be answered can be obtained according to the matching result. The above device solves the problem of inaccurate answer when the question to be answered is a single sentence with multiple intents, and improves the accuracy of the answer of the intelligent answering system.

[0126] The response device provided in the embodiment of the present invention can execute the response method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0127] It is worth noting that in the embodiment of the above-mentioned response device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0128] Embodiment 4

[0129] Figure 6 A schematic diagram of the structure of a server provided in Embodiment 4 of the present invention is shown in FIG. Figure 6 As shown, the server includes a memory 410, a processor 420, an input device 430, and an output device 440. The number of processors 420 in the server can be one or more. Figure 6 A processor 420 is used as an example; the memory 410, the processor 420, the input device 430 and the output device 440 in the server can be connected via a bus or other means. Figure 6 The connection via bus 450 is taken as an example.

[0130] The memory 410, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the response method in the embodiment of the present invention (for example, the acquisition module 310, the obtaining module 320 and the response module 330 in the response device). The processor 420 executes various functional applications and data processing of the server by running the software programs, instructions and modules stored in the memory 410, that is, implements the above-mentioned response method.

[0131] The memory 410 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the server, etc. In addition, the memory 410 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 410 may further include a memory remotely arranged relative to the processor 420, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0132] The input device 430 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 440 may include a display device such as a display screen.

[0133] Embodiment 5

[0134] Embodiment 5 of the present invention provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to execute a response method when executed by a computer processor, the method comprising:

[0135] Obtaining questions to be answered and preset data, wherein the preset data includes an intent tree, which is constructed based on the intent chain to be matched and the answers to the intent chain to be matched, and the intent chain to be matched is constructed based on historical answers to the questions;

[0136] Identify the current business intent of the question to be answered, and if the number of the current business intents is at least two, obtain the current intent chain of the question to be answered according to the current business intent;

[0137] Match the current intent chain with the intent tree, and obtain the answer to the question based on the matching result.

[0138] Of course, the computer executable instructions of a storage medium including computer executable instructions provided by an embodiment of the present invention are not limited to the operations of the method described above, but can also execute related operations in the response method provided by any embodiment of the present invention.

[0139] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention 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 a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0140] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A response method, characterized in that: include: Obtaining questions to be answered and preset data, wherein the preset data includes an intent tree; Identify the current business intention of the question to be answered, and if the number of the current business intentions is at least two, obtain the current intention chain of the question to be answered according to the current business intention; Matching the current intention chain with the intention tree, and obtaining an answer to the question to be answered according to the matching result; The intention tree is pre-constructed through the following steps: For the target historical questions with intent in the historical answer questions, based on the questioning order of each of the target historical questions, construct an intent chain to be matched according to the historical intent of each of the target historical questions, and construct the intent tree according to the intent chain to be matched and the answer to the intent chain to be matched; The obtaining of the current intention chain of the question to be answered according to the current business intention includes: Performing a full sorting on at least two of the current business intentions, and obtaining a current intention chain of the question to be answered according to the full sorting result; or, If there is a first answered intention or a first answered intention chain in the current answering session where the question to be answered is located, the current intention chain of the question to be answered is obtained according to the current business intention and the first answered intention or the first answered intention chain.

2. The method according to claim 1, characterized in that Obtaining the answer to the question to be answered according to the matching result includes: In the intention tree, if the number of matched intention chains that matches the current intention chain is one, the node answer corresponding to the last intention node of the matched intention chain is used as the answer to the question to be answered, or a first intention guide is generated according to the sub-intention node of the last intention node, and the first intention guide and the node answer are used as the answer to the question to be answered; If the number of the matched intention chains is at least two, a second intention guidance is generated according to the sub-intention node of the last intention node of each of the matched intention chains, and the second intention guidance is used as the answer to the question to be answered.

3. The method according to claim 1, characterized in that The preset data also includes preset mapping data, and the preset mapping data includes a mapping relationship between the historical participles and the historical intentions of the historical answer questions; The identifying the current business intention of the question to be answered includes: Obtaining the user's main intention and the first word segmentation result of the question to be answered, filtering out the initial intention of the question to be answered from the multiple historical intentions according to the first word segmentation result and the preset mapping data, and filtering out the target intention matching the user's main intention from each of the initial intentions; According to the preset mapping data, generalize the target word segmentation result corresponding to the target intent in the question to be answered, and update the question to be answered according to the generalization result; The step of obtaining the user's main intention of the question to be answered and the first word segmentation result is repeatedly performed until the user's main intention is non-business intention, so as to obtain the current business intention of the question to be answered.

4. The method according to claim 3, characterized in that The preset mapping data is pre-generated by the following steps: Obtaining the second word segmentation results in the historical answer question, calculating the intention weight of each of the second word segmentation results, and filtering out the historical word segmentation from each of the second word segmentation results according to the calculation result; The preset mapping data is generated according to the historical participle and the historical intention of the historical answer question where the historical participle is located.

5. The method according to claim 4, characterized in that The calculating the intent weight IntentWeight(w) of the current word segmentation result w in each of the second word segmentation results includes: Obtain the number of times w appears in each of the historical answer questions WordTotal(w) and the number of the historical answer questions that contain w and have an intention Itent(w); According to WordTotal(w) and Itent(w), IntentWeight(w) of w is calculated by the following formula: IntentWeight(w)=WordTotal(w) / Itent(w)*lg(Itent(w)).

6. The method according to claim 1, characterized in that Also includes: If the number of current business intentions is one, and there is a second answered intention or a second answered intention chain in the current answer session where the question to be answered is located, then the current intention chain of the question to be answered is obtained based on the current business intention and the second answered intention or the second answered intention chain.

7. A response device, characterized in that: include: An acquisition module, used to acquire questions to be answered and preset data, wherein the preset data includes an intention tree; an obtaining module, configured to identify the current business intention of the question to be answered, and if the number of the current business intentions is at least two, obtain the current intention chain of the question to be answered according to the current business intention; A response module, used for matching the current intention chain with the intention tree, and obtaining a response answer to the question to be answered according to the matching result; The intention tree is pre-constructed by an intention tree construction module, and the intention tree construction module is used to: For the target historical questions with intent in the historical answer questions, based on the questioning order of each of the target historical questions, construct an intent chain to be matched according to the historical intent of each of the target historical questions, and construct the intent tree according to the intent chain to be matched and the answer to the intent chain to be matched; Wherein, the obtaining module includes: A first current intention chain obtaining unit is used to fully sort at least two of the current business intentions and obtain the current intention chain of the question to be answered according to the full sorting result; or, The second current intention chain obtaining unit is used to obtain the current intention chain of the question to be answered based on the current business intention and the first answered intention or the first answered intention chain if there is a first answered intention or a first answered intention chain in the current answering session where the question to be answered is located.

8. A server, characterized in that: The server comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the response method as described in any one of claims 1 to 6.

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 response method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Answer providing method and apparatus

    CN106919655A

  • Question and answer method based on knowledge graph, and agricultural encyclopedia question and answer system

    CN108804521A

  • Semantic analysis question and answer method and device, computer device and storage medium

    CN109858007A

  • Multi-intention query method and device based on historical results, equipment and storage medium

    CN110019714A

  • Intelligent question and answer information processing method, electronic equipment and computer readable storage medium

    CN110427461A