A conversation interaction method, device, equipment and storage medium
By determining the knowledge nodes related to user interaction data from the knowledge graph and conducting dialogue and interaction based on these nodes, the problems of insufficient stability and dull reply in the existing technology are solved, and more rich and knowledgeable User interaction experience.
Patent Information
- Application Number
- CN202111572284.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-12-21
AI Technical Summary
The existing human-computer dialogue system is insufficiently stable, boring, uninformative, poor user experience, and difficult to apply to actual product services.
By obtaining the user's dialogue interaction data, from the pre-constructed knowledge graph containing several knowledge nodes, the knowledge nodes related to the user's dialogue interaction data are determined, and the node set is formed, and dialogue and interaction with the user based on these knowledge nodes.
It realizes stable and controllable interaction with users, and the interactive content is richer, targeted and knowledgeable, improving the user experience.
Smart Images

Figure CN114254125B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of human-computer interaction technology, and in particular to a dialogue interaction method, device, equipment and storage medium. Background Art
[0002] With the development of computer and artificial intelligence technology, the interaction between machines and humans will become more and more frequent. At present, human-computer interaction systems have appeared in various types of products and services, such as smartphones (applying human-computer dialogue systems to smartphones can help users complete some command operations without operating the interface, such as making calls, sending messages, checking the weather, etc.), smart homes (applying human-computer dialogue systems to smart homes can help users operate their homes more conveniently), etc.
[0003] The more important part of the human-computer interaction system is the human-computer dialogue system, which is used to realize the dialogue interaction with the user. The current human-computer dialogue system is mainly based on the automatically generated chat system. Although the automatically generated chat system can interact with the user, it is not stable enough, and the replies are boring and not knowledgeable. The user experience is poor and it is difficult to apply to actual product services. Summary of the invention
[0004] In view of this, the present application provides a dialogue interaction method, device, equipment and storage medium to solve the problems of the existing human-computer dialogue system being insufficiently stable, having boring responses, lacking knowledge, having poor user experience, and being difficult to apply to actual product services. The technical solution is as follows:
[0005] A dialog interaction method, comprising:
[0006] Obtain user conversation interaction data;
[0007] Determine, from a pre-constructed knowledge graph comprising a plurality of knowledge nodes, knowledge nodes related to the conversation interaction data of the user, to obtain a node set consisting of the determined knowledge nodes;
[0008] Based on the knowledge nodes in the node set, a dialog interaction is performed with the user.
[0009] Optionally, there are edges between related nodes in the knowledge graph, and each edge in the knowledge graph has a relationship between two nodes connected by the edge;
[0010] The several knowledge nodes contained in the knowledge graph include event nodes, or the several knowledge nodes contained in the knowledge graph include entity nodes and / or action nodes, and event nodes.
[0011] Optionally, determining the knowledge nodes related to the user's conversation interaction data from a pre-built knowledge graph containing a plurality of knowledge nodes includes:
[0012] Determine the user intention and slot value according to the user's conversation interaction data, wherein the slot value is an entity;
[0013] Combining the user intent with the slot value, and obtaining the combined data as a structured intent;
[0014] A node matching the structured intent is determined from the knowledge graph as a node related to the conversation interaction data of the user.
[0015] Optionally, determining the user intention and the slot value according to the conversation interaction data of the user includes:
[0016] Using an open intention determination module, based on the user's conversation interaction data, determining an open intention of a specified type as the user intention;
[0017] A slot value extraction module is used to extract entities of a specified type from the user's conversation interaction data as the slot value.
[0018] Optionally, if the knowledge graph includes several knowledge nodes including entity nodes, action nodes and event nodes, the process of constructing the knowledge graph includes:
[0019] Obtain action graphs, entity knowledge graphs, and event graphs;
[0020] Combining the action graph, the entity knowledge graph and the event graph, and using the combined graph as the knowledge graph;
[0021] Among them, the action graph includes a number of action nodes, and there are edges between the related action nodes in the action graph, and each edge has the relationship between the two action nodes connected by the edge; the entity knowledge graph includes a number of entity nodes, and there are edges between the related entity nodes in the entity knowledge graph, and each edge has the relationship between the two entity nodes connected by the edge; the matter graph includes a number of event nodes, and there are edges between the related event nodes in the matter graph, and each edge has the relationship between the two event nodes connected by the edge.
[0022] Optionally, the entity knowledge graph further includes: an entity concept node and a plurality of entity type nodes connected to the entity concept node, wherein the plurality of entity type nodes are subordinate nodes of the entity concept node;
[0023] Each entity node among the plurality of entity nodes is associated with the entity type node to which it belongs, and each entity node is a subordinate node of the entity type node to which it belongs.
[0024] Optionally, the event nodes in the event graph include actions and entities;
[0025] The combining of the action graph, the entity knowledge graph and the event graph comprises:
[0026] According to the entities in the event nodes contained in the event graph, the event graph is associated with the entity knowledge graph;
[0027] According to the actions in the event nodes included in the event graph, the event graph is associated with the action graph.
[0028] Optionally, associating the event graph with the entity knowledge graph according to the entities in the event nodes included in the event graph includes:
[0029] For each event node included in the event graph, if there is an entity node corresponding to the entity in the event node in the entity knowledge graph, then the entity node corresponding to the entity in the event node in the entity knowledge graph is associated with the event node;
[0030] The associating the event graph with the action graph according to the actions in the event nodes included in the event graph includes:
[0031] For each event node included in the event graph, if there is an action node corresponding to the action in the event node in the action graph, the action node corresponding to the action in the event node in the action graph is associated with the event node.
[0032] Optionally, there are edges between related nodes in the knowledge graph, and each edge in the knowledge graph has a relationship between two nodes connected by the edge;
[0033] The performing a dialog interaction with the user based on the knowledge nodes in the node set includes:
[0034] Determine the node on which this interaction is based from the node set as the target node;
[0035] Conducting a dialog interaction with the user regarding the target node, or conducting a dialog interaction with the user regarding a relationship on an edge connected to the target node, or conducting a dialog interaction with the user regarding a node in the knowledge graph that is related to the target node.
[0036] Optionally, determining the node on which the current interaction is based from the node set includes:
[0037] When the node set contains only one node, the node is determined as the node on which the current interaction is based;
[0038] In the case where the node set includes multiple nodes, if there is an event node among the multiple nodes, the event node among the multiple nodes is determined as the node based on which this interaction is based; if there is no event node among the multiple nodes, a node is randomly selected from the multiple nodes as the node based on which this interaction is based.
[0039] Optionally, the performing a dialog interaction with the user regarding the target node includes:
[0040] Acquire resources related to the target node from a resource library;
[0041] Based on the resources related to the target node, a dialog interaction is performed with the user.
[0042] Optionally, the dialogue interaction method further includes:
[0043] If the node set includes multiple nodes, performing subsequent dialog interaction with the user based on the nodes in the node set except the target node;
[0044] If the node set includes a node, a subsequent dialogue interaction is performed with the user based on nodes related to the target node in the knowledge graph.
[0045] A conversation interaction device, comprising: a user data acquisition module, a node determination module and a conversation interaction module;
[0046] The user data acquisition module is used to acquire the user's conversation interaction data;
[0047] The node determination module is used to determine the knowledge nodes related to the user's dialogue interaction data from a pre-built knowledge graph containing a plurality of knowledge nodes, so as to obtain a node set consisting of the determined nodes;
[0048] The dialogue interaction module performs dialogue interaction with the user based on the knowledge nodes in the node set.
[0049] A conversation interaction device, comprising: a memory and a processor;
[0050] The memory is used to store programs;
[0051] The processor is used to execute the program to implement each step of the dialogue interaction method described in any one of the above items.
[0052] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, each step of any one of the above-mentioned dialog interaction methods is implemented.
[0053] The conversation interaction method, device, equipment and storage medium provided by the present application first obtain the conversation interaction data of the user, then determine the knowledge nodes related to the conversation interaction data of the user from a pre-built knowledge graph containing several knowledge nodes, so as to obtain a node set composed of the determined nodes, and finally conduct conversation interaction with the user based on the knowledge nodes in the node set. The conversation interaction method provided by the present application can realize the chat interaction with the user based on the knowledge graph. Since the interaction with the user is based on the knowledge graph, the interaction is stable and controllable. Since the interaction with the user is based on the knowledge nodes related to the conversation interaction data of the user in the knowledge graph, the interaction content is richer, more targeted and more knowledgeable, and the user experience is better. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0055] Figure 1 A flowchart of a dialog interaction method provided in an embodiment of the present application;
[0056] Figure 2 A schematic diagram of an example of a knowledge graph including entity nodes, action nodes, and event nodes provided in an embodiment of the present application;
[0057] Figure 3 A schematic diagram of a process for determining knowledge nodes related to a user's conversation interaction data from a pre-built knowledge graph provided in an embodiment of the present application;
[0058] Figure 4 A schematic diagram of using an open domain semantic understanding model to perform semantic understanding on user conversation interaction data provided by an embodiment of the present application;
[0059] Figure 5 A schematic diagram of the process of constructing a knowledge graph provided in an embodiment of the present application;
[0060] Figure 6 A schematic diagram of an example of an action map provided in an embodiment of the present application;
[0061] Figure 7A schematic diagram of an example of an entity knowledge graph provided in an embodiment of the present application;
[0062] Figure 8 A schematic diagram of an example of a matter-of-fact diagram provided in an embodiment of the present application;
[0063] Fig. 9 A schematic diagram of the structure of a dialog interaction device provided in an embodiment of the present application;
[0064] Fig.10 A schematic diagram of the structure of a conversation interaction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0066] The current dialogue interaction system is mainly based on automatically generated small talk systems. However, the automatically generated small talk systems are not stable enough, and the replies are boring and not knowledgeable, making them difficult to be truly applied to actual products. In addition to the automatically generated small talk systems, the current dialogue interaction systems also have task-oriented interaction systems. Task-oriented interaction systems tend to be imperative operations, that is, they can complete some imperative interactions, but cannot meet normal chat interaction needs.
[0067] In view of the many problems existing in the existing dialogue interaction system, the applicant attempts to propose a dialogue interaction solution that can solve the problems existing in the existing dialogue interaction system. To this end, the applicant conducted research and finally proposed a dialogue interaction method based on knowledge graph through continuous research. The method can be applied to electronic devices with data processing capabilities. The electronic device can be a terminal used by the user side, such as a smart phone, smart home appliances, smart toys, smart speakers, car terminals, etc. The electronic device can also be a server on the network side (it can be a single server, or it can be multiple servers or server clusters). Next, the dialogue interaction method provided by this application is introduced through the following embodiments.
[0068] First embodiment
[0069] See also Figure 1 , which shows a flow chart of a dialog interaction method provided in an embodiment of the present application, and the method may include:
[0070] Step S101: Acquire user's conversation interaction data.
[0071] Among them, the user's dialogue interaction data can be the text data obtained by performing speech recognition on the user's input speech data, or the text data input by the user.
[0072] Step S102: Determine, from the pre-constructed knowledge graph, the knowledge nodes related to the user's dialogue interaction data to obtain a node set composed of the determined knowledge nodes.
[0073] Among them, the knowledge graph contains several knowledge nodes. There are edges between the related knowledge nodes in the knowledge graph, and each edge in the knowledge graph has the relationship between the two nodes connected by the edge.
[0074] In a possible implementation manner, the several knowledge nodes included in the knowledge graph may include event nodes. In another possible implementation manner, the several knowledge nodes included in the knowledge graph may include entity nodes and / or action nodes, and event nodes. In order to obtain a better dialogue interaction effect and give the user a better dialogue interaction experience, the knowledge graph is preferably composed of entity nodes, action nodes, and event nodes.
[0075] Please refer to Figure 2 , which shows an example of a knowledge graph including entity nodes, action nodes, and event nodes. Figure 2 The nodes "go to eat", "eat dishes", "go to KFC", "buy toys", "eat at home" in Figure 2 are event nodes, Figure 2 the nodes "take", "go out", "lead the way", "eat", "wash hands", "cook", "buy" in Figure 2 are action nodes,
[0076] Step S103: Based on the knowledge nodes in the node set, conduct a dialogue interaction with the user.
[0077] Specifically, the process of conducting a dialogue interaction with the user based on the knowledge nodes in the node set may include: generating reply data for the user's dialogue interaction data based on the knowledge nodes in the node set and feeding it back to the user. Among them, the process of generating reply data for the user's dialogue interaction data may include: first generating a reply text for the user's dialogue interaction data, and then synthesizing the voice corresponding to the reply text by using a speech synthesis method.
[0078] The conversation interaction method provided in the embodiment of the present application first obtains the conversation interaction data of the user, then determines the knowledge nodes related to the conversation interaction data of the user from the pre-built knowledge graph to obtain a node set composed of the determined nodes, and finally conducts a conversation interaction with the user based on the nodes in the node set. The conversation interaction method provided in the embodiment of the present application can realize the chat interaction with the user based on the knowledge graph. Since the interaction with the user is based on the knowledge graph, the interaction is stable and controllable. Since the interaction with the user is based on the knowledge nodes (event nodes, entity nodes, action nodes) related to the conversation interaction data of the user in the knowledge graph, the interaction content is richer, more targeted and more knowledgeable, and the user experience is better.
[0079] Second embodiment
[0080] This embodiment introduces the specific implementation process of "Step S102: determining knowledge nodes related to the user's conversation interaction data from a pre-constructed knowledge graph to obtain a node set consisting of the determined knowledge nodes" in the first embodiment.
[0081] See also Figure 3 , showing a flow chart of an implementation process of determining knowledge nodes related to user's conversation interaction data from a pre-built knowledge graph, which may include:
[0082] Step S301: Determine user intention and slot value based on the user's dialogue interaction data.
[0083] Optionally, the user intent can be an implicit open intent and the slot value can be an entity.
[0084] Specifically, the process of determining the user intent and slot value based on the user's conversation interaction data may include: using the intention determination module to determine a specified type of open intent as the user intent based on the user's conversation interaction data; using the slot value extraction module to extract a specified type of entity from the user's conversation interaction data as the slot value.
[0085] In one possible implementation, the intent determination module may adopt a pre-established intent determination model, and the slot value extraction module may adopt a pre-established slot value extraction model; in another possible implementation, the intent determination module may adopt the open intent determination part of a pre-established open domain semantic understanding model, and the slot value extraction module may adopt the slot value extraction part of the open domain semantic understanding model. It should be noted that this embodiment is not limited to determining user intent and slot values based on a model, and other methods may also be used, that is, this application does not limit the specific implementation method for determining user intent and slot values. As long as the user intent and slot value can be determined, they are within the scope of protection of this application.
[0086] Taking the second implementation method as an example, the process of determining the user intent and slot value according to the user's conversation interaction data includes: using the open intent determination part of the open domain semantic understanding model to determine the specified type of open intent as the user intent based on the user's conversation interaction data, and using the slot value extraction part of the open domain semantic understanding model to extract the specified type of entity from the user's conversation interaction data as the slot value.
[0087] When interacting with users, it is usually necessary to perform semantic understanding on the user's conversation interaction data to determine the user's intention. Currently, most solutions for semantic understanding of user conversation interaction data are semantic understanding solutions based on semantic understanding models. Current semantic understanding models are all semantic understanding models for specific scenarios, and they are all modeled in specific scenarios. It is understandable that the number of intentions in specific scenarios is limited, and they are all relatively clear intentions. For example, the intentions in the smart speaker scenario include song ordering, volume adjustment, collection, etc. These intentions are relatively clear intentions, and these intentions are limited and enumerable.
[0088] Considering that it is difficult to meet the needs of users by only interacting with them on topics in specific scenarios, this application proposes to interact with them on topics in open domains. On this basis, it is further proposed to establish a semantic understanding model in an open domain, that is, the semantic understanding model is modeled in an open domain.
[0089] It is understandable that there are so many clear intentions in the open domain that it is difficult to enumerate them. Even if they can be enumerated, it is difficult to model them through an efficient model. For this reason, this application defines the following semantic system: first, enumerable open intentions; second, the definition of non-enumerable semantic slot values. Exemplarily, enumerable open intentions may include actions (such as playing, eating, going to school, etc.), emotions (happy, sad, etc.), sentence patterns (negation, like, past tense, etc.), etc. Non-enumerable slot values are defined as entities that are diverse and numerous in real life, such as places, objects, food, animals, etc.
[0090] On the basis of defining the above semantic system, a semantic understanding model including an open intent determination part and a slot value extraction part is constructed, wherein the open intent determination part may adopt an open intent classification model, which is used to determine the user intent from the set open intent based on the user's conversation interaction data; the slot value extraction part may adopt a sequence labeling model, which is used to label the entities in the user's conversation interaction data.
[0091] Figure 4 FIG. 1 is a schematic diagram showing the semantic understanding of the open domain semantic understanding model for the user's conversation interaction data "My mother made delicious braised pork for me at home, and I like it very much", as shown in FIG. Figure 4As shown in the figure, the user's conversation interaction data is finally determined by the open intent classification model as follows: "Action: cooking, eating", "Emotion: happy", "Sentence: like", and the user's conversation interaction data is passed through the sequence labeling model to obtain the following slot values: "Scene: home", "Object: me, mother", "Content: braised pork". It should be noted that Figure 4 w1,w2,…,w t represents the user's conversation interaction data. For the sequence labeling model, it first uses the encoding module ( Figure 4 BERT in the code encodes the user's conversation interaction data and obtains the encoding results h1,h2,…,h t , then based on h1,h2,…,h t Determine the sequence annotation results (i.e. entities). For the open intent classification model, it first uses the encoding module ( Figure 4 BERT in ) encodes the user's conversation interaction data to obtain h1,h2,…,h t , then based on h1,h2,…,h t Determine the intent classification result. Preferably, the open intent classification model and the sequence labeling model can share a coding module and share parameters h1, h2, …, h t .
[0092] Step S302: Combine the user intent and the slot value, and obtain the combined data as the structured intent.
[0093] Exemplarily, the intention determined by step S301 is the above-mentioned "action: cooking, eating", "emotion: happy", "sentence: like", and the determined slot value is "scene: home", "object: me, mother", "content: braised pork", then the determined intention is combined with the slot value, and the obtained combined data is (mom, cooking, braised pork), (I, like, braised pork), (I, happy), etc.
[0094] There are many ways to combine user intent with slot values. This embodiment provides the following optional implementations:
[0095] In a possible implementation, a pre-trained combination model can be used to combine user intent and slot values to obtain combined data, and the combination model is trained using training data and combined data annotated with the training data, wherein each training data used to train the combination model includes an intent set and a slot value set, wherein the intent set is a set of open intents obtained from the training dialogue interaction data, and the slot value set is a set of slot values extracted from the training dialogue interaction data. The combined data annotated with the training data can be manually annotated, and is combined data of the open intents in the intent set and the slot values in the slot value set.
[0096] In another possible implementation, a combined data set of intent and slot values may be pre-constructed, the combined data set including multiple combined data, each of which is a common combination of intent and slot value. After obtaining the user intent and slot value through step S301, for each user intent, based on the pre-constructed combined data set, a slot value that can be combined with the user intent may be determined from the obtained slot value. After determining the slot value that can be combined with the user intent, the user intent is combined with the determined slot value. Exemplarily, the user intent includes intent A and intent B, and the slot value includes slot value C and slot value D. For intent A, assuming that there is combined data (A, C) in the combined data set, but there is no combined data (A, D), then it is determined that slot value C can be combined with intent A. For intent B, assuming that there is combined data (B, D) in the combined data set, but there is no combined data (B, C), then it is determined that slot value D can be combined with intent B. That is, the user intent is combined with the slot value, and the final combined data obtained are (A, C) and (B, D).
[0097] In another possible implementation, the user intent and the slot value may be combined using the proximity principle. For example, for each obtained user intent, the slot value in the user's conversation interaction data that is closer to the user intent may be combined with the user intent. It should be noted that the slot value in the user's conversation interaction data that is closest to the user intent may be a slot value in the user's conversation interaction data that is before the user intent and closer to the user intent, and / or a slot value in the user's conversation interaction data that is after the user intent and closer to the user intent.
[0098] It should be noted that defining open intents and combining them with slot values can avoid the direct definition of explicit intents and prevent the rapid growth of the number of intents. In addition, combining open intents with slot values also lays the foundation for the subsequent use of knowledge graphs.
[0099] Step S303: Determine a node that matches the structured intent from the knowledge graph as a node related to the user's conversation interaction data.
[0100] It should be noted that in this step, the "nodes that match the structured intent" are the nodes that match the entire structured intent. It should be noted that if there is no node that matches the entire structured intent, then the node that matches part of the information in the entire structured intent can be used as the "node that matches the structured intent". Of course, if there is a node that matches the entire structured intent, the node that matches the entire structured intent and the node that matches part of the information in the entire structured intent can also be used as the "node that matches the structured intent".
[0101] Exemplarily, the structured intent is (I, like, braised pork in red), assuming that there are event nodes "I like braised pork in red", action nodes "like", and entity nodes "braised pork in red" in the knowledge graph, that is, there is a node in the knowledge graph that matches the entire structured intent (I, like, braised pork) (that is, the event node "I like braised pork in red"), and there are also nodes that match partial information "like" and "braised pork" in the entire structured intent, respectively. In this case, it is preferred to use the event node "I like braised pork in red" as the "node that matches the structured intent" in step S303. Of course, the event node "I like braised pork in red", action node "like", and entity node "braised pork in red" can also be used as the "node that matches the structured intent" in step S303. Assuming that there is no event node "I like braised pork in red" in the knowledge graph, but there are action nodes "like" and entity nodes "braised pork in red", the action node "like" and entity nodes "braised pork in red" are used as the "nodes that match the structured intent" in step S303.
[0102] After obtaining the nodes matching the structured intent, a node set is formed by the nodes matching the structured intent.
[0103] Third embodiment
[0104] It can be seen from the above embodiments that the conversation interaction method provided in this application conducts conversation interaction with users based on a pre-built knowledge graph. This embodiment focuses on introducing the process of building a knowledge graph.
[0105] See also Figure 5 , which shows a schematic diagram of the process of building a knowledge graph, which may include:
[0106] Step S501: Obtain action graph, entity knowledge graph and matter graph.
[0107] The action graph includes several action nodes. There are edges between related action nodes in the action graph. Each edge has the relationship between two action nodes connected by the edge. That is, the action graph is a graph composed of actions as nodes and the relationship between actions as edges. The action graph defines some common actions and the relationship between actions.
[0108] See also Figure 6 , shows an example of an action graph, such as Figure 6As shown, the nodes "going out", "leading the way" and "riding" are all action nodes, and the relationship between the action node "leading the way" and the action node "riding" and the action node "eating" are "associated", that is, the action "leading the way" and the action "riding" are associated actions of the action "eating", and the nodes "eating", "washing hands" and "brushing teeth" are all action nodes. The relationship between the action node "washing hands" and the action node "eating" is "pre-positioned", that is, the action "washing hands" is the pre-action of the action "eating", and the relationship between the action node "brushing teeth" and the action node "eating" is "post-positioned", that is, the action "brushing teeth" is the post-action of the action "eating". In the conversation, when talking about "washing hands", "washing hands" and "brushing teeth" can be interacted through jumping, and when talking about "going out", "leading the way" and "riding" can be interacted through jumping.
[0109] In one possible implementation, the entity knowledge graph may include only a number of entity nodes, with edges between related entity nodes, and each edge having a relationship between two entity nodes connected by the edge. Considering that some entities may have multiple semantics, such as "apple", which may be a fruit or a mobile phone brand, in order to clarify the entity semantics and avoid ambiguity, in another more preferred implementation, the entity knowledge graph may include entity concept nodes, a number of entity type nodes and a number of entity nodes, a number of entity type nodes are connected to the entity concept nodes, a number of entity type nodes are subordinate nodes of the entity concept nodes, each entity node is associated with the entity type node to which it belongs, each entity node is a subordinate node of the entity type node to which it belongs, and there are edges between related entity nodes, and each edge has a relationship between two entity nodes connected by the edge.
[0110] See also Figure 7 , shows an example of an entity knowledge graph, Figure 7 The entity knowledge graph shown includes: the entity concept node "food", the entity category nodes "dishes", "fruits", and "desserts" under the entity concept node, and the entity nodes under each entity category node, namely, the entity nodes under "dishes" (for example, the entity node "rock sugar and snow pear"), the entity nodes under "fruits" (for example, the entity node "snow pear"), and the entity nodes under "desserts" (for example, the entity node "pear paste"), wherein there are edges between entity nodes with relationships, and the edges have the relationship between two entity nodes, for example, the entity node "snow pear" is the raw material of the entity node "rock sugar and snow pear", and the entity node "snow pear" is the raw material of the entity node "pear paste".
[0111] It should be noted that the entity nodes are classified so that during the dialogue interaction, communication can be conducted on different types of entities. For example, when the user talks about "snow pear", communication can be conducted on the method of making "rock sugar snow pear". For another example, when the user talks about "snow pear", communication can be conducted on what foods can be made from snow pear.
[0112] Among them, the event graph includes several event nodes. The event nodes with relationships in the event graph are connected by edges. Each edge in the event graph has the specific relationship between the two event nodes it connects. That is, the event graph is a graph composed of events as nodes and the relationships between events as edges. The event graph defines the relationship between events. It should be noted that an event is a combination of elements composed of actions (with actions as the core) and entities.
[0113] See also Figure 8 , shows an example of a fact map, Figure 8 The event nodes in include "going out to a restaurant", "eating food", "liking food", "going out to KFC" and "buying toys", among which "liking food" is the associated event node of "eating food", "eating food" is the subsequent event node of "going out to a restaurant", "buying toys" is the subsequent event node of "going out to KFC", and "eating food" is the subsequent event node of "going out to KFC".
[0114] Step S502: Combine the action graph, entity knowledge graph and matter graph, and use the combined graph as the knowledge graph.
[0115] Specifically, the process of combining the action graph, entity knowledge graph, and event graph may include:
[0116] Step S5021: Associate the event graph with the entity knowledge graph based on the entities in the event nodes contained in the event graph.
[0117] Specifically, for each event node contained in the event graph, if the entity in the event node has a corresponding entity node in the entity knowledge graph, the entity node in the entity knowledge graph corresponding to the entity in the event node is associated with the event node.
[0118] For example, the event node is "eat braised pork in red sauce", and there is an entity node "braised pork in red sauce" in the entity knowledge graph. Since there is an entity node "braised pork in red sauce" corresponding to the entity "braised pork in red sauce" in the entity knowledge graph, the event node "eat braised pork in red sauce" in the event graph is associated with the entity node "braised pork in red sauce" in the entity knowledge graph.
[0119] Step S5022: associate the event graph with the action graph according to the actions in the event nodes included in the event graph.
[0120] Specifically, for each event node included in the event graph, if the action in the event node has a corresponding action node in the action graph, the action node in the action graph corresponding to the action in the event node is associated with the event node.
[0121] For example, the event node is "eat braised pork in brown sauce", and there is an action node "eat" in the action graph. Since there is an action node "eat" in the action graph that corresponds to the action "eat" in the event node "eat braised pork in brown sauce", the event node "eat braised pork in brown sauce" in the event graph is associated with the action node "braised pork in brown sauce" in the action graph.
[0122] Through the above process, a knowledge graph including event nodes, entity nodes, action nodes and the relationships between nodes can be constructed.
[0123] Fourth embodiment
[0124] This embodiment introduces the implementation process of "Step S103: conducting a dialog interaction with the user based on the knowledge nodes in the node set" in the first embodiment.
[0125] The process of conducting a dialog interaction with a user based on a knowledge node in a node set may include: determining a node based on which this interaction is based from the node set as a target node; and conducting a dialog interaction with the user based on the target node. The process of conducting a dialog interaction with a user based on a target node may include: conducting a dialog interaction with a user for the target node, or conducting a dialog interaction with a user for a relationship on an edge connected to the target node, or conducting a dialog interaction with a user for a node related to the target node in the knowledge graph.
[0126] It can be understood that the node set may include one node or multiple nodes. The following introduces the process of determining the node based on which this interaction is based in two cases respectively.
[0127] When the node set contains only one node: the node contained in the node set is determined as the node based on which this interaction is based.
[0128] When the node set contains multiple nodes: in one possible implementation, a node can be randomly selected from the node set, and the node randomly selected from the node set is used as the node based on which this interaction is based; considering that the event node contains more information, in another more preferred implementation, if there is an event node in the node set, the event node in the node set is determined as the node based on which this interaction is based. It should be noted that if there are multiple event nodes in the node set, an event node can be randomly selected from the multiple event nodes as the node based on which this interaction is based. If there is no event node in the node set, a node is randomly selected from the node set as the node based on which this interaction is based. The principle of the second implementation method for determining the node based on which this interaction is based is: give priority to event nodes, and when there is no event node, then consider entity nodes and action nodes.
[0129] After determining the node on which this interaction is based, namely the target node, the interaction can be performed based on the target node. In an optional implementation method, a dialogue interaction can be performed with the user regarding the target node. When performing a dialogue interaction with the user regarding the target node, resources related to the target node (such as stories, nursery rhymes, dialogue flows, etc.) can be obtained from the resource library, and a dialogue interaction can be performed with the user based on the resources related to the target node.
[0130] Among them, there are multiple implementation methods for obtaining resources related to the target node from the resource library. In one possible implementation method, each node in the knowledge graph can be pre-associated with the relevant resources in the resource library. After the target node is determined, the resources associated with the target node can be directly obtained from the resource library. In another possible implementation method, each node in the knowledge graph does not need to be associated with the relevant resources in the resource library in advance. After the target node is determined, the resources related to the target node can be retrieved from the resource library based on the target node.
[0131] Specifically, based on the resources related to the target node, the process of performing a dialog interaction with the user may include: generating reply data for the user's dialog interaction data based on the resources related to the target node, and feeding back the reply data to the user.
[0132] Optionally, this application can set up multiple reply strategies for the user's dialogue interaction data, such as empathy reply (empathy for the user's dialogue interaction data, for example, the user said something interesting, the machine should show interest, and can empathically say that what you said is really interesting), design dialogue library (reply according to the designed dialogue process), automatic generation (automatically generate reply content), each reply strategy corresponds to different resources, when generating reply data, the reply data is generated based on the relevant resources in the resources corresponding to each reply strategy. It should be noted that the automatic generation of this reply strategy is mainly to automatically generate replies to user interaction data through a model. This automatic generation of this reply strategy is usually used as a fallback, that is, when there is no content to interact with the user, the reply data can be automatically generated based on the model, and the model used to automatically generate reply data can be used as the resource corresponding to the automatic generation of this reply strategy.
[0133] Optionally, when the node set includes multiple nodes, after completing this interaction based on the target node, the next interaction with the user can be performed based on the nodes in the node set other than the target node. When the node set includes only one node, the next interaction with the user can be performed based on the node connected to the target node through an edge in the knowledge graph. It should be noted that when the node set includes multiple nodes, the next interaction with the user can also be performed based on the node connected to the target node through an edge in the knowledge graph. Of course, when performing the next conversation interaction with the user, the same method as the current interaction can be used to interact with the user, that is, to obtain the user's conversation interaction data during the next interaction, determine the knowledge nodes related to the user's conversation interaction data from the knowledge graph, so as to obtain a node set composed of the determined knowledge nodes, and perform a conversation interaction with the user based on the knowledge nodes in the node set.
[0134] It should be noted that when conducting conversational interactions based on dynamic graphs, you can interact with users based on the nodes in the dynamic graph, you can interact based on the relationships on the edges connecting the nodes in the dynamic graph, and you can also realize conversation jumps based on the edges connecting the nodes in the dynamic graph.
[0135] Through the above-mentioned first to third embodiments, it can be known that the conversation interaction method provided by the present application constructs a knowledge graph that can cover user-related events, actions and entities. On this basis, the structured intent (a combination of open intent and slot value) determined based on the open semantic understanding model can be located to the node in the knowledge graph, and then the interaction is carried out based on the resources associated with the node in the resource library. The conversation interaction method provided by the present application can realize the chat interaction with the user based on the knowledge graph. Since the interaction with the user is based on the knowledge graph, the interaction is stable and controllable. Since the interaction with the user can be based on the resources related to the node hit by the structured intent in the knowledge graph, the interactive content is more rich, targeted and knowledgeable, and the user experience is better.
[0136] Fifth embodiment
[0137] The embodiment of the present application further provides a conversation interaction device. The conversation interaction device provided in the embodiment of the present application is described below. The conversation interaction device described below and the conversation interaction method described above can be referenced to each other.
[0138] See also Fig. 9 , shows a schematic diagram of the structure of the dialogue interaction device provided in an embodiment of the present application, which may include: a user data acquisition module 901, a node determination module 902 and a dialogue interaction module 903.
[0139] The user data acquisition module 901 is used to acquire the user's conversation interaction data.
[0140] The node determination module 902 is used to determine the knowledge nodes related to the conversation interaction data of the user from a pre-constructed knowledge graph containing a plurality of knowledge nodes, so as to obtain a node set consisting of the determined nodes.
[0141] The dialogue interaction module 903 performs dialogue interaction with the user based on the knowledge nodes in the node set.
[0142] Optionally, there are edges between related nodes in the knowledge graph, and each edge in the knowledge graph has a relationship between two nodes connected by the edge; the several knowledge nodes contained in the knowledge graph include event nodes, or the several knowledge nodes contained in the knowledge graph include entity nodes and / or action nodes, as well as event nodes.
[0143] Optionally, the node determination module 902 may include: an intention and slot value determination module, an intention and slot value combination module, and an intention matching module.
[0144] The intention and slot value determination module is used to determine the user intention and slot value according to the user's dialogue interaction data. Optionally, the user intention is an implicit open intention, and the slot value is an entity.
[0145] The intent and slot value combination module is used to combine the user intent with the slot value, and the obtained combined data is used as the structured intent.
[0146] An intent matching module is used to determine a node matching the structured intent from the knowledge graph as a node related to the user's conversation interaction data.
[0147] Optionally, when the intention and slot value determination module determines the user intention and slot value according to the user's dialogue interaction data, it is specifically used to:
[0148] An open intent determination part of a pre-established open domain semantic understanding model is used to determine an open intent of a specified type based on the user's conversation interaction data as the user intent; and a slot value extraction part of the open domain semantic understanding model is used to extract an entity of a specified type from the user's conversation interaction data as the slot value.
[0149] Optionally, the knowledge graph includes several knowledge nodes including entity nodes, action nodes and event nodes.
[0150] The dialogue interaction device provided in the embodiment of the present application may also include: a knowledge graph construction module.
[0151] The knowledge graph construction module is used to obtain an action graph, an entity knowledge graph and a matter graph, and combine the action graph, the entity knowledge graph and the matter graph, and the combined graph is used as the knowledge graph.
[0152] Among them, the action graph includes a number of action nodes, and there are edges between the related action nodes in the action graph, and each edge has the relationship between the two action nodes connected by the edge; the entity knowledge graph includes a number of entity nodes, and there are edges between the related entity nodes in the entity knowledge graph, and each edge has the relationship between the two entity nodes connected by the edge; the matter graph includes a number of event nodes, and there are edges between the related event nodes in the matter graph, and each edge has the relationship between the two event nodes connected by the edge.
[0153] Optionally, the entity knowledge graph also includes: an entity concept node and several entity type nodes connected to the entity concept node, the several entity type nodes are subordinate nodes of the entity concept node; each of the several entity nodes is associated with the entity type node to which it belongs, and each entity node is a subordinate node of the entity type node to which it belongs.
[0154] Optionally, the event nodes in the event graph include actions and entities, and the knowledge graph construction module is specifically used to:
[0155] According to the entities in the event nodes contained in the affair graph, the affair graph is associated with the entity knowledge graph; according to the actions in the event nodes contained in the affair graph, the affair graph is associated with the action graph.
[0156] Optionally, when the knowledge graph construction module associates the event graph with the entity knowledge graph according to the entities in the event nodes included in the event graph, it is specifically used to:
[0157] For each event node included in the event graph, if there is an entity node corresponding to the entity in the event node in the entity knowledge graph, the entity node corresponding to the entity in the event node in the entity knowledge graph is associated with the event node.
[0158] Optionally, when the knowledge graph construction module associates the event graph with the action graph according to the actions in the event nodes included in the event graph, it is specifically used to:
[0159] For each event node included in the event graph, if there is an action node corresponding to the action in the event node in the action graph, the action node corresponding to the action in the event node in the action graph is associated with the event node.
[0160] There are edges between related nodes in the knowledge graph, and each edge in the knowledge graph has a relationship between the two nodes connected by the edge.
[0161] Optionally, when the dialogue interaction module 903 conducts a dialogue interaction with the user based on the knowledge nodes in the node set, it is specifically configured to:
[0162] Determine the node on which this interaction is based from the node set as the target node; conduct a dialog interaction with the user regarding the target node, or conduct a dialog interaction with the user regarding the relationship on the edge connected to the target node, or conduct a dialog interaction with the user regarding the node related to the target node in the knowledge graph.
[0163] Optionally, when determining the node on which the current interaction is based from the node set, the dialog interaction module 903 is specifically configured to:
[0164] When the node set contains only one node, the node is determined as the node on which the current interaction is based; when the node set contains multiple nodes, if there is an event node among the multiple nodes, the event node among the multiple nodes is determined as the node on which the current interaction is based; if there is no event node among the multiple nodes, a node is randomly selected from the multiple nodes as the node on which the current interaction is based.
[0165] Optionally, the dialogue interaction module 903 performs a dialogue interaction with the user for the target node, including:
[0166] Acquire resources related to the target node from a resource library; and perform a dialog interaction with the user based on the resources related to the target node.
[0167] Optionally, the dialogue interaction module 903 is further used for:
[0168] If the node set includes multiple nodes, a subsequent conversation interaction is performed with the user based on the nodes in the node set except the target node; if the node set includes one node, a subsequent conversation interaction is performed with the user based on the nodes related to the target node in the knowledge graph.
[0169] The conversation interaction device provided in the embodiment of the present application first obtains the conversation interaction data of the user, then determines the knowledge nodes related to the conversation interaction data of the user from the pre-built knowledge graph to obtain a node set composed of the determined nodes, and finally performs conversation interaction with the user based on the nodes in the node set. The conversation interaction device provided in the embodiment of the present application can realize the chat interaction with the user based on the knowledge graph. Since the interaction with the user is based on the knowledge graph, the interaction is stable and controllable. Since the interaction with the user is based on the knowledge nodes (event nodes, entity nodes, action nodes) related to the conversation interaction data of the user in the knowledge graph, the interaction content is richer, more targeted and more knowledgeable, and the user experience is better.
[0170] Sixth embodiment
[0171] The present application also provides a dialogue interaction device. Fig.10 , showing a schematic diagram of the structure of the dialogue interaction device, the dialogue interaction device may include: at least one processor 1001, at least one communication interface 1002, at least one memory 1003 and at least one communication bus 1004;
[0172] In the embodiment of the present application, the number of the processor 1001, the communication interface 1002, the memory 1003, and the communication bus 1004 is at least one, and the processor 1001, the communication interface 1002, and the memory 1003 communicate with each other through the communication bus 1004;
[0173] The processor 1001 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;
[0174] The memory 1003 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;
[0175] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:
[0176] Obtain user conversation interaction data;
[0177] Determine, from a pre-constructed knowledge graph comprising a plurality of knowledge nodes, knowledge nodes related to the conversation interaction data of the user, to obtain a node set consisting of the determined knowledge nodes;
[0178] Based on the knowledge nodes in the node set, a dialog interaction is performed with the user.
[0179] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0180] Seventh embodiment
[0181] The embodiment of the present application further provides a computer-readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:
[0182] Obtain user conversation interaction data;
[0183] Determine, from a pre-constructed knowledge graph comprising a plurality of knowledge nodes, knowledge nodes related to the conversation interaction data of the user, to obtain a node set consisting of the determined knowledge nodes;
[0184] Based on the knowledge nodes in the node set, a dialog interaction is performed with the user.
[0185] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0186] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0187] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0188] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A conversation interaction method, characterized in that: include: Obtain user conversation interaction data; Determining, from a pre-constructed knowledge graph comprising a plurality of knowledge nodes, knowledge nodes related to the user's dialog interaction data, to obtain a node set consisting of the determined knowledge nodes, wherein the knowledge graph comprises a plurality of knowledge nodes and relationships between the plurality of knowledge nodes, the plurality of knowledge nodes comprised in the knowledge graph comprise event nodes, or the plurality of knowledge nodes comprised in the knowledge graph comprise entity nodes and / or action nodes, and event nodes; Conducting a dialog interaction with the user based on the knowledge nodes in the node set; If the knowledge graph contains several knowledge nodes including entity nodes, action nodes and event nodes, the process of constructing the knowledge graph includes: obtaining an action graph, an entity knowledge graph and a matter graph; combining the action graph, the entity knowledge graph and the matter graph, and using the combined graph as the knowledge graph; wherein the action graph is a graph containing several action nodes and the relationships between the action nodes, the entity knowledge graph is a graph containing several entity nodes and the relationships between the entity nodes, and the matter graph is a graph containing several event nodes and the relationships between the event nodes.
2. The method for dialog interaction according to claim 1, characterized in that: The step of determining the knowledge nodes related to the user's conversation interaction data from a pre-built knowledge graph containing a plurality of knowledge nodes includes: Determine the user intention and slot value according to the user's conversation interaction data, wherein the slot value is an entity; Combining the user intent with the slot value, and obtaining the combined data as a structured intent; A node matching the structured intent is determined from the knowledge graph as a node related to the conversation interaction data of the user.
3. The method for dialog interaction according to claim 2, characterized in that: The determining the user intention and the slot value according to the user's dialogue interaction data includes: Using an intention determination module, based on the user's conversation interaction data, determining an open intention of a specified type as the user intention; A slot value extraction module is used to extract entities of a specified type from the user's conversation interaction data as the slot value.
4. The method for dialog interaction according to claim 1, characterized in that: The entity knowledge graph further includes: an entity concept node and a plurality of entity type nodes connected to the entity concept node, wherein the plurality of entity type nodes are subordinate nodes of the entity concept node; Each entity node among the plurality of entity nodes is associated with the entity type node to which it belongs, and each entity node is a subordinate node of the entity type node to which it belongs.
5. The method for dialog interaction according to claim 1, characterized in that: The event nodes in the event graph include actions and entities; The combining of the action graph, the entity knowledge graph and the event graph comprises: According to the entities in the event nodes contained in the event graph, the event graph is associated with the entity knowledge graph; According to the actions in the event nodes included in the event graph, the event graph is associated with the action graph.
6. The method for dialog interaction according to claim 5, characterized in that: The associating the event graph with the entity knowledge graph according to the entities in the event nodes included in the event graph includes: For each event node included in the event graph, if there is an entity node corresponding to the entity in the event node in the entity knowledge graph, then the entity node corresponding to the entity in the event node in the entity knowledge graph is associated with the event node; The associating the event graph with the action graph according to the actions in the event nodes included in the event graph includes: For each event node included in the event graph, if there is an action node corresponding to the action in the event node in the action graph, the action node corresponding to the action in the event node in the action graph is associated with the event node.
7. The method for dialog interaction according to claim 1, characterized in that: There are edges between the nodes with relationships in the knowledge graph, and each edge in the knowledge graph has a relationship between the two nodes connected by the edge; The performing a dialog interaction with the user based on the knowledge nodes in the node set includes: Determine the node on which this interaction is based from the node set as the target node; Conducting a dialog interaction with the user regarding the target node, or conducting a dialog interaction with the user regarding a relationship on an edge connected to the target node, or conducting a dialog interaction with the user regarding a node in the knowledge graph that is related to the target node.
8. The method for dialog interaction according to claim 7, characterized in that: Determining the node on which the current interaction is based from the node set includes: When the node set contains only one node, the node is determined as the node on which the current interaction is based; In the case where the node set includes multiple nodes, if there is an event node among the multiple nodes, the event node among the multiple nodes is determined as the node based on which this interaction is based; if there is no event node among the multiple nodes, a node is randomly selected from the multiple nodes as the node based on which this interaction is based.
9. The method for dialog interaction according to claim 7, characterized in that: The performing a dialog interaction with the user with respect to the target node includes: Acquire resources related to the target node from a resource library; Based on the resources related to the target node, a dialog interaction is performed with the user.
10. The method for dialog interaction according to claim 7, characterized in that: Also includes: If the node set includes multiple nodes, performing subsequent dialog interaction with the user based on the nodes in the node set except the target node; If the node set includes a node, a subsequent dialogue interaction is performed with the user based on nodes related to the target node in the knowledge graph.
11. A conversational interaction device, characterized in that: include: User data acquisition module, node determination module and dialogue interaction module; The user data acquisition module is used to acquire the user's conversation interaction data; The node determination module is used to determine the knowledge nodes related to the user's dialogue interaction data from a pre-constructed knowledge graph containing a plurality of knowledge nodes, so as to obtain a node set consisting of the determined nodes, wherein the knowledge graph includes a plurality of knowledge nodes and relations between the plurality of knowledge nodes, the plurality of knowledge nodes contained in the knowledge graph include event nodes, or the plurality of knowledge nodes contained in the knowledge graph include entity nodes and / or action nodes, and event nodes; The dialog interaction module is used to perform dialog interaction with the user based on the knowledge nodes in the node set; The dialog interaction device further includes: a knowledge graph construction module; The knowledge graph construction module is used to obtain an action graph, an entity knowledge graph and a matter graph, and combine the action graph, the entity knowledge graph and the matter graph, and use the combined graph as the knowledge graph; wherein the action graph is a graph including a plurality of action nodes and the relationships between the action nodes, the entity knowledge graph is a graph including a plurality of entity nodes and the relationships between the entity nodes, and the matter graph is a graph including a plurality of event nodes and the relationships between the event nodes.
12. A conversation interaction device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the dialogue interaction method according to any one of claims 1 to 10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the dialog interaction method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Knowledge Currency
US20210073654A1
System and method for generation of conversation graphs
US20210097140A1