Human-machine multi-turn dialogue method, device, intelligent robot and storage medium
By automatically generating jump relationships and intentions between state nodes, a dialogue state machine of intelligent robots is built, which solves the problem of low generation efficiency in the existing technology and realizes fast dialogue response.
Patent Information
- Application Number
- CN202011582651.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-28
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2040-12-28
AI Technical Summary
In the prior art, the generation efficiency of the human-machine multi-wheel dialogue state machine of the intelligent robot is low, resulting in slow dialogue response speed.
By obtaining the first jump relationship and intention between parent-child state nodes and their intent, the second jump relationship and intention between non-parent-child state nodes are automatically generated to build a dialogue state machine.
It improves the generation efficiency of dialogue state machines, reduces the pressure of manual writing, and achieves fast dialogue response.
Smart Images

Figure CN114691816B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular, to a multi-turn human-machine dialogue method, device, intelligent robot, and storage medium. Background Art
[0002] With the development of artificial intelligence technology, intelligent robots are increasingly entering people's lives, such as service robots, reception robots, self-moving vending robots, and so on. To facilitate user use, intelligent robots usually support various types of human-machine interaction, such as human-machine interaction based on touch operations or human-machine dialogue based on voice, and so on.
[0003] In practical applications, human-machine dialogue is usually multi-turn dialogue. At this time, a dialogue state machine maintained in the intelligent robot can be used to implement multi-turn dialogue. Specifically, after receiving a dialogue statement input by the user, the intelligent robot can determine the response statement corresponding to the dialogue statement by virtue of the jump relationship between the dialogue states included in the dialogue state machine, that is, to implement human-machine dialogue. Summary of the Invention
[0004] Embodiments of the present invention provide a multi-turn human-machine dialogue method, device, intelligent robot, and storage medium, so as to improve the generation efficiency of the state machine and enhance the response speed of the dialogue.
[0005] Embodiments of the present invention provide a multi-turn human-machine dialogue method, and the method includes:
[0006] Obtain a first jump relationship along a first direction between parent and child state nodes among a plurality of state nodes, and a first intention corresponding to the first jump relationship;
[0007] Determine a second jump relationship along the first direction between non-parent and child state nodes among the plurality of state nodes according to the first jump relationship;
[0008] Determine a second intention corresponding to the second jump relationship according to the first intention and the second jump relationship;
[0009] Generate a dialogue state machine for implementing multi-turn dialogue according to the first jump relationship, the second jump relationship, the first intention, and the second intention.
[0010] Embodiments of the present invention provide a multi-turn human-machine dialogue device, including:
[0011] An obtaining module, configured to obtain a first jump relationship along a first direction between parent and child state nodes among a plurality of state nodes, and a first intention corresponding to the first jump relationship;
[0012] A relationship determination module, configured to determine a second jump relationship in the first direction between non-parent-child state nodes among the multiple state nodes according to the first jump relationship;
[0013] An intention determination module, configured to determine a second intention corresponding to the second jump relationship according to the first intention and the second jump relationship;
[0014] A generation module, configured to generate a dialogue state machine for implementing multi-turn conversations according to the first jump relationship, the second jump relationship, the first intention, and the second intention.
[0015] An embodiment of the present invention provides an intelligent robot, including: a processor and a memory; wherein, the memory is used to store one or more computer instructions, and when the one or more computer instructions are executed by the processor, the following are implemented:
[0016] Obtain a first jump relationship in the first direction between parent-child state nodes among multiple state nodes, and a first intention corresponding to the first jump relationship;
[0017] Determine a second jump relationship in the first direction between non-parent-child state nodes among the multiple state nodes according to the first jump relationship;
[0018] Determine a second intention corresponding to the second jump relationship according to the first intention and the second jump relationship;
[0019] Generate a dialogue state machine for implementing multi-turn conversations according to the first jump relationship, the second jump relationship, the first intention, and the second intention.
[0020] An embodiment of the present invention provides a computer-readable storage medium storing computer instructions, and when the computer instructions are executed by one or more processors, the one or more processors are caused to perform at least the following actions:
[0021] Obtain a first jump relationship in the first direction between parent-child state nodes among multiple state nodes, and a first intention corresponding to the first jump relationship;
[0022] Determine a second jump relationship in the first direction between non-parent-child state nodes among the multiple state nodes according to the first jump relationship;
[0023] Determine a second intention corresponding to the second jump relationship according to the first intention and the second jump relationship;
[0024] Generate a dialogue state machine for implementing multi-turn conversations according to the first jump relationship, the second jump relationship, the first intention, and the second intention.
[0025] In the human - machine multi - turn dialogue method provided by the present invention, first, obtain the first jump relationship along the first direction between the parent and child nodes among multiple state nodes and their corresponding first intents, and then determine the second jump relationship along the first direction between non - parent - child state nodes and their corresponding second intents according to the first jump relationship. Among them, the state nodes represent the dialogue states in the multi - turn dialogue, and the intents are used to define the conditions for jumps between state nodes. Finally, generate a dialogue state machine according to the two jump relationships along the first direction and their respective corresponding intents to implement the multi - turn dialogue with it.
[0026] In the above - mentioned method, on the one hand, the second jump relationship and its corresponding second intent in the dialogue state machine are automatically generated according to the first jump relationship and the first intent, which can improve the efficiency of generating the dialogue state machine. On the other hand, the jump between the parent and child state nodes can be realized according to the first jump relationship and the first intent in the dialogue state machine, and the jump between non - parent - child state nodes can be realized according to the second jump relationship and the second intent. That is to say, any two state nodes among multiple state nodes can be jumped through the above - mentioned jump relationships and intents. After the user inputs a dialogue statement, the response statement of the dialogue statement can be quickly obtained, improving the dialogue response speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following - described drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.
[0028] Figure 1 It is a flowchart of a human - machine multi - turn dialogue method provided by an embodiment of the present invention;
[0029] Figure 2 It is a state transition diagram including the first jump relationship provided by an embodiment of the present invention;
[0030] Figure 3 It is a state transition diagram including the second jump relationship provided by an embodiment of the present invention;
[0031] Figure 4 It is a flowchart of another human - machine multi - turn dialogue method provided by an embodiment of the present invention;
[0032] Figure 5 It is a state transition diagram including the third jump relationship and the fourth jump relationship provided by an embodiment of the present invention;
[0033] Figure 6 It is a flowchart of yet another human - machine multi - turn dialogue method provided by an embodiment of the present invention;
[0034] Figure 7 A flowchart of yet another human-machine multi-round dialogue method provided by an embodiment of the present invention;
[0035] Figure 8 A corresponding state transition diagram of the human-machine multi-round dialogue method provided by an embodiment of the present invention applied in a shopping mall scenario;
[0036] Figure 9 A schematic structural diagram of a human-machine multi-round dialogue device provided by an embodiment of the present invention;
[0037] Figure 10 For Figure 9 A schematic structural diagram of an intelligent robot corresponding to the human-machine multi-round dialogue device provided by the illustrated embodiment; Detailed implementation manners
[0038] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0039] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "the", and "said" used in the embodiments of the present invention and the appended claims are also intended to include the plural forms. Unless clearly indicated otherwise in the context, "a plurality" generally includes at least two.
[0040] Depending on the context, the words "if", "when" as used herein may be interpreted as "when" or "while" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if determined" or "if detecting (stated condition or event)" may be interpreted as "when determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)".
[0041] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, such that a commodity or system including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such commodity or system. Without further limitation, the element defined by the statement "including one..." does not exclude the existence of additional identical elements in the commodity or system including the said element.
[0042] The following describes in detail the human-machine multi-round dialogue method provided by the present invention in combination with the following embodiments. Without conflict between the embodiments, the features in the following embodiments and each embodiment can be combined with each other. In addition, the step sequence in the following method embodiments is only an example and is not strictly limited.
[0043] In practical applications, the human-machine multi-round dialogue method can be executed by intelligent robots such as service robots, greeting robots, and self-moving vending robots. Of course, the human-machine multi-round dialogue method can also be executed by a human-machine interaction plug-in (or called a human-machine interaction interface, a human-machine interaction function module). This plug-in can be integrated into a system with human-machine interaction functions, such as an online shopping system and so on. The human-machine multi-round dialogue method can also be executed by intelligent terminals such as mobile terminals, smart home appliances, and smart wearable devices. Generally speaking, the human-machine multi-round dialogue method can be applied to any device or system that supports human-machine dialogue with users in a voice or text manner.
[0044] Figure 1 It is a flowchart of a human-machine multi-round dialogue method provided by an embodiment of the present invention, as Figure 1 shown. The method may include the following steps:
[0045] 101. Obtain the first jump relationship along the first direction between the parent and child state nodes among multiple state nodes, and the first intent corresponding to the first jump relationship.
[0046] Among them, the state node represents the dialogue state in the multi-round dialogue, and the intent is used to define the conditions for the jump between state nodes.
[0047] In practical applications, multiple state nodes, the first jump relationship along the first direction between the parent and child state nodes among multiple state nodes, and the first intent corresponding to the first jump relationship can all be written manually.
[0048] Among them, the state node represents different dialogue states that appear during the multi-round dialogue, can reflect the dialogue progress, and corresponds one-to-one with the dialogue state.
[0049] Taking the bank scenario as an example, the state transition diagram including the first jump relationship and the first intent can be as Figure 2 shown. The dialogue states may include "start", "inquire about business", "inquire about certificates", "exchange foreign currency and take a number", and "exchange foreign currency description", etc. When the state node of "inquire about business" is activated, it indicates that the dialogue is in the "inquire about business" state.
[0050] As can be seen from the above examples, the activation of multiple state nodes has a sequence, and this sequence also indicates the hierarchical relationship between multiple state nodes. For example, during a conversation, the "inquire about business" state node needs to be activated first, and then the "inquire about certificates" state node will be activated. These two state nodes can form a pair of parent-child state nodes.
[0051] In Figure 2 , "start" and "inquire about business" can form a pair of parent-child state nodes, and "inquire about certificates" and "exchange foreign currency for number" as well as "inquire about certificates" and "exchange foreign currency instructions" can also form a pair of parent-child state nodes respectively. That is to say, two adjacent-level state nodes can form a pair of parent-child state nodes with a jump relationship, while two non-adjacent-level state nodes can form a pair of non-parent-child state nodes. For example Figure 2 in, "start" and "inquire about certificates", "start" and "exchange foreign currency for number", "inquire about business" and "exchange foreign currency instructions", and so on. Figure 2 The directed solid lines in
[0052] are used to represent the first jump relationship between parent-child state nodes, and the direction of the solid line is the jump direction between parent-child state nodes. Figure 1 Among them, the intention is used to limit the conditions for jumps to occur between state nodes. That is to say, the intention is the condition for realizing the jump relationship, and the jump relationship and the intention
[0053] are in one-to-one correspondence. Figure 2 shown.
[0054] Continuing the above examples, for the pair of parent-child state nodes "start" and "inquire about business", there is a first jump relationship between them along the first direction. If the first intention obtained is "get a number", then the jump condition is satisfied. At this time, the "inquire about business" sub-state node is activated, and the "start" parent state node is deactivated. The multi-round conversation then jumps from the "start" state to the "inquire about business" state.
[0055] 102. Determine the second jump relationship between non-parent-child state nodes among multiple state nodes along the first direction according to the first jump relationship.
[0056] Due to the flexibility of conversations in actual use, there can be a jump relationship in the first direction between any two of the multiple manually written state nodes. Optionally, through permutation and combination, the jump relationship in the first direction between any two state nodes can be obtained. The jump relationship obtained at this time includes not only the jump relationship between parent and child state nodes, that is, the first jump relationship, but also the jump relationship between non-parent and child nodes. Therefore, the jump relationship in the first direction between any two state nodes can be compared with the first jump relationship, and the difference between the two can be determined as the second jump relationship. The second jump relationship is automatically generated, which reduces the pressure of manual writing and improves the generation efficiency of the dialogue machine. The automatically generated second relationship can be as Figure 3 shown by the dotted line in
[0057] 103. According to the first intention and the second jump relationship, determine the second intention corresponding to the second jump relationship.
[0058] The first jump relationship is the jump between parent and child state nodes, and the first intention is the condition to be satisfied to achieve the first jump relationship. Since parent and child state nodes are hierarchically adjacent state nodes, the condition to be satisfied for the jump is to obtain a single intention, that is, the first intention is a single intention. If the sentence input by the user has a single intention, the jump between parent and child state nodes can be achieved, and this part can be combined with Figure 2 understood.
[0059] Similarly, for non-parent and child state nodes that are not hierarchically adjacent, to achieve the second jump relationship, a multi-intention needs to be obtained, that is, a second intention that includes multiple first intentions needs to be obtained. The first intentions included in the second intention are the first intentions respectively corresponding to the multiple pairs of parent and child state nodes covered in the second jump relationship.
[0060] Taking the bank scenario as an example, for the pair of non-parent and child state nodes "start" and "ask for documents", there are covered the two pairs of parent and child state nodes "start" and "ask about business" and "ask about business" and "ask for documents". Therefore, the second intention to be satisfied for the jump between this pair of non-parent and child state nodes is "take a number + exchange foreign currency", which is composed of the first intention "take a number" corresponding to the pair of parent and child state nodes "start" and "ask about business" and the first intention "exchange foreign currency" corresponding to the pair of parent and child state nodes "ask about business" and "ask for documents".
[0061] The above process is also the process of further automatically combining the second intention based on the automatically generated second jump relationship, which can further reduce the pressure of manual writing and improve the generation efficiency of the state machine. At this time, Figure 2 the content in the state transition diagram shown will be enriched to form Figure 3 the state transition diagram shown.
[0062] 104. Generate a dialogue state machine for implementing multi-turn conversations based on the first jump relationship, the second jump relationship, the first intention, and the second intention.
[0063] Finally, it is formed by the first jump relationship between the parent and child state nodes and its corresponding first intention, and the second jump relationship between non-parent and child state nodes and its corresponding second intention. Figure 3 The state transition diagram shown is included in the dialogue state machine. In practical applications, the intelligent robot can use the dialogue state machine containing the state transition diagram to implement multi-turn conversations. The specific conversation process can be referred to the description in the following embodiments as Figure 7 shown.
[0064] In this embodiment, first obtain the first jump relationship between the parent and child nodes among multiple state nodes along the first direction and its corresponding first intention, and then determine the second jump relationship between non-parent and child state nodes along the first direction and its corresponding second intention. Finally, generate a dialogue state machine that can implement multi-turn conversations based on the obtained jump relationships and intentions.
[0065] In the above method, on the one hand, the second jump relationship and its corresponding second intention in the dialogue state machine are automatically generated based on the first jump relationship and the first intention, thereby improving the efficiency of generating the dialogue state machine and reducing the pressure of manual writing. On the other hand, the jump between the parent and child state nodes can be realized according to the first jump relationship and the first intention in the dialogue state machine, and the jump between non-parent and child state nodes can be realized according to the second jump relationship and the second intention. That is, any two state nodes among multiple state nodes can be jumped through the above jump relationships and intentions. After the user inputs a dialogue statement, the response statement of the dialogue statement can be quickly obtained, improving the dialogue response speed.
[0066] In the above embodiment, the jump relationship between multiple state nodes along the first direction has been obtained. According to this jump relationship, multiple state nodes can be activated in sequence according to the level, and the dialogue state will also change continuously, thereby realizing multi-turn conversations. Combined with Figure 2 or Figure 3 the state transition diagram shown for understanding, in a bank scenario, in most cases, the dialogue state will change from "start" to "inquire about business", "inquire about certificates", and "exchange foreign currency and take a number" in sequence, that is, the state nodes corresponding to each dialogue state will be activated in sequence, and the user can realize multi-turn conversations about exchanging foreign currency.
[0067] Continuing with the above bank scenario, in actual applications, the dialogue state does not necessarily change sequentially from "start" until it becomes "forex queuing", that is, the state nodes are not necessarily activated sequentially according to their hierarchical levels. There may be cases where the state nodes jump backwards. At this time, the dialogue state will also change backwards. For example, the dialogue state jumps back from "forex queuing" to "inquiry about services".
[0068] At this time, Figure 4 is a flowchart of another human-machine multi-round dialogue method provided by an embodiment of the present invention. As Figure 4 shown, the method may further include the following steps:
[0069] 201. Determine the third jump relationship between the parent and child state nodes along the second direction according to the first jump relationship.
[0070] 202. Determine the fourth jump relationship between non-parent and child state nodes along the second direction according to the second jump relationship.
[0071] Specifically, due to the flexibility of the dialogue in actual use, there may also be a jump relationship along the second direction between any two state nodes among multiple state nodes, where the second direction may be the reverse direction of the first direction. Therefore, the third jump relationship between the parent and child state nodes along the second direction can be further automatically generated according to the first jump relationship.
[0072] Similarly, non-parent and child state nodes can jump along the first direction and can also jump along the reverse direction of the first direction. Therefore, the fourth jump relationship between non-parent and child state nodes along the second direction can also be further automatically generated according to the second jump relationship.
[0073] In actual applications, a parent state node may include multiple child state nodes. For example Figure 2 or Figure 3 the "inquiry about documents" parent state node in contains the "forex queuing" child state node and the "forex explanation" child state node. These multiple child state nodes can also jump to each other, and the jump direction between the two can also be considered the second direction.
[0074] It should be noted that the present invention does not limit what the second direction specifically is. According to actual needs, any direction different from the first direction can be called the second direction.
[0075] Based on the above Figure 3The state transition diagram shown, for example, for the state node of "foreign exchange and number taking", the corresponding third jump relationship may include jumping from the "foreign exchange and number taking" state node to any one of the "document inquiry" state node, the "service inquiry" state node, and the "start" state node. Then the intentions to be satisfied for jumping from the "foreign exchange and number taking" state node to the "document inquiry" state node are "foreign currency exchange" or "number taking + foreign currency exchange"; the intention to be satisfied for jumping from the "foreign exchange and number taking" state node to the "service inquiry" state node is "number taking".
[0076] For the state node of "foreign exchange and number taking", the corresponding fourth jump relationship may include jumping from "foreign exchange and number taking" to "foreign exchange instructions", and the intentions to be satisfied for realizing such a jump are any one of "without documents", "foreign currency exchange + without documents", and "number taking + foreign currency exchange + without documents".
[0077] After performing the above steps, the content in the state transition diagram can be further enriched to obtain Figure 5 the state transition diagram shown. The richer the content in the state transition diagram, the more complete the jump relationship between the state nodes, the higher the flexibility of the multi-round dialogue, and the better the user's dialogue experience. Based on the complete state transition diagram, it is not easy to have a situation where the dialogue cannot proceed due to the lack of jump relationship between the state nodes.
[0078] After that, a dialogue state machine can be further generated according to the state transition diagram including the first jump relationship to the fourth jump relationship and the first intention and the second intention.
[0079] In this embodiment, based on the manually written first jump relationship and the automatically generated second jump relationship, the third jump relationship and the fourth jump relationship can be further automatically generated, so as to enrich the state transition diagram in the dialogue state machine and make the multi-round dialogue proceed smoothly.
[0080] It should also be noted that the execution order of the above steps 201 and 202 is only an illustration, and the present invention does not limit the execution timing of the two. For example, the above steps 201 and 202 can be sequentially executed after step 102, or step 201 can be executed after step 101, and step 202 can be executed after step 102, etc.
[0081] When implementing a multi-round dialogue using a dialogue state machine, in addition to including a state transition diagram, the dialogue state machine also includes statements corresponding to each of the multiple state nodes and statements corresponding to each of the multiple intentions. The jumps of the state nodes are reflected by these statements, so as to realize a multi-round dialogue.
[0082] Specifically, the statements corresponding to each state node can be output by the intelligent robot to the user, and the user will generate a response to them, resulting in dialogue statements. The intelligent robot then semantically matches the dialogue statements with the statements corresponding to each of the multiple intents. If the dialogue statement has the same semantics as the statement corresponding to a certain intent, the jump condition for a pair of parent-child state nodes or non-parent-child state nodes is satisfied, and the state node jump is realized. According to the state node that is in the active state after the jump, the intelligent robot will finally output the corresponding statement to respond to the user, thereby realizing the dialogue.
[0083] For the acquisition of the statements corresponding to the state nodes and the intents respectively, Figure 6 is a flowchart of another method for generating a dialogue state machine provided by an embodiment of the present invention. As Figure 6 shown, after step 103, the method may further include the following steps:
[0084] 301. Obtain a first statement with a first intent, where the first statement is used to activate the sub-state node in the first jump relationship, causing a jump between the parent-child state nodes.
[0085] 302. According to the inclusion relationship between the second intent and the first intent, combine the first statement to obtain a second statement with the second intent, where the second statement is used to activate the state node that is farthest from the root node among the multiple state nodes in the second jump relationship, causing a jump between the non-parent-child state nodes.
[0086] 303. Obtain the third statements corresponding to each of the multiple state nodes.
[0087] Similar to the multiple state nodes, the first jump relationship, and the first intent, the first statement and the third statement can also be written manually. The first statement has the first intent. The process of using the first statement to activate the state node can be: if the dialogue statement generated by the user has the same semantics as the first statement, the jump condition for a pair of parent-child state nodes is satisfied. At this time, the activation of the parent state node is cancelled, and the sub-state node is activated, and the dialogue state also changes accordingly.
[0088] In practice, each first intent can correspond to at least one first statement. Continuing with the above-mentioned bank scenario, the relationship between the first intent and the first statement can be seen in Table 1 below.
[0089] Table 1: Intent Table
[0090]
[0091] According to the description in the above embodiments, the state nodes correspond one-to-one with the dialogue states. Each state node also has a third statement that can reflect the dialogue state. The relationship between the two can be seen in Table 2 below. When the state node is in the active state, the intelligent robot outputs the third statement corresponding to the state node to the user.
[0092] Table 2: State Table
[0093]
[0094] For the generation of the second statement, according to Figure 1 the description in the embodiments shown, since the second intention contains multiple first intentions, therefore, an optional way is to combine the first statements through the inclusion relationship between the second intention and the first intention, so as to automatically generate the second statement with the second intention. The second statement contains multiple first intentions.
[0095] For example, assume that the second intention is composed of the first intention "take a number" and the first intention "exchange foreign currency". Then the second statement can combine the first statement "I want to take a number" corresponding to the first intention "take a number" and the first statement "I want to exchange some US dollars" corresponding to the first intention "exchange foreign currency" to obtain the second statement with the second intention "I want to take a number, I want to exchange some US dollars".
[0096] In the bank scenario, the relationship between the second intention and the second statement can be seen in Table 3 below. However, not all second intentions included in the state transition diagram shown in Table 3 are displayed. Figure 5 the state transition diagram shown contains.
[0097] Table 3: Intention Table
[0098]
[0099] Another optional way is that after obtaining the first statement, it is also possible to further determine whether there is a component default in the first statement, and filter out the statements with component defaults to obtain the filtered statements. Then, according to the inclusion relationship between the second intention and the first intention, combine the filtered statements to obtain the second statement with the second intention. Optionally, for whether there is a component default in the statement, it can be recognized manually or by a pre-trained neural network model.
[0100] Since the second statement is composed of multiple first statements, the default of components in the first statement is likely to cause the intention of the second statement to be unclear, thus affecting the semantic matching between the dialogue statement generated by the user and the first statement and the second statement, resulting in the inability to continue the dialogue. Therefore, this problem can be avoided through the above filtering process.
[0101] In this embodiment, a second statement can be further automatically generated according to the first statement and the automatically generated second intention, so as to improve the generation efficiency of the dialogue state machine and reduce the pressure of manual writing.
[0102] Based on the multiple state nodes written manually, the first jump relationship, and the first intention in the above-mentioned embodiments, a second jump relationship and its corresponding second intention can be automatically generated. Further, a third jump relationship and a fourth jump relationship are automatically generated. At the same time, based on the first statement with the first intention written manually, a second statement with the second intention can also be automatically combined and generated. Finally, a dialogue state machine is composed of a state transition diagram including multiple jump relationships and multiple intentions, and statements with different intentions. The above automatic generation processes of jump relationships, intentions, and statements can all improve the generation efficiency of the dialogue state machine and reduce the pressure of manual writing.
[0103] After automatically generating the dialogue state machine according to the above-mentioned embodiments, the dialogue state machine can be further used to implement multi-turn conversations. Figure 7 FIG. is a flowchart of another human-machine multi-turn conversation method provided by an embodiment of the present invention. As Figure 7 shown, after step 104, the method may further include the following steps:
[0104] 401. Receive a dialogue statement input by a user.
[0105] Continuing to assume the bank scenario, if the current dialogue state is in the "start" state, that is, the "start" state node in the state transition diagram included in the dialogue state machine is in an active state, the intelligent robot can output a third statement "Hello" corresponding to this state node. The user can respond to this third statement to generate a dialogue statement "I want to take a number".
[0106] 402. Determine a target statement that semantically matches the dialogue statement among the first statement and the second statement.
[0107] Next, after obtaining the dialogue statement generated by the user, the intelligent robot can determine a target statement that semantically matches the dialogue statement among the single-intention first statements shown in Table 1 and the multi-intention second statements shown in Table 3, respectively.
[0108] Optionally, an unsupervised method can be adopted to obtain the vector of each word in the statement by querying the word vector dictionary, and further obtain the statement vector of the entire statement. Then, calculate the similarity between the statement vector of the dialogue statement and the statement vectors of the first statement and the second statement respectively, such as cosine similarity, or the cosine similarity of the sentence vector combined with the weights of words or characters. If the similarity between the statement vector of the dialogue statement and the statement vector of the target statement meets the preset threshold, it is determined that the dialogue statement and the target statement are semantically matched. The target statement is either the first statement or the second statement.
[0109] Continuing with the above example, by performing semantic matching on the dialogue statement, the first statement, and the second statement in Table 1 in sequence, it can be obtained that the similarity between the statement vectors of the dialogue statement "I want to take a number" and the first statement "I want to take a number" meets the preset threshold. This first statement "I want to take a number" is also the target statement.
[0110] To further improve the accuracy of semantic matching, optionally, a supervised training method can also be used to train a language model, and then use this language model to encode the dialogue statement, the first statement, and the second statement to further obtain the encoded statement vectors of each statement. Then, use this language model to calculate the similarity between the encoded statement vector of the dialogue statement and the encoded statement vectors corresponding to the first statement and the second statement respectively. The similarity can be specifically represented as cosine distance. If the similarity between the encoded statement vector of the dialogue statement and the encoded statement vector of the target statement meets the preset threshold, it is determined that the dialogue statement and the target statement are semantically matched.
[0111] Optionally, in practical applications, the statement vectors corresponding to the first statement and the second statement can be pre-generated and saved in advance. Then, when performing step 402, only the statement vector of the dialogue statement needs to be generated in real time.
[0112] 403. According to the intention of the target statement, activate the state node in the jump relationship corresponding to the target statement.
[0113] 404. Determine the third statement corresponding to the activated state node as the response statement of the dialogue statement.
[0114] In the above example, the dialogue statement "I want to take a number" generated by the user is a single-intention statement, and the obtained target statement "I want to take a number" is also a single-intention statement. Then, according to the intention of the target statement, it is possible to cause a jump between the pair of parent-child state nodes of the "start" state node and the "inquire about business" state node, that is, activate the "inquire about business" state node and deactivate the "start" state node. At the same time, determine the third statement "What business do you need to handle?" corresponding to the "inquire about business" state node as the response statement of the dialogue statement input by the user, thus completing a round of dialogue.
[0115] In another case, the dialogue statement generated by the user can also be a multi-intent statement. For example, "I want to take a number and I want to exchange US dollars", then the target statement "I want to take a number and I want to exchange some US dollars" obtained after semantic matching is also a multi-intent second statement. At this time, according to the intent of the target statement, it is possible to cause a jump between a pair of non-parent and child state nodes, namely the "Start" state node and the "Ask for ID" state node. That is, the "Ask for ID" state node, which is the lowest-level and farthest from the root node among the non-parent and child state nodes, is activated, and at the same time, the "Start" state node in the non-parent and child state nodes is deactivated. Then, the third statement corresponding to the activated "Ask for ID" state node, "Do you have your ID card and bank card with you?", is determined as the response statement to the dialogue statement input by the user. Among them, the root node of the multiple state nodes is the "Start" state transition node.
[0116] In this embodiment, multi-turn dialogue can be realized through the state transition diagram, the first statement, and the second statement included in the dialogue state machine. And because the state transition diagram contains the jump relationships between various state nodes in different directions, the jumps between state nodes are very flexible, which also makes the dialogue proceed flexibly.
[0117] During the process of multi-turn dialogue, multiple state nodes are usually activated in sequence in the first direction, that is, the above-mentioned first jump relationship and second jump relationship will be used to realize the multi-turn dialogue. Through multi-turn dialogue, the intelligent robot can provide a certain service for the user. In the above bank scenario, the intelligent robot can provide a number-taking service for the user through multi-turn dialogue. However, in the actual dialogue process, during the process of activating state nodes in sequence in the first direction, the user's intention may change, and then the state nodes will be activated in the second direction.
[0118] In the bank scenario, when the intelligent robot outputs the third statement "Hello, please swipe your ID card to take a number" to the user, the user will generate a dialogue statement "I have my ID". After semantic matching, the "Exchange foreign currency and take a number" state node is activated, and the intelligent robot uses the third statement "Hello, please swipe your ID card to take a number" to respond to "I have my ID".
[0119] At this time, in response to the "Hello, please swipe your ID card to take a number" output by the intelligent robot, the user may also change their intention and reissue a dialogue statement "I want to take a number". This reissued dialogue statement will be semantically matched with the first statement and the second statement again by means of the aforementioned third jump relationship. Finally, the intelligent robot can output the third statement "What service do you need?" again.
[0120] Since the matching range of the statements includes both the first statement of a single intent and the second statement of multiple intents, when the above-mentioned intent change occurs, after semantic matching, it is possible to directly jump from the "Exchange for Number" status node to the "Inquire about Service" status node, that is, it is possible to directly achieve the reverse jump between status nodes using the third jump relationship. Instead of jumping from the "Exchange for Number" status node to the "Inquire about Documents" status node and then from the "Inquire about Documents" status node to the "Exchange for Number" status node, the number of semantic matching times is reduced, the speed of semantic matching is increased, and the response speed of the dialogue is improved.
[0121] In addition, after performing step 402, it is possible to encounter a situation where multiple target statements are matched. At this time, it is possible to first determine the active status node among multiple status nodes before obtaining the dialogue statement input by the user. According to the above description, each first statement or second statement can activate a certain status node. Then, determine the target status nodes that each of the multiple target statements can activate, and activate the target status node that is closest to the active status node, while canceling the activation of the active status node that was active before the input dialogue statement.
[0122] For example, the dialogue statement input by the user is "I want to get a number". At this time, the "Start" status node is active. After semantically matching the dialogue statement "I want to get a number" with the first statement and the second statement respectively, the target statement 1 "I want to get a number" and the target statement 2 "I want to get a number and I want to exchange some foreign currency" can be obtained. The target statement 1 can activate the "Inquire about Service" status node, and the target statement 2 can activate the "Inquire about Documents" status node. Finally, the "Inquire about Service" status node that is closest to the "Start" status node will be activated, and at the same time, the "Start" status node will be deactivated, so that the entire dialogue jumps from the "Start" status to the "Inquire about Service" status.
[0123] For ease of understanding, the specific implementation of the above-provided human-machine multi-round dialogue method is exemplarily described in combination with a bank scenario. The specific content can be understood in combination with Figure 5 the state transition diagram shown.
[0124] In a bank scenario, getting a number is a common service, and a multi-round dialogue can be used to provide a number-getting service for users when exchanging foreign currency. For this number-getting service, multiple dialogue states can be manually written, such as "Start", "Inquire about Service", "Inquire about Documents", "Exchange for Number", and "Exchange Explanation", and each dialogue state corresponds to a status node. Adjacent status nodes can form a pair of parent-child status nodes, and two non-adjacent status nodes can form a pair of non-parent-child status nodes.
[0125] The first jump relationship between the parent-child status nodes along the first direction may include: the "start" status node jumps to the "inquire about business" status node, the "inquire about business" status node jumps to the "inquire about documents" status node, the "inquire about documents" status node jumps to the "foreign exchange number taking" status node, and the "inquire about documents" status node jumps to the "foreign exchange explanation" status node. The above first jump relationship can also be written manually.
[0126] Based on this first jump relationship, a second jump relationship can be automatically generated: the "start" status node jumps to the "inquire about documents" status node, the "start" status node jumps to the "foreign exchange number taking" status node and the "foreign exchange explanation" status node respectively, and the "inquire about business" status node jumps to the "foreign exchange number taking" status node and the "foreign exchange explanation" status node respectively.
[0127] Combining the above first jump relationship and the second jump relationship can realize the jump relationship between any two status nodes among multiple status nodes along the first direction. The jumps between status nodes are flexible, further ensuring the flexibility of multi-round conversations.
[0128] To further enhance the flexibility of the conversation, a jump relationship between the parent-child status nodes along the second direction, that is, the third jump relationship, can also be automatically generated according to the first jump relationship. Here, the second direction can be the reverse direction of the first direction. Then the third jump relationship is actually the reverse jump relationship of the first jump relationship. For example, it may include the "inquire about business" status node jumping to the "start" status node, the "inquire about documents" status node jumping to the "inquire about business" status node, and so on.
[0129] Similarly, a jump relationship between non-parent-child status nodes along the second direction can also be automatically generated according to the second jump relationship, that is, the fourth jump relationship is automatically generated. In the fourth jump relationship, in addition to including the reverse jump relationship of the second jump relationship, it can also include the "foreign exchange number taking" status node jumping to the "foreign exchange explanation" status node, and the "foreign exchange explanation" status node jumping to the "foreign exchange number taking" status node.
[0130] While obtaining the above multiple jump relationships, the first intention corresponding to the first jump relationship and the first statement with the first intention can also be written manually, and the third statement corresponding to the conversation status can also be written manually. The first intention and the first statement can refer to Table 1 above, and the third statement can refer to Table 2 above. Since multiple intentions need to be satisfied to complete the second jump relationship, the first statements can also be combined to automatically generate the second statements as shown in Table 3.
[0131] According to the above manually written and automatically generated jump relationships and the intentions corresponding to the jump relationships, we can get Figure 5The state transition diagram shown. Together with the state transition diagram and the statements shown in Tables 1 to 3, a dialogue state machine for completing multi-round conversations is formed.
[0132] Since both the jump relationship and the second statement are automatically generated, it is possible to reduce the manual work pressure and improve the generation efficiency of the dialogue state machine.
[0133] In an actual conversation, when Figure 5 After the "start" state node in the shown state transition diagram is activated, the intelligent robot can output "Hello", and the user responds with "I want to take a number". At this time, the intelligent robot semantically matches the statement "I want to take a number" output by the user with the first statement and the second statement respectively, and determines that the statement "I want to take a number" output by the user is semantically matched with the first statement "I want to get a number". Then, according to the state transition diagram, the first statement "I want to get a number" can achieve a jump from the "start" state node to the "inquire about business" state node, that is, the "inquire about business" state node will be activated, and at the same time, the activation of the "start" state node is cancelled. At this time, the intelligent robot can output the statement "What business do you need to handle?" corresponding to the "inquire about business" state node to respond to the user's "I want to take a number", that is, a round of conversation is completed.
[0134] The next round of conversation can be achieved in the above manner:
[0135] User: I want to exchange some US dollars.
[0136] Intelligent robot: Do you have your ID card and bank card with you?
[0137] Of course, the multiple jumps of the state node can also be achieved in the above manner to realize the round of conversation and finally complete getting a number for the user.
[0138] In addition to the above bank scenario, the specific implementation of the above-provided human-machine multi-round conversation method can also be exemplified in combination with a shopping mall scenario.
[0139] In the shopping mall scenario, the state transition diagram shown can be obtained through a combination of manual writing and automatic generation. In this scenario, the first statement with the first intention can also be manually written, as shown in Table 4 below, or the third statement can be manually written, and the relationship between the third statement and the state node can be seen in Table 5 below. Figure 8 shown. In this scenario, the first statement with the first intention can also be manually written, as shown in Table 4 below, or the third statement can be manually written, and the relationship between the third statement and the state node can be seen in Table 5 below.
[0140] Table 4: Intention Table
[0141]
[0142] Table 5: State Table
[0143]
[0144] Based on Figure 8 the state transition diagram shown above and the first statement in Table 4 above, a second statement with a second intention can be combined, as shown in Table 6 below.
[0145] Table 6: Intention Table
[0146]
[0147] Based on Figure 8 the state transition diagram shown above and Tables 4 - 6, a dialogue state machine in a shopping mall scenario can be obtained, and turn-based conversations can be implemented. Since the jump relationships between state nodes in the state transition diagram and the second statements in the above tables are automatically generated, it can reduce the manual effort and improve the generation efficiency of the dialogue state machine.
[0148] Based on this dialogue state machine, the process of the intelligent robot and the user having a conversation can be described as follows: The "Start" state node is in an active state. At this time, the intelligent robot can output "Hello", and the user responds with "I want to buy clothes". Then, the intelligent robot can semantically match the statement "I want to buy clothes" output by the user with the first statement and the second statement in the dialogue state machine respectively, and thus it is matched with the first statement "I want to buy clothes" semantically. At this time, a jump can occur between the "Start" state node and the "Ask for Needs" state node, that is, the "Ask for Needs" state node is activated, and the "Start" state node is deactivated, so that the intelligent robot outputs the third statement "What do you need to buy?" corresponding to the "Ask for Needs" state node, thus completing one turn of the conversation.
[0149] The next turn of the conversation can also be implemented in the above manner:
[0150] User: I want to buy a coat.
[0151] Intelligent Robot: Please go to the second floor to shop.
[0152] After the above process, multi-turn conversations can be implemented to provide shopping guide services for users.
[0153] The following will detail a human-machine multi-turn conversation device according to one or more embodiments of the present invention. Those skilled in the art can understand that these human-machine multi-turn conversation devices can all be configured by using commercially available hardware components through the steps taught by this solution.
[0154] Figure 9 is a schematic structural diagram of a human-machine multi-turn conversation device provided by an embodiment of the present invention, as Figure 9 shown. The device includes:
[0155] An acquisition module 11, configured to acquire a first jump relationship along a first direction between parent and child state nodes among a plurality of state nodes, and a first intention corresponding to the first jump relationship.
[0156] A relationship determination module 12, configured to determine a second jump relationship along the first direction between non-parent and child state nodes among the plurality of state nodes according to the first jump relationship.
[0157] An intention determination module 13, configured to determine a second intention corresponding to the second jump relationship according to the first intention and the second jump relationship.
[0158] A generation module 14, configured to generate a dialogue state machine for implementing a multi-round dialogue according to the first jump relationship, the second jump relationship, the first intention, and the second intention.
[0159] Optionally, the relationship determination module 12 is specifically configured to: determine a jump relationship along the first direction between any two state nodes among the plurality of state nodes; and determine a difference between the jump relationship between the any two state nodes and the first jump relationship as the second jump relationship.
[0160] Optionally, the intention determination module 13 is specifically configured to: determine a plurality of the first intentions that need to be satisfied for the second jump relationship to occur as the second intention.
[0161] Optionally, the relationship determination module 12 is specifically configured to: determine a third jump relationship along a second direction between the parent and child state nodes according to the first jump relationship; and determine a fourth jump relationship along the second direction between the non-parent and child state nodes according to the second jump relationship.
[0162] The generation module 14 is further configured to generate the dialogue state machine according to the first jump relationship, the second jump relationship, the third jump relationship, the fourth jump relationship, the first intention, and the second intention.
[0163] Optionally, the second intention includes a plurality of the first intentions.
[0164] The acquisition module 11 is further configured to acquire a first statement having the first intention, where the first statement is used to activate a child state node in the first jump relationship to cause a jump between the parent and child state nodes; and acquire third statements corresponding to the plurality of state nodes respectively.
[0165] The human-machine multi-turn dialogue device further includes: a combination module 15, configured to combine the first statement according to the inclusion relationship between the second intention and the first intention, so as to obtain a second statement with the second intention, where the second statement is used to activate the state node that is farthest from the root node among the multiple state nodes in the second jump relationship, so that jumps occur between non-parent-child state nodes.
[0166] The generation module 14 is further configured to generate the dialogue state machine according to the first jump relationship, the second jump relationship, the first intention, the second intention, and the first statement, the second statement, and the third statement.
[0167] Optionally, the combination module 15 is specifically configured to: filter out the statements with component defaults in the first statement to obtain the filtered statements; and combine the filtered statements according to the inclusion relationship between the second intention and the first intention.
[0168] Optionally, the human-machine multi-turn dialogue device further includes: a receiving module 16, a statement determination module 17, and an activation module 18.
[0169] The receiving module 16 is configured to receive the dialogue statement input by the user.
[0170] The statement determination module 17 is configured to determine, among the first statement and the second statement, the target statement that semantically matches the dialogue statement; and determine the third statement corresponding to the activated state node as the response statement of the dialogue statement.
[0171] The activation module 18 is configured to activate the state node in the jump relationship corresponding to the target statement according to the intention of the target statement.
[0172] Optionally, the statement determination module 17 is specifically configured to: obtain the statement vectors of the dialogue statement, the first statement, and the second statement respectively; and if the similarity between the statement vectors of the dialogue statement and the target statement meets a preset threshold, determine that the dialogue statement and the target statement are semantically matched.
[0173] Optionally, there are multiple target statements.
[0174] The human-machine multi-turn dialogue device further includes: a node determination module 19, configured to determine the activated state nodes among the multiple state nodes that are in the activated state before obtaining the dialogue statement; and respectively determine the target state nodes that can be activated by the multiple target statements.
[0175] The activation module 18 is configured to activate the target state node closest to the activated state node and cancel the activation of the activated state node.
[0176] Optionally, the human-machine multi-turn dialogue device further includes: an input module 20, configured to input the dialogue statement into a preset language model, so that the preset language model outputs a statement vector corresponding to the dialogue statement.
[0177] Optionally, the input module 20 is further configured to input the first statement and the second statement into the preset language model, so that the preset language model outputs statement vectors corresponding to the first statement and the second statement respectively.
[0178] The human-machine multi-turn dialogue device further includes: a storage module 21, configured to store the statement vectors corresponding to the first statement and the second statement respectively.
[0179] Figure 9 The shown human-machine multi-turn dialogue device can execute the human-machine multi-turn dialogue method provided by the foregoing Figures 1 to 7 For parts not described in detail in this embodiment, reference may be made to the relevant descriptions of the Figures 1 to 7 shown embodiment, which will not be elaborated here.
[0180] The internal functions and structures of the human-machine multi-turn dialogue device have been described above. In a possible design, the structure of the human-machine multi-turn dialogue device can be implemented as a part of an intelligent robot, such as Figure 10 shown. The intelligent robot may include: a processor 31 and a memory 32. Among them, the memory 32 is used to store a program that supports the intelligent robot to execute the human-machine multi-turn dialogue method provided in the foregoing Figures 1 to 7 shown embodiment, and the processor 31 is configured to execute the program stored in the memory 32.
[0181] The program includes one or more computer instructions, and when the one or more computer instructions are executed by the processor 31, the following steps can be implemented:
[0182] Obtain a first jump relationship along a first direction between parent and child state nodes among multiple state nodes, and a first intention corresponding to the first jump relationship;
[0183] Determine a second jump relationship along the first direction between non-parent and child state nodes among the multiple state nodes according to the first jump relationship;
[0184] Determine a second intention corresponding to the second jump relationship according to the first intention and the second jump relationship;
[0185] Generate a dialogue state machine for implementing multi-turn dialogue according to the first jump relationship, the second jump relationship, the first intention, and the second intention.
[0186] Optionally, the processor 31 is further configured to execute all or part of the steps in the foregoing Figures 1 to 7 illustrated embodiments.
[0187] Wherein, the structure of the intelligent robot may further include a communication interface 33 for communicating with other devices or communication networks.
[0188] In addition, an embodiment of the present invention provides a computer-readable storage medium storing computer instructions, which when executed by one or more processors, cause the one or more processors to perform at least the following actions:
[0189] Obtain a first jump relationship along a first direction between parent and child state nodes among a plurality of state nodes, and a first intention corresponding to the first jump relationship;
[0190] Determine a second jump relationship along the first direction between non-parent and child state nodes among the plurality of state nodes according to the first jump relationship;
[0191] Determine a second intention corresponding to the second jump relationship according to the first intention and the second jump relationship;
[0192] Generate a dialogue state machine for implementing multi-round conversations according to the first jump relationship, the second jump relationship, the first intention, and the second intention.
[0193] The device embodiments described above are merely illustrative, where the modules described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0194] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of adding a necessary general hardware platform, and of course, can also be implemented by a combination of hardware and software. Based on such an understanding, the above technical solutions, in essence, or the part that contributes to the prior art can be embodied in the form of a computer product.
[0195] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for multi-turn human-machine dialogue, characterized in that, Including: Obtain a first jump relationship along a first direction between parent - child state nodes among multiple state nodes, and a first intention corresponding to the first jump relationship; Determine a second jump relationship along the first direction between non - parent - child state nodes among the multiple state nodes according to the first jump relationship; Determine a second intention corresponding to the second jump relationship according to the first intention and the second jump relationship; Generate a dialogue state machine for implementing multi - turn conversations according to the first jump relationship, the second jump relationship, the first intention, and the second intention.
2. The method according to claim 1, wherein The step of determining the second jump relationship along the first direction between non - parent - child state nodes among the multiple state nodes according to the first jump relationship includes: Determine the jump relationship along the first direction between any two state nodes among the multiple state nodes; Determine the difference between the jump relationship between any two state nodes and the first jump relationship as the second jump relationship.
3. The method according to claim 1, wherein The step of determining the second intention corresponding to the second jump relationship according to the first intention and the second jump relationship includes: Determine multiple first intentions that need to be satisfied for the second jump relationship to occur as the second intention.
4. The method according to claim 1, wherein The method further includes: Determine a third jump relationship along a second direction between the parent - child state nodes according to the first jump relationship; Determine a fourth jump relationship along the second direction between the non - parent - child state nodes according to the second jump relationship; The step of generating a dialogue state machine for implementing multi - turn conversations according to the first jump relationship, the second jump relationship, the first intention, and the second intention includes: Generate the dialogue state machine according to the first jump relationship, the second jump relationship, the third jump relationship, the fourth jump relationship, the first intention, and the second intention.
5. The method according to claim 1 or 4, characterized in that The second intention includes multiple first intentions; The method further includes: Obtain a first statement with the first intention, where the first statement is used to activate a child state node in the first jump relationship, causing a jump between parent - child state nodes; Combine the first statement according to the inclusion relationship between the second intention and the first intention to obtain a second statement with the second intention, where the second statement is used to activate the state node farthest from the root node among the multiple state nodes in the second jump relationship, causing a jump between non - parent - child state nodes; Obtain third statements corresponding to the multiple state nodes respectively; The step of generating a dialogue state machine for implementing multi - turn conversations according to the first jump relationship, the second jump relationship, the first intention, and the second intention includes: Generate the dialogue state machine according to the first jump relationship, the second jump relationship, the first intention, the second intention, the first statement, the second statement, and the third statement.
6. The method according to claim 5, characterized in that, The step of combining the first statement according to the inclusion relationship between the second intention and the first intention includes: Filter out the statements with component defaults in the first statement to obtain filtered statements; Combine the filtered statements according to the inclusion relationship between the second intention and the first intention.
7. The method according to claim 5, wherein The method further includes: Receiving a dialogue statement input by a user; Determining, in the first statement and the second statement, a target statement that semantically matches the dialogue statement; Activating a state node in a jump relationship corresponding to the target statement according to the intention of the target statement; Determining a response statement of the dialogue statement as the third statement corresponding to the activated state node.
8. The method according to claim 7, wherein The determining, in the first statement and the second statement, a target statement that matches the dialogue statement includes: Obtaining respective statement vectors of the dialogue statement, the first statement, and the second statement; If the similarity between the respective statement vectors of the dialogue statement and the target statement meets a preset threshold, determining that the dialogue statement and the target statement are semantically matched.
9. The method according to claim 7, characterized in that, When there are multiple target statements, the method further includes: Determining an activated state node that is in an activated state among the multiple state nodes before obtaining the dialogue statement; Respectively determining target state nodes that can be activated by the multiple target statements; Activating a target state node closest to the activated state node, and canceling the activation of the activated state node.
10. The method according to claim 7, wherein The method further includes: Inputting the dialogue statement into a preset language model so that the preset language model outputs a statement vector corresponding to the dialogue statement.
11. The method according to claim 10, wherein The method further includes: Inputting the first statement and the second statement into the preset language model so that the preset language model outputs respective statement vectors corresponding to the first statement and the second statement; Saving the respective statement vectors corresponding to the first statement and the second statement.
12. A human-machine multi-round dialogue device, characterized in that, including: An obtaining module, configured to obtain a first jump relationship between parent and child state nodes among multiple state nodes along a first direction, and a first intention corresponding to the first jump relationship; A relationship determining module, configured to determine a second jump relationship between non-parent and child state nodes among the multiple state nodes along the first direction according to the first jump relationship; An intention determining module, configured to determine a second intention corresponding to the second jump relationship according to the first intention and the second jump relationship; A generating module, configured to generate a dialogue state machine for implementing a multi-round dialogue according to the first jump relationship, the second jump relationship, the first intention, and the second intention.
13. An intelligent robot, characterized in that, including: A processor and a memory; wherein, the memory is used to store one or more computer instructions, and when the one or more computer instructions are executed by the processor, the following are implemented: Obtaining a first jump relationship between parent and child state nodes among multiple state nodes along a first direction, and a first intention corresponding to the first jump relationship; Determining a second jump relationship between non-parent and child state nodes among the multiple state nodes along the first direction according to the first jump relationship; Determining a second intention corresponding to the second jump relationship according to the first intention and the second jump relationship; Generating a dialogue state machine for implementing a multi-round dialogue according to the first jump relationship, the second jump relationship, the first intention, and the second intention.
14. A computer-readable storage medium storing computer instructions, characterized in that, When the computer instructions are executed by one or more processors, causing the one or more processors to perform at least the following actions: Obtain a first jump relationship along a first direction between parent and child state nodes among a plurality of state nodes, and a first intention corresponding to the first jump relationship; Determine a second jump relationship along the first direction between non-parent and child state nodes among the plurality of state nodes according to the first jump relationship; Determine a second intention corresponding to the second jump relationship according to the first intention and the second jump relationship; Generate a dialogue state machine for implementing multi-turn conversations according to the first jump relationship, the second jump relationship, the first intention, and the second intention.
Citation Information
Patent Citations
Multi-round dialogue processing method and device, electronic equipment and storage medium
CN111753061A
Human-machine dialogue method and electronic device
US20200395000A1