Disclosure of Invention
One or more embodiments of the present specification describe a method and apparatus for supplementing information with respect to user question, which can be closer to the user's question after the user question supplements the information.
In a first aspect, a method for supplementing information for a question of a user is provided, and the method includes:
taking a current user question as an input of a first matching model to obtain a plurality of semantic nodes matched with the current user question, wherein the semantic nodes form a current matching node set and are semantic nodes in a pre-established service guide graph; the service guide graph comprises a plurality of semantic nodes organized according to a tree structure, each semantic node corresponds to a standard semantic element, and a plurality of leaf nodes of the tree structure are hung with a plurality of corresponding knowledge point titles;
when the current matching node set is matched with a plurality of links of the service guide graph, at least taking a plurality of candidate knowledge point titles mounted on the plurality of links, the current matching node set, the conversation context and the behavior state information of the user as the input of a second matching model to obtain the matching degree of each candidate knowledge point title and the question of the current user;
and determining standard semantic elements supplemented to the current user question and knowledge point titles matched with the current user question according to the matching degree of each candidate knowledge point title and the current user question.
In one possible embodiment, the dialog context includes at least one of:
a history matching node set, wherein the history matching node set comprises semantic nodes matched with all history question sentences before the current user question sentence;
a knowledge point title corresponding to a previous historical question of the current user question;
semantic nodes matched with knowledge points corresponding to historical question sentences of previous sentence of the current user question sentences;
semantic nodes matched with knowledge points corresponding to all historical question sentences in the conversation to which the current user question sentences belong.
In one possible embodiment, the behavioral state information of the user includes at least one of:
product information purchased or used by the user, browsing behavior information of the user, and operation failure information of the user.
In a possible implementation manner, the determining, according to the matching degree of each candidate knowledge point title and the current user question, a standard semantic element supplemented to the current user question and a knowledge point title matched with the current user question includes:
determining the maximum matching degree from the matching degree of each candidate knowledge point title and the question of the current user;
and when the maximum matching degree is larger than a first threshold value, determining the knowledge point title matched with the question of the current user as the candidate knowledge point title corresponding to the maximum matching degree.
Further, the determining, according to the matching degree between each candidate knowledge point title and the current user question, a standard semantic element supplemented to the current user question and a knowledge point title matched with the current user question further includes:
and when the maximum matching degree is greater than a second threshold and less than or equal to the first threshold, determining that the knowledge point titles matched with the question of the current user are candidate knowledge point titles which are sorted in the preset number from the top according to the matching degree, wherein the first threshold is greater than the second threshold.
Further, the determining, according to the matching degree between each candidate knowledge point title and the current user question, a standard semantic element supplemented to the current user question and a knowledge point title matched with the current user question further includes:
and when the maximum matching degree is smaller than or equal to the second threshold value, outputting prompt information, wherein the prompt information is used for prompting a user to supplement information.
In one possible implementation, the dialog context includes a set of history matching nodes including semantic nodes matching respective history question sentences prior to the current user question sentence; the second matching model is used for determining first probabilities that each candidate knowledge point title generates semantic nodes contained in the current matching node set and semantic nodes contained in the historical matching node set;
and the second matching model determines the matching degree of each candidate knowledge point title and the current user question at least according to the first probability.
Further, the dialog context also includes a knowledge point title corresponding to a previous historical question of the current user question;
the second matching model is also used for determining a second probability from the knowledge point title corresponding to the previous historical question to each candidate knowledge point title;
and the second matching model determines the matching degree of each candidate knowledge point title and the current user question at least according to the first probability and the second probability.
Further, the second matching model is further used for determining a third probability from the behavior state information of the user to each candidate knowledge point title;
and the second matching model determines the matching degree of each candidate knowledge point title and the current user question at least according to the first probability, the second probability and the third probability.
In a second aspect, an apparatus for supplementing information for a question of a user is provided, the apparatus comprising:
a matching node determining unit, configured to use a current user question as an input of a first matching model, to obtain a plurality of semantic nodes matched with the current user question, where the semantic nodes form a current matching node set, and the semantic nodes are semantic nodes in a pre-established service guide graph; the service guide graph comprises a plurality of semantic nodes organized according to a tree structure, each semantic node corresponds to a standard semantic element, and a plurality of leaf nodes of the tree structure are hung with a plurality of corresponding knowledge point titles;
a matching degree determining unit, configured to, when the current matching node set obtained by the matching node determining unit matches multiple links of the service guide graph, take at least multiple candidate knowledge point titles mounted on the multiple links, the current matching node set, a dialog context, and behavior state information of a user as input of a second matching model, so as to obtain a matching degree between each candidate knowledge point title and the current user question;
and the supplementary information unit is used for determining standard semantic elements supplemented to the question of the current user and the knowledge point titles matched with the question of the current user according to the matching degree of each candidate knowledge point title and the question of the current user, which is obtained by the matching degree determining unit.
In a third aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of the first aspect.
In a fourth aspect, there is provided a computing device comprising a memory having stored therein executable code and a processor that, when executing the executable code, implements the method of the first aspect.
By the method and the device provided by the embodiment of the specification, firstly, the current user question is taken as the input of the first matching model to obtain the current matching node set formed by semantic nodes matched with the current user question in the pre-established service guide diagram, and then when the current matching node set is matched with a plurality of links of the service guide graph, at least taking a plurality of candidate knowledge point titles mounted on the plurality of links, the current matching node set, the conversation context and the behavior state information of the user as the input of a second matching model to obtain the matching degree of each candidate knowledge point title and the question of the current user, and finally determining a standard semantic element supplemented to the question of the current user and a knowledge point title matched with the question of the current user according to the matching degree of each candidate knowledge point title and the question of the current user. As can be seen from the above, in the embodiment of this specification, instead of determining whether to supplement information based on the smoothness of the user question after supplementing the information, based on the standard semantic elements corresponding to each semantic node in the service guide map, it is first identified which standard semantic elements the user question includes, and then it is determined to supplement the standard semantic elements missing from the user question in the user question according to the dialog context and the behavior state information of the user, so that the information can be supplemented closer to the user statement after the user question supplements the information.
Detailed Description
The scheme provided by the specification is described below with reference to the accompanying drawings.
Fig. 1 is a schematic view of an implementation scenario of an embodiment disclosed in this specification. The implementation scenario relates to supplementing information for user question, in particular to supplementing information for user question based on a pre-established service guide map. Typically, the question-answering robot answers user questions (i.e., user question) using question-answer (i.e., knowledge point) pairs in a knowledge base. The knowledge base comprises a large number of question-answer pairs, wherein the questions are called standard questions (short for questions), the question of the user is matched with the standard questions in the knowledge base, and if the matched standard questions are found, the corresponding answers are returned. In order to expand the generalization ability of standard question understanding, one standard question corresponds to a plurality of different literal expression modes, called as a question method of a question mark, and if a question of a user is matched with a certain question method, the question of the user is equivalent to the matching of the question of the user and the question mark corresponding to the question method. The corresponding relation between the label and the question is 1 to many, and the corresponding relation between the question and the label is 1 to 1.
And (4) sorting each mark in the knowledge base into a group of standard semantic elements through the combing of business personnel, wherein the marks and the semantic element are combined and in one-to-one correspondence. And then, according to the division of the service field, combining semantic elements corresponding to the mark, and constructing a tree with the service elements as root nodes. The root node of each tree is a service element, the child nodes of each tree are semantic elements of a service subdivision field, such as operation, attributes and states, the lower layer is semantic elements of a more subdivision field, such as sub-operation, sub-attributes and the like, the hierarchy subdivision field is formed, and the leaf nodes are semantic elements of problem types, such as why, what and the like. All the element combinations on each path from the root node to the leaf node correspond to a label in the knowledge base, and the label can also be called a knowledge point title.
Referring to fig. 1, a traffic guide graph 100 includes a plurality of nodes (e.g., node 11, node 12, node 13, node 14) organized as a tree hierarchy according to traffic dimensions, which may also be referred to as "semantic nodes. Each node corresponds to a standard semantic element, and the standard semantic element has a keyword and associated expression of the keyword, for example, the keyword corresponding to the node 11 is "balance treasure", and the node 11 corresponds to a semantic element of a service type; the key word corresponding to the node 12 is refund, and the node 12 corresponds to the semantic element of the operation type; the key word corresponding to the node 13 is 'query', and the node 13 corresponds to the semantic element of the sub-operation type; the keyword corresponding to the node 14 is "how", and the node 14 corresponds to the semantic element of the question type. Wherein each keyword may have one or more associated expressions, including synonymous expressions, implied expressions, hypernyms, etc., for example, the keyword "how" may have an associated expression of "how". Each semantic node can be configured with the associated expression thereof, and the configuration of the keywords and the associated expression thereof is to identify the matching key of the node according to the question of the user. The root node of the traffic guide graph represents traffic having a particular traffic type, e.g., node 11 is the root node and represents a particular traffic "balance treasure". The leaf node of the service guide graph carries knowledge points associated with keywords of the leaf node, for example, the node 14 is a leaf node, the keywords of the leaf node are "how", and the leaf node carries knowledge points 15 "how to query the balance treasures refund" and answers, where each knowledge point corresponds to a knowledge point title, which is also called a standard question sentence, for example, the knowledge point title may be "how to query the balance treasures refund".
The service guide diagram is a tree structure combed by operators, and each knowledge point of the knowledge base is organized in a hierarchy mode. It can be seen that the root node of the tree is a service type, the leaf node of the tree is a knowledge point in the knowledge base through layer-by-layer branching, the structure of the guide map and the node name can be modified and adjusted, and great convenience is provided for operators to edit and adjust the knowledge base.
And deducing answers required by the user by matching the question sentences of the user to the semantic nodes. And when the matching node set is matched with a plurality of links of the service guide graph, taking the knowledge point title mounted by the leaf node of each link as a candidate knowledge point title. For example, semantic node 11 "balance treasure", semantic node 12 "refund", semantic node 13 "query", semantic node 14 "how" constitutes one link of the service guide graph, and the knowledge point of the knowledge point mounted on the leaf node "how" of the link is entitled "how to query balance treasure refund".
When there are a plurality of candidate knowledge point titles, it is necessary to further supplement information for the user question so as to further clarify the user's statement, and thereby select a knowledge point title that is finally matched with the user question from the plurality of candidate knowledge point titles.
In the embodiment of the present specification, not only element recognition may be performed on a user question, that is, a semantic node matching the user question is determined, but also element recognition may be performed on an information source for supplemental information, that is, a semantic node matching the information source is determined, where the information source generally comes from two aspects, one is a user context, for example, a historical question before a current user question, a knowledge point title matching the historical question, a knowledge point matching the historical question, and the like; the other is user information, specifically, behavior state information of the user, for example, product information purchased or used by the user, browsing behavior information of the user, operation failure information of the user, and the like.
And obtaining a user question after the information is supplemented through element identification and element supplement, and matching the knowledge point title matched with the user question to better meet the requirements of the user.
Fig. 2 shows a flow diagram of a method for supplementing information for user question according to one embodiment, which may be based on the traffic guide diagram shown in fig. 1. As shown in fig. 2, the method in this embodiment comprises the steps of: step 21, using a current user question as an input of a first matching model to obtain a plurality of semantic nodes matched with the current user question, wherein the semantic nodes form a current matching node set and are semantic nodes in a pre-established service guide graph; the service guide graph comprises a plurality of semantic nodes organized according to a tree structure, each semantic node corresponds to a standard semantic element, and a plurality of leaf nodes of the tree structure are hung with a plurality of corresponding knowledge point titles; step 22, when the current matching node set is matched with a plurality of links of the service guide map, at least using a plurality of candidate knowledge point titles mounted on the plurality of links, the conversation context of the current matching node set and the behavior state information of the user as the input of a second matching model to obtain the matching degree of each candidate knowledge point title and the question of the current user; and step 23, determining standard semantic elements supplemented to the current user question and knowledge point titles matched with the current user question according to the matching degree of each candidate knowledge point title and the current user question. Specific execution modes of the above steps are described below.
Firstly, in step 21, a current user question is used as an input of a first matching model, and a plurality of semantic nodes matched with the current user question are obtained, wherein the semantic nodes form a current matching node set, and the semantic nodes are semantic nodes in a pre-established service guide graph; the service guide graph comprises a plurality of semantic nodes organized according to a tree structure, each semantic node corresponds to a standard semantic element, and a plurality of leaf nodes of the tree structure are hung with a plurality of corresponding knowledge point titles.
In the embodiment of the present specification, since each semantic node corresponds to one standard semantic element, the process of determining the current matching node set is actually a process of element identification. Fig. 3 is a schematic diagram of key steps of a method for supplementing information to a question of a user according to an embodiment of the present disclosure, and referring to fig. 3, the method mainly includes two key processing steps: and aiming at element identification and element supplement of the user question (query), outputting the user question after the element supplement to a Question Answering (QA) engine.
The purpose of element identification is to determine what is or is not in the question of the user.
The general user question can be divided into two parts of a condition and a request. Wherein the condition part indicates the current state of the user, what operation has been completed, what processing has been applied, or a certain attribute of the account is in a certain state; the statement is the center of the user's question, indicating what information the user wishes to obtain, or what action to do.
The description of the user can be further subdivided into: business/product, attributes, operation and issue type. For complex services, the attributes also include sub-attributes or sub-operations of the attributes, and the operations also include sub-attributes or sub-operations. While the question type indicates which aspect of the core properties/operations the user wants to know. Typically, the types of questions related to attributes include: what, if, where, what can be used, how, etc.; the types of problems associated with the operation include: however, why may not be possible, what may be the case, what does, etc. In addition, there is a direct question of the status. The key element in the user question may be a word or a phrase, and for the phrase, each component may continuously appear in the sentence, or may be separated in the middle, and may sequentially appear, or may appear in a reverse order, provided that these components form a close dependency relationship in the dependency syntax analysis.
Fig. 4 is a flowchart of a method for identifying an element for a question of a user according to an embodiment of the present specification, and referring to fig. 4, the method includes the following steps for identifying an element:
a) and performing word segmentation on the question of the user.
b) And performing syntactic analysis on the word segmentation result.
c) And identifying each basic element contained in the sentence and the modification relation among the basic elements according to the knowledge base guide graph and the syntactic analysis result.
d) Converting each basic element into a standard element according to synonymy normalization; it is understood that each semantic node in the service guide graph has a keyword and a plurality of associated expressions, and the basic element identified in step c) may be an associated expression, and the associated expression is converted into a keyword, that is, the basic element is converted into a standard element.
e) After the element identification is completed, on one hand, the element is transmitted to a context storage system to provide context information for subsequent conversations; on the other hand, the element supplement module is introduced to supplement the elements.
Next, in step 22, when the current matching node set matches multiple links of the service guide map, at least multiple candidate knowledge point titles mounted on the multiple links, the dialog context of the current matching node set, and the behavior state information of the user are used as inputs of a second matching model, so as to obtain a matching degree between each candidate knowledge point title and the question of the current user.
It is to be understood that, in the embodiments of the present specification, the dialog context is specifically a dialog context. Optionally, the dialog context includes at least one of:
a history matching node set, wherein the history matching node set comprises semantic nodes matched with all history question sentences before the current user question sentence;
a knowledge point title corresponding to a previous historical question of the current user question;
semantic nodes matched with knowledge points corresponding to historical question sentences of previous sentence of the current user question sentences;
semantic nodes matched with knowledge points corresponding to all historical question sentences in the conversation to which the current user question sentences belong.
Optionally, the behavioral state information of the user includes at least one of:
product information purchased or used by the user, browsing behavior information of the user, and operation failure information of the user.
In one example, the dialog context includes a set of history matching nodes including semantic nodes matching respective history question sentences prior to the current user question sentence; the second matching model is used for determining first probabilities that each candidate knowledge point title generates semantic nodes contained in the current matching node set and semantic nodes contained in the historical matching node set; and the second matching model determines the matching degree of each candidate knowledge point title and the current user question at least according to the first probability.
In another example, the dialog context further includes a knowledge point title corresponding to a historical question of a previous sentence of the current user question; the second matching model is also used for determining a second probability from the knowledge point title corresponding to the previous historical question to each candidate knowledge point title; and the second matching model determines the matching degree of each candidate knowledge point title and the current user question at least according to the first probability and the second probability.
In another example, the second matching model is further for determining a third probability from the behavioral state information of the user to each candidate knowledge point title; and the second matching model determines the matching degree of each candidate knowledge point title and the current user question at least according to the first probability, the second probability and the third probability.
In the embodiment of the present specification, the input information of the element supplement part can mainly come from two aspects, namely, the conversation context and the user information. Specifically, for example, all elements of the current user question of the previous element analysis module, all elements mentioned in the previous dialog provided by the context storage system, the previous user question, and the description of the user status include products that the user has purchased or used, such as insurance, financing, loan, etc., and the status of these products, such as claim settlement, interest, billing information, etc., and further include recent behaviors such as recent browsing behaviors of the user, operation failure information, etc., and encountered obstacles, etc.
The element supplement carries out comprehensive processing on the information and analyzes possible requirements of the user. The specific processing manner is shown in a supplementary schematic diagram of elements shown in fig. 5.
The purpose of element supplementation is to clarify the user's request and to understand the user's request in the case of a lack of information in the user's expression. To achieve this, the element supplement module extracts information from the request of the previous question, elements contained in the context, and behavior states in the user information system, so as to comprehensively determine the most likely request (question) of the current user, and determine which information is to be supplemented to the current question based on the information. The calculation method for the user statement (question) determination is given below in the form of a formula.
(kid*,contextKeywords*,keywords*,userStatus*)=argmax(f(kid,prekid,contextKeywords,keywords,userStatus))
Wherein,
kid is the final user statement (challenge identification (id));
contextKeywords are information that is supplemented from the context;
keywords are information extracted from the current question;
userStatus is information extracted from the user state;
kid is the challenge id of all candidates;
prekid is the question id of the user's previous question (or prekids — all/topN question id candidates corresponding to the user's previous question);
contextKeywords ═ { ckey1, ckey2, …, ckeyn } is a key element that occurred during a previous dialog held in the context store;
key1, key2, …, key is all key elements identified from the current user question;
userStatus ═ { us1, us2, …, usk } is the overall status and behavior information for the current user.
f is a function that measures how well kid matches other parameters.
The function f for measuring matching degree of kid and other parameters in the above scheme is the key, and can be defined by itself according to business requirements or some standards, and a sample function is given here for reference:
f=f1(kid,prekid)*f2(kid,contextKeywords,keywords)*f3(kid,userStatus)
wherein
f1(kid, prekid) is the transition probability from prekid to kid, i.e. p (kid | prekid); if the prekid set prekids is used, f1 can also be defined as sigma (p (kid | prekidi) × p (prekidi)).
f2(kid, contextKeywords, keywords) is the probability that the question represented by kid generates the preceding keyword and the current keyword; since the keywords of the current keyword lack elements, the keywords in the contextKeywords are used for word supplement, and different combinations can be provided based on different element selections in the keywords and the contextKeywords, and the different combinations represent the current possible observation results (different observation results are focused). f2 is actually the probability of estimating different kids given several possible observations;
the way of combining here is: { service | product ═ k1, attribute | operation ═ k2, [ sub-attribute | sub-operation ═ k3], problem type ═ k4, … … }, all combinations may need to refer to all the question periods in the guide.
f3(kid, userStatus) is the probability of kid occurring given the user state, when the variables describing the user state are selected to be small, the user state can be described by the combination of these variables, when the variables describing the user state are large, for convenience of calculation, f3 can be further decomposed into f3 ═ p (us1| kid) p (us2| kid) … p (usk | kid)
The above parameters are generally derived from the statistical results of real data sets, and since the maximum value (argmax) is required, very comprehensive statistical data is not necessarily required in real systems, and the missing values can be replaced by default parameters.
In order to embody some operation rules and simplify the calculation, some parameters may be forced to be preset fixed values. For example, assuming that the question related to the unsettled is related only to the operation that the user has currently performed, the related question occurrence probability of the unrelated service may be forced to zero.
And finally, in step 23, determining standard semantic elements supplemented to the question of the current user and the knowledge point titles matched with the question of the current user according to the matching degree of each candidate knowledge point title and the question of the current user.
In one example, determining a maximum matching degree from the matching degrees of each candidate knowledge point title and the current user question; and when the maximum matching degree is larger than a first threshold value, determining the knowledge point title matched with the question of the current user as the candidate knowledge point title corresponding to the maximum matching degree.
Further, the method can also comprise the following steps:
and when the maximum matching degree is greater than a second threshold and less than or equal to the first threshold, determining that the knowledge point titles matched with the question of the current user are candidate knowledge point titles which are sorted in the preset number from the top according to the matching degree, wherein the first threshold is greater than the second threshold.
Further, the method can also comprise the following steps:
and when the maximum matching degree is smaller than or equal to the second threshold value, outputting prompt information, wherein the prompt information is used for prompting a user to supplement information.
In a specific example, the matching degree between the candidate knowledge point titles and the current user question is calculated by solving the formula, so that the most suitable standard problem with the current user question is found, and meanwhile, the missing information in the user question is completed. If the finally obtained kid enables the corresponding f function value to exceed a preset threshold value A, transmitting the kid serving as a user request to a subsequent question answering engine; if the finally obtained kid enables the corresponding f function value not to exceed a preset threshold A but exceed a preset threshold B, selecting topN kid as a possible user to ask and transmit to a subsequent question-answering engine; and if the finally obtained kid enables the corresponding f function value not to exceed the preset threshold value B, prompting the user to further specify the requirement, or prompting the user to supplement the specified information by asking back.
The method provided by the embodiment of the specification is characterized in that what is in a user question is determined based on a service guide diagram, and then what needs to be supplemented is determined according to a knowledge base. The information sources of element supplementation may include, but are not limited to, the elements mentioned in the foregoing of user questions, previous sentence questions, and user status. Other information sources can be added, such as elements in the previous answer of the robot, elements of all answers in the current session (session) of the robot, and the like. The information of each information source in the element supplement process can be processed simultaneously in one view. Or element supplement can be performed according to priority in sequence, and when the information source with high priority can not obtain a credible result, the information source with low priority is considered to perform element supplement. Still further, different priority orders may be set per scene. When element supplement is performed in order, only the information sources in the current order can be considered, and the information sources with high priority in front of combination can also be considered.
Compared with the common method for supplementing information to the question of the user, the method provided by the embodiment of the description can obtain better effect.
In the method, a scene code is used for word supplement, if a user enters a customer service robot from a specific entrance related to a certain service, corresponding service words are added to a question of the user to supplement missing service words; supplementing service words according to the scene codes, and for users entering from a general entrance, such as my customer service, the service words cannot be supplemented; the fuzzy question without the business word can not be effectively dealt with. That is, there is a disadvantage 1 that non-specific traffic scenarios cannot be complemented.
The information source supplemented by the elements of the scheme comprises the elements in the former sentence of the user question, the question mark of the former sentence of the user question, the recent behaviors of the user and the like. Element supplementation can still be performed without service context information.
In the second general method, context word supplement, when the question of the user appears in the process of conversation, but not at the beginning of the conversation, the algorithm extracts the words mentioned in the foregoing by the user and tries to add the words to the current question sentence, thereby achieving the purpose of information supplement. Extracting keywords from the context and supplementing the keywords into the user question, wherein the situation that a certain keyword in the fuzzy question is missing can be effectively dealt with, but the situation that phrases are missing in the question, such as 'Paibao binding' cannot be removed and 'Bank card binding' system is busy, cannot be dealt with, and the context-based word-supplementing algorithm traverses all possible candidate words in the above, judges the smoothness degree of a sentence through a language model, and does not pertinently extract necessary information from the above according to the missing information; further, the user cannot cope with the case where the user question information is missing. That is, there is a disadvantage 2 that a plurality of words cannot be complemented.
The scheme obtains candidate elements from each information source, and judges which elements are supplemented according to the matching degree of the current question elements, the candidate supplement elements and the element expression in the guide picture. A single element may be supplemented, or a plurality of elements may be supplemented.
In the third general method, when the question of the user appears in the process of the conversation instead of the beginning of the conversation, all the questions of the user in the previous text are connected to the front of the current question, and the connected questions are taken as the current question of the user. The problem that only one word can be supplemented in the method II is solved to a certain extent, but a new problem is introduced. Namely, the judgment of the true intention of the user by the algorithm is influenced by excessive interference information in the spliced sentences. In addition, for the case that the user omits other information sources such as the previous operation behavior of the user, the text splicing in the foregoing manner is only relied on, which cannot be solved; if the user asks questions for the answers, the problem of information loss cannot be solved. That is, there is a disadvantage 3 that the interference information is excessive
Firstly, in the scheme, element analysis is carried out on a question (query) of a user, unnecessary interference information is filtered, elements are stored in the context, and a lot of unnecessary interference is removed. Secondly, the scheme defines candidate questions according to elements in the user question and the service guide picture, and further reduces the search range. And finally, the candidate questions are sequenced through matching degree calculation, ambiguity elimination of the user intention is completed, and the method is more direct to the user original intention compared with the original method.
In the embodiment of the specification, an information supplementing method for fuzzy question asking of a customer service robot based on element analysis and knowledge graph guidance is provided. The method mainly comprises the following characteristics: first, it is identified which predefined elements of the map-guide knowledge base are included in the user's question. Secondly, according to the existing element in the question and the combination of the question element in the guide picture, and in combination with the context of multiple information sources, the most probable intention of the user is judged, and the elements are needed to be supplemented. Compared with the common method that the information contained in the current question is ignored and the information contained in the knowledge base is blindly supplemented from various data sources, the method is more efficient and accurate. Moreover, even if the user question is not in the coverage range of the knowledge base, the knowledge points close to the user question can be given through the supplementary elements by analyzing the elements of the question.
According to an embodiment of another aspect, an apparatus for supplementing information for a user question is also provided, and the apparatus is used for executing the method for supplementing information for a user question provided by the embodiments of the present specification. FIG. 6 shows a schematic block diagram of an apparatus for supplementing information for a user question according to one embodiment. As shown in fig. 6, the apparatus 600 includes:
a matching node determining unit 61, configured to use a current user question as an input of a first matching model, to obtain a plurality of semantic nodes matched with the current user question, where the semantic nodes form a current matching node set, and the semantic nodes are semantic nodes in a pre-established service guide graph; the service guide graph comprises a plurality of semantic nodes organized according to a tree structure, each semantic node corresponds to a standard semantic element, and a plurality of leaf nodes of the tree structure are hung with a plurality of corresponding knowledge point titles;
a matching degree determining unit 62, configured to, when the current matching node set obtained by the matching node determining unit 61 matches multiple links of the service guide graph, use at least multiple candidate knowledge point titles mounted on the multiple links, the current matching node set, a dialog context, and behavior state information of a user as inputs of a second matching model, so as to obtain a matching degree between each candidate knowledge point title and a question of the current user;
and a supplementary information unit 63, configured to determine, according to the matching degree between each candidate knowledge point title obtained by the matching degree determining unit 62 and the current user question, a standard semantic element supplementary to the current user question and a knowledge point title matched with the current user question.
Optionally, as an embodiment, the dialog context adopted by the matching degree determining unit 62 includes at least one of the following:
a history matching node set, wherein the history matching node set comprises semantic nodes matched with all history question sentences before the current user question sentence;
a knowledge point title corresponding to a previous historical question of the current user question;
semantic nodes matched with knowledge points corresponding to historical question sentences of previous sentence of the current user question sentences;
semantic nodes matched with knowledge points corresponding to all historical question sentences in the conversation to which the current user question sentences belong.
Optionally, as an embodiment, the behavior state information of the user includes at least one of:
product information purchased or used by the user, browsing behavior information of the user, and operation failure information of the user.
Optionally, as an embodiment, the supplemental information unit 63 is specifically configured to:
determining the maximum matching degree from the matching degree of each candidate knowledge point title and the question of the current user;
and when the maximum matching degree is larger than a first threshold value, determining the knowledge point title matched with the question of the current user as the candidate knowledge point title corresponding to the maximum matching degree.
Further, the supplementary information unit 63 is further configured to determine that the knowledge point titles matched with the question of the current user are candidate knowledge point titles that are sorted in a preset number from large to small according to the matching degree when the maximum matching degree is greater than a second threshold and is less than or equal to the first threshold, where the first threshold is greater than the second threshold.
Further, the supplementary information unit 63 is further configured to output a prompt message when the maximum matching degree is smaller than or equal to the second threshold, where the prompt message is used to prompt the user of supplementary information.
Optionally, as an embodiment, the dialog context includes a history matching node set, where the history matching node set includes semantic nodes matched with historical question sentences before the current user question sentence; the second matching model adopted by the matching degree determining unit 62 is used for determining first probabilities that each candidate knowledge point title generates semantic nodes included in the current matching node set and semantic nodes included in the historical matching node set;
and the second matching model determines the matching degree of each candidate knowledge point title and the current user question at least according to the first probability.
Further, the dialog context also includes a knowledge point title corresponding to a previous historical question of the current user question;
the second matching model is also used for determining a second probability from the knowledge point title corresponding to the previous historical question to each candidate knowledge point title;
and the second matching model determines the matching degree of each candidate knowledge point title and the current user question at least according to the first probability and the second probability.
Further, the second matching model is further used for determining a third probability from the behavior state information of the user to each candidate knowledge point title;
and the second matching model determines the matching degree of each candidate knowledge point title and the current user question at least according to the first probability, the second probability and the third probability.
With the apparatus provided in this specification, first, the matching node determining unit 61 uses a current user question as an input of a first matching model to obtain a current matching node set formed by semantic nodes matching with the current user question in a pre-established service guide map, then, the matching degree determining unit 62 uses at least a plurality of candidate knowledge point titles mounted on the plurality of links, the current matching node set, a dialog context, and behavior state information of a user as an input of a second matching model when the current matching node set matches with the plurality of links of the service guide map to obtain matching degrees of each candidate knowledge point title and the current user question, and finally, the supplementary information unit 63 determines a standard semantic element supplementary to the current user question according to the matching degrees of each candidate knowledge point title and the current user question, and a knowledge point title matched with the current user question. As can be seen from the above, in the embodiment of this specification, instead of determining whether to supplement information based on the smoothness of the user question after supplementing the information, based on the standard semantic elements corresponding to each semantic node in the service guide map, it is first identified which standard semantic elements the user question includes, and then it is determined to supplement the standard semantic elements missing from the user question in the user question according to the dialog context and the behavior state information of the user, so that the information can be supplemented closer to the user statement after the user question supplements the information.
According to an embodiment of another aspect, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method described in connection with fig. 2 to 5.
According to an embodiment of yet another aspect, there is also provided a computing device comprising a memory and a processor, the memory having stored therein executable code, the processor, when executing the executable code, implementing the method described in connection with fig. 2 to 5.
Those skilled in the art will recognize that, in one or more of the examples described above, the functions described in this invention may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
The above-mentioned embodiments, objects, technical solutions and advantages of the present invention are further described in detail, it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the present invention should be included in the scope of the present invention.