User intention recognition method, recognition device and electronic device

By encoding and analysis of current and historical session information, dynamically updating the target graph structure is solved, and the problem of poor user intention understanding is achieved, achieving higher recognition accuracy and dialogue continuity.

CN114238601BActive Publication Date: 2024-12-17CHINA UNICOM ONLINE INFORMATION TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111505842.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-10
Publication Date
2024-12-17
Estimated Expiration
2041-12-10

AI Technical Summary

Technical Problem

In the prior art, the accuracy of user intention understanding is poor, especially in the machine response mode, there is a problem of prediction errors in single-wheel oral comprehension and multi-wheel oral comprehension methods based on memory networks.

Method used

By encoding the current session information and historical session information, the current user intention information is generated, and the correlation analysis is performed based on the intention prediction information, the target graph structure is dynamically updated to correct intent understanding errors and ensure the normal progress of the conversation.

Benefits of technology

Improves the accuracy of user intention recognition, and can correct it in a timely manner when intent errors are understood, ensuring the continuity and accuracy of the conversation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114238601B_ABST
    Figure CN114238601B_ABST
Patent Text Reader

Abstract

The present invention provides a user intention recognition method, recognition device and electronic device, the user intention recognition method comprising: encoding current session information to generate current session code; generating current first user intention information based on the current session code and historical session code; generating target user intention information corresponding to the current session information based on the first user intention information and first intention prediction information; the first intention prediction information is used to characterize the correlation between the predicted intention determined by the previous round of session information and the first user intention information. The user intention recognition method of the present invention can effectively judge the intention understanding of the previous round of session information, and timely correct the user intention information of this round in the case of an error in the previous round of judgment, so as to generate the final target user intention information, thereby ensuring that the conversation can still proceed normally when an error in intention understanding occurs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic answering, and in particular to a user intention recognition method, recognition device and electronic equipment. Background Art

[0002] In machine answering mode, it is necessary to understand the user's incoming calls and give replies and guidance. The current mainstream methods for understanding user intentions are mainly single-round spoken language understanding, which is easy to predict wrong intentions that are far from the actual intentions and has poor accuracy; or multi-round spoken language understanding based on memory networks. This method calculates the attention weight from the representation of the current speech, obtains a mixture of the attention encoding of historical information and the current speech encoding, and performs intention understanding based on this mixed representation, which also has poor accuracy. Summary of the invention

[0003] The present invention provides a user intention recognition method, a recognition device and an electronic device, which are used to solve the defect of poor accuracy in understanding user intention in the prior art.

[0004] The present invention provides a method for identifying user intention, comprising:

[0005] Encode the current session information to generate a current session code;

[0006] Generate current first user intention information based on the current session code and the historical session code;

[0007] Based on the first user intention information and the first intention prediction information, the target user intention information corresponding to the current session information is generated; the first intention prediction information is used to characterize the correlation between the predicted intention determined by the previous round of session information and the first user intention information.

[0008] According to a user intention recognition method provided by the present invention, generating target user intention information corresponding to the current session information based on the first user intention information and the first intention prediction information includes:

[0009] Performing full connection processing on the first user intention information to generate a prediction result corresponding to the first user intention information;

[0010] When the prediction result is a negative intention, the target graph structure under the target scenario corresponding to the previous round of session information is reversed to generate second user intention information, where the second user intention information is different from the first user intention information;

[0011] When the score corresponding to the second user intention information exceeds the target threshold, the second user intention information is determined as the target user intention information.

[0012] According to a user intention recognition method provided by the present invention, encoding the current session information to generate the current session code includes:

[0013] The current session information and the previous round of machine session information are encoded to generate the current session code.

[0014] According to a user intention recognition method provided by the present invention, the generating of current first user intention information based on the current session code and the historical session code includes:

[0015] Inserting a time code into the historical conversation code;

[0016] Based on the time code, the current session code and the historical session code are bidirectionally matched to generate the first user intention information.

[0017] According to a user intention recognition method provided by the present invention, after generating the target user intention information corresponding to the current session information based on the first user intention information and the first intention prediction information, the method further includes:

[0018] Based on the target user intention information, the current session state in the target scenario is updated.

[0019] According to a user intention recognition method provided by the present invention, before encoding the current session information to generate the current session code, the method further includes:

[0020] In the case of a first round of conversation, the first round of conversation information of the user is encoded to generate a first round of conversation code;

[0021] First-round user intention information is generated based on matching the first-round conversation code and the user's identity identifier.

[0022] According to a user intention recognition method provided by the present invention,

[0023] The encoding of the current session information to generate the current session code includes: inputting the current session information into a coding layer of a user intention recognition model to obtain a current session code corresponding to the current session information output by the coding layer;

[0024] The generating the current first user intention information based on the current session code and the historical session code includes: inputting the current session code into a matching layer of the user intention recognition model to obtain the first user intention information corresponding to the current session information output by the matching layer;

[0025] The generating, based on the first user intention information and the first intention prediction information, the target user intention information corresponding to the current session information includes: inputting the first user intention information into the output layer of the user intention recognition model, and obtaining the target user intention information corresponding to the current session information output by the output layer;

[0026] The user intention recognition model is obtained by training using sample session information as samples and sample user intention information corresponding to the sample session information as sample labels.

[0027] The present invention also provides a user intention recognition device, comprising:

[0028] A first generating module, used for encoding the current session information to generate a current session code;

[0029] A second generating module, configured to generate current first user intention information based on the current session code and the historical session code;

[0030] The third generation module is used to generate the target user intention information corresponding to the current session information based on the first user intention information and the first intention prediction information; the first intention prediction information is used to characterize the correlation between the predicted intention determined by the previous round of session information and the first user intention information.

[0031] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned user intention recognition methods when executing the computer program.

[0032] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned user intention recognition methods are implemented.

[0033] The present invention provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any one of the above-mentioned user intention recognition methods are implemented.

[0034] The user intention recognition method, recognition device and electronic device provided by the present invention help to improve the accuracy of the recognition result by combining the current session information and the historical session information to generate the first user intention information; based on the first user intention information and the first intention prediction information determined based on the predicted intention determined based on the previous round of session information, the intention understanding of the previous round of session information can be effectively judged, and the user intention information of this round can be corrected in time when the judgment of the previous round is wrong, so as to generate the final target user intention information, thereby ensuring that the conversation can still proceed normally when an error in intention understanding occurs. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 This is one of the flow charts of the user intention recognition method provided by the present invention;

[0037] Figure 2 This is the second flow chart of the user intention recognition method provided by the present invention;

[0038] Figure 3 This is the third flow chart of the user intention recognition method provided by the present invention;

[0039] Figure 4 is a schematic diagram of the structure of the user intention recognition device provided by the present invention;

[0040] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] Combine the following Figure 1-Figure 3 The user intention recognition method of the present invention is described.

[0043] The execution subject of the user intention recognition method of the present invention can be a user intention recognition device, or can be a server, or can also be a terminal such as a mobile phone, tablet computer, computer, learning machine or vehicle-mounted terminal.

[0044] like Figure 1 As shown, the user intention recognition method includes: step 110, step 120 and step 130.

[0045] Step 110: Encode the current session information to generate a current session code;

[0046] In this step, the session information is the user's session information in the machine automatic answering mode.

[0047] It is understandable that in the automatic answering mode, at least one round of conversation will occur between the robot and the user, and each round includes at least one sentence of dialogue information.

[0048] For example, each round may include session information of the machine, or each round may include session information of the user and session information of the machine.

[0049] Taking express delivery as an example, after the call is connected, the user starts the conversation: "I want to send a express delivery", and the robot replies: "OK, please provide the sender's name, address and contact information." This completes the first round of conversation.

[0050] After the user provides his or her name, address, and contact information, the robot continues to ask the user to provide the recipient's name, address, and contact information, thus completing the second round of conversation.

[0051] After the user provides the recipient's name, address, and contact information, the robot allows the user to select a payment method, thus completing the third round of conversation.

[0052] And so on, until the call ends.

[0053] In the actual execution process, all the session information in one cycle can be divided into multiple rounds of sessions based on the time series, and each round of sessions corresponds to a session state m.

[0054] The session state is used to represent the progress node of the session in the target scenario.

[0055] For example, continuing with the target scenario of sending express delivery, this scenario may include multiple session states, such as a demand initiation node, a sender information input node, a recipient information input node, a shipping method confirmation node, and a payment operation node.

[0056] It should be noted that the multiple rounds of conversations may include first-round conversations and non-first-round conversations, for example, the demand initiation node corresponds to the first-round conversation, and the other nodes correspond to the non-first-round conversations. Each round of conversation corresponds to a time node.

[0057] The current session information is the session information of the current round. The time node corresponding to the current session information is the current time node t. The session state corresponding to the current session information is the current session state m. t .

[0058] After obtaining the current session information, the BERT model can encode the current session information corresponding to the current time node t to generate the current session encoding Q t .

[0059] Among them, the current session code Q t Includes the session's characteristic text and special identifiers for the beginning and end of the text.

[0060] It should be noted that the encoding methods proposed in the present invention may be different for the first-round session information and the non-first-round session information. The encoding methods in the two cases will be specifically described in subsequent embodiments and will not be elaborated here.

[0061] Step 120: Generate current first user intention information based on the current session code and the historical session code;

[0062] In this step, the historical conversations are encoded into feature texts for characterizing the historical conversation information.

[0063] The historical session code is generated based on the stacking of session codes corresponding to all rounds of session information before the current time node t.

[0064] In the actual execution process, the previous round of session encoding can be reused, and the latest session state can be used for attention encoding to obtain the sentence-level representation H corresponding to the time node t t , where H t That is, the historical conversation encoding generated by stacking from the first round of conversation to the current round of conversation.

[0065] The method for generating the session code corresponding to each round of conversation other than the first round is the same as the method for generating the current session code corresponding to the current round, and will not be described in detail here.

[0066] Get the current session code Q t and historical session encoding H t Then, encode the current session Q t and historical session encoding H t By matching, the current first user intention information can be generated.

[0067] The current first user intention information is used to represent the understanding of the current conversation information generated by prediction. The first user intention information is generated based on the historical conversation information and has higher accuracy than single-round spoken language understanding.

[0068] In some embodiments, the first user intention information may be represented by a fixed-length vector u.

[0069] It should be noted that the matching methods proposed in the present invention are different for the first-round session information and the non-first-round session information. The matching methods in the two cases will be specifically described in the subsequent embodiments and will not be elaborated here.

[0070] Step 130: Generate target user intention information corresponding to the current session information based on the first user intention information and the first intention prediction information; the first intention prediction information is used to characterize the correlation between the predicted intention determined in the previous round of session information and the first user intention information.

[0071] In this step, the first intention prediction information is used to characterize whether the predicted intention of the previous round of prediction includes the first user intention information.

[0072] The first intention prediction information is determined based on the predicted intention determined in the previous round of session information and the first user intention information.

[0073] The predicted intention determined based on the previous round of session information is the prediction information of the user intention for the next round generated in the previous round.

[0074] The predicted intent may be determined based on the end-user intent information generated by identifying the previous round of session information in the previous round.

[0075] For example, if the final user intention information of the previous round of conversation information is to send a courier, then based on this user intention information, the predicted intention for the next round can be generated, such as entering sender information, entering recipient information, or entering item information.

[0076] In some embodiments, the first intention prediction information may be a binary feature p, and the value of p is used to indicate whether the predicted intention determined by the previous round of session information includes the first user intention information.

[0077] The target user intention information is used to characterize the understanding of the current session information generated through prediction.

[0078] The accuracy of the target user intention information should not be lower than that of the first user intention information.

[0079] It can be understood that the target user intention information may be the first user intention information, or may also be other user intention information.

[0080] Based on the first user intention information and the first intention prediction information, the correctness of the predicted intention obtained in the previous round can be judged, and then the intention understanding of the previous round of conversation information can be judged.

[0081] When it is determined that the intention of the previous round of session information is misunderstood, the first user intention information is corrected to determine the final user intention information corresponding to the current session information, that is, the target user intention information.

[0082] Alternatively, when it is determined that the intention of the previous round of session information is understood correctly, the first user intention information may be determined as the final user intention information corresponding to the current session information, that is, the target user intention information.

[0083] The specific implementation method of this step is described below.

[0084] In some embodiments, step 130 may include:

[0085] Performing full connection processing on the first user intention information to generate a prediction result corresponding to the first user intention information;

[0086] When the prediction result is a negative intention, the target graph structure under the target scenario corresponding to the previous round of session information is reversed to generate second user intention information, which is different from the first user intention information;

[0087] When the score corresponding to the second user intention information exceeds the target threshold, the second user intention information is determined as the target user intention information.

[0088] In this embodiment, the prediction result is used to characterize whether the current session information contains a negative intention n. The prediction result is used as a gate to adjust the edge weight of the target graph structure. When n output is 1, it indicates that there is a negative intention, and the target graph structure is reversed.

[0089] The negative intention is used to indicate that the first user intention information generated in step 120 is inaccurate.

[0090] When the prediction result is a negative intention, it is determined that the intention of the previous round of conversation information is misunderstood.

[0091] The graph structure is a discrete structure consisting of vertices and edges connecting the vertices, and the target graph structure is the graph structure in the target scenario.

[0092] The vertices in the target graph structure correspond to the session states in the target scenario, and the vertices are connected by edges to form multiple flow charts in the target scenario.

[0093] The target graph structure can be customized based on user needs.

[0094] In the actual execution process, the intention logical relationship in the target scenario can be manually defined based on experience or prior knowledge to establish the target graph structure.

[0095] In this embodiment, by adding effective prior knowledge and combining the information of text semantic understanding, it is ensured that the model can fully consider the semantic information while integrating the original rule strategy.

[0096] like Figure 2 or Figure 3 The oval box in the figure shows a target graph structure. The arrow direction on each edge is used to represent the jump direction of the fixed point. For example, vertex A corresponds to two subordinate vertices B and C, and B corresponds to a subordinate vertex D.

[0097] When the corresponding target graph structure relationship in the previous round is AB, the target graph structure is reversed, that is, the corresponding relationship of AB is reversed to AC.

[0098] Based on the predicted intention obtained in the previous round and the first user intention information generated in this round, it can be determined whether the two are consistent, thereby generating the first intention prediction information.

[0099] In some embodiments, the first intention prediction information may be a binary feature p, which is used to characterize whether the previous round of prediction includes the first user intention information.

[0100] In the actual execution process, the name and description of each intent can be processed through BERT to obtain the encoded representation v of the intent, where v is the candidate intent representation.

[0101] Among them, an equal-length learnable vector parameter encoding can also be established for unintentional conversation information.

[0102] After obtaining v, the candidate intent representation v, the first intent prediction information p and the first user intent information u generated by step 120 are concatenated respectively to obtain a vector code [v; u; p]; wherein the vector code is used to represent the entire intent understanding after concatenation.

[0103] Then [v;u;p] is self-matched in the target graph structure by the graph attention mechanism.

[0104] During the matching process, the structure in the target graph structure changes dynamically based on the understanding of the current session information.

[0105] For example, based on the first intention prediction information, it can be known that the first user intention information generated in this round is consistent with the predicted intention information obtained in the previous round. Figure 1 To.

[0106] However, if the negative intention n in the prediction result generated after full connection processing of the first user intention information is 1, it means that the prediction result is a negative intention, which means that the actual intention of this round is not the first user intention information, and further indicates that the predicted intention obtained in the previous round is wrong, that is, the intention understanding of the previous round of conversation information is wrong, then the intention understanding of this round should jump to the logical subgraph where the intention of the previous round is located, and reverse the graph structure edge where the intention of the previous round is located, that is, reverse the row where the intention of the previous round is located in the graph adjacency matrix, and guide the intention understanding of this round to jump to other intentions, that is, jump to the second user intention information, which is different from the first user intention information.

[0107] It can be understood that the number of the second user intention information can be one or more.

[0108] Each piece of second user intention information is passed through a fully connected network and a sigmoid layer respectively to score each piece of second user intention information and generate a score corresponding to each piece of second user intention information.

[0109] The score is used to represent the degree of closeness between the second user intention information and the actual user intention information.

[0110] The target threshold can be user-defined, for example, it can be set to 0.5 or 0.8.

[0111] When the score corresponding to the second user intention information exceeds the target threshold, it can be approximately considered that the second user intention information is close to the actual user intention information, and the second user intention information is determined as the target user intention information.

[0112] According to the user intention recognition method provided by the embodiment of the present invention, a target graph structure is determined based on the logical relationship of each intention in the target scenario, and the cross-effects between intentions are captured based on the target graph structure. The user intention understanding of the previous round of conversation information is detected based on the first user intention information generated in the current round, and when it is determined that the user intention understanding of the previous round of conversation information is wrong, the structural relationship of the target graph structure is dynamically updated to generate the second user intention information, so as to correct some errors in the process of the conversation in a timely manner, and ensure that when an error in intention understanding occurs, the task-based dialogue can still proceed normally.

[0113] It should be noted that the method of determining the first intention prediction information may be different for training scenarios and actual application scenarios.

[0114] The following describes the method of determining the first intention prediction information in two scenarios respectively.

[0115] First, in training scenarios, predicted intent can be determined based on real outcomes.

[0116] In some embodiments, the method may further include:

[0117] Before step 110, sample session information is obtained;

[0118] Perform multiple rounds of labeling on sample conversation information based on time series to generate intent labels corresponding to each round of conversation information;

[0119] Determine the predicted intent based on the intent label of the previous round of conversation information.

[0120] In this embodiment, the sample session information is a training sample in the training process.

[0121] In the actual implementation process, multiple completed historical conversation information can be obtained as sample conversation information. For example, it can be built on an existing telephone intelligent assistant solution to obtain real multi-round conversation data. The existing telephone intelligent assistant solution can implement a basic solution by any rule-based conversation management or single-round conversation method.

[0122] For each sample conversation information, the caller’s conversation intent labels are annotated at each time node during the call cycle, and the entire call sequence with intent labels is used as a training sample.

[0123] The intent label is used to represent the real intent that the user wants to express in this round of conversation information.

[0124] For example, for a piece of sample conversation information, three rounds of conversations are obtained after division, wherein the conversation state of the first round of conversation is A, the conversation state of the second round of conversation is B, and the conversation state of the third round of conversation is C.

[0125] Based on the jump relationship between ABC, it can be known that the next session state after session state A in this scenario is B, and the intention corresponding to session state B is the predicted intention determined based on the first round of conversation.

[0126] In this embodiment, intent labels are introduced for sequence modeling, so that the intent information corresponding to the previous round contains effective information to guide the model's understanding of the next round of dialogue, and more fully models the interaction between historical dialogues, historical intent labels and current dialogues.

[0127] Second, in actual application scenarios, the predicted intention can be determined based on the predicted understanding of the previous round of user intentions.

[0128] In this embodiment, the predicted intention for the next round may be determined based on the previous round of conversation information.

[0129] The user intention recognition method provided by the embodiment of the present invention helps to improve the accuracy of the recognition result by combining the current session information and the historical session information to generate the first user intention information; based on the first user intention information and the first intention prediction information determined based on the predicted intention determined in the previous round of session information, the intention understanding of the previous round of session information can be effectively judged, and the user intention information of this round can be corrected in time when the judgment in the previous round is wrong, so as to generate the final target user intention information, thereby ensuring that the conversation can still proceed normally when an intention understanding error occurs.

[0130] The following describes the encoding implementation method in detail from two different perspectives.

[0131] 1. Encode the first round of conversation information

[0132] According to some embodiments of the present invention, before step 110, the method may further include: in the case of a first-round conversation, encoding the first-round conversation information of the user to generate a first-round conversation code.

[0133] In this embodiment, the first round of session information of the user is the user session information in the first round of session information.

[0134] In the actual execution process, at t=0, that is, in the first round of conversation, only the user conversation information may be encoded to generate the first round conversation code.

[0135] For example, after the call is connected, the user asks: "I want to send a courier", which is the first round of conversation.

[0136] Among them, "I want to send a courier" is the user session information in the first round of session information.

[0137] By encoding the user session information, you can generate Figure 2 The first round of conversation code shown is: [CLS] I want to send a courier [SEP].

[0138] 2. Encode non-first-round conversation information.

[0139] In some embodiments, step 110 may include: encoding the current user session information and the previous round of machine reply information to generate a current session code.

[0140] In this embodiment, the current user session information is user session information in other rounds of session information except the first round of session information.

[0141] It can be understood that the last round of session information includes at least one piece of machine session information, and the machine session information is reply information generated based on the last round of user reply information.

[0142] For example, after the call is connected, the user asks: "I want to receive a courier," and the robot replies: "What is the delivery address?", thus completing the first round of conversation.

[0143] The user replies to the robot: "XX District, Beijing." The second round of conversation begins.

[0144] The second round of dialogue is the current round of conversation information.

[0145] The current user session information is "XX District, Beijing." The previous round of machine session information is "Where is the delivery address?"

[0146] The current session code may include: a code corresponding to the previous round of machine session information, a code corresponding to the current round of user session information, and a role code corresponding to each session information.

[0147] It is understandable that each session object in a session information corresponds to a role code, and different session objects correspond to different role codes, for example, a user and a robot each correspond to a role code.

[0148] After obtaining the current user session information and the previous round of machine reply information, concatenate the previous round of machine session information and the current user session information and encode them, add the user's corresponding role code to the code corresponding to the current user session information, and add the robot's corresponding role code to the code corresponding to the previous round of machine session information to distinguish the user and robot session information, and then get the current session code. Figure 3 A current session encoding is shown as: [CLS] Where is the delivery address? [SEP] Beijing XX [SEP];

[0149] Through the current session encoding, we can not only establish the association relationship between the current user session information and the previous round of machine session information, but also distinguish the encoding corresponding to the user session information from the encoding corresponding to the machine session information, which helps to improve the accuracy of the recognition result.

[0150] The following describes the matching implementation method in detail from two different perspectives.

[0151] 1. Match the first round of conversation information

[0152] According to some embodiments of the present invention, before step 110, the method may further include:

[0153] In the case of a first round of conversation, the first round of conversation information of the user is encoded to generate a first round of conversation code;

[0154] The first round of user intent information is generated based on matching the first round of conversation code and the user's identity.

[0155] In this embodiment, the user's identity identifier is used to represent the user's identity information.

[0156] For example, in the context of receiving and sending express deliveries, the user's identity can be the merchant, courier, customer, etc.

[0157] In actual implementation, the user's identity may be determined based on the user's phone number or other information.

[0158] The first-round user intention information is generated based on matching and is used to characterize the possible meanings expressed by the first-round user session information.

[0159] It is understandable that the same statement may have different meanings for users with different identities.

[0160] For example, for the sentence "Where are you?", if it is asked by an online car-hailing driver, it is used to inquire about the user's current location information; but if it is asked by a merchant, it may be used to inquire about the current logistics information.

[0161] When matching the first-round conversation encoding, the user's identity identifier is used as a feature for matching to generate the first-round user intent information. The first-round conversation information can be identified in combination with the user's identity and the context in which the current conversation information occurs, so as to avoid a large gap between the generated first-round user intent information and the actual intent information, thereby helping to improve the accuracy of the recognition results.

[0162] 2. Matching non-first-round session information

[0163] In some embodiments, step 120 may include:

[0164] Insert time code into historical conversation code;

[0165] Based on the time code, the current session code and the historical session code are bidirectionally matched to generate the first user intention information.

[0166] In this embodiment, the time code is a code corresponding to each time node, that is, each session state corresponds to a time code, and the arrangement order of the time codes is consistent with the sequence of the corresponding session states.

[0167] Continue to refer Figure 3 , historical session encoding H t It includes session codes for multiple time periods, and each session code for each time period corresponds to a session state, for example, H tCan include: m1, m2...m t Session encoding in the session state.

[0168] The session codes in each state are arranged in time series so that the historical session codes closer to the current time node are more prominent during the matching process.

[0169] In the actual execution process, the current session encoding Q can be encoded by the bidirectional attention matching mechanism t and historical session encoding H t After matching, maximum pooling and average pooling, the first user intention information can be obtained.

[0170] The first user intention information may be a fixed-length vector representing the understanding of the current conversation in combination with the historical conversation information.

[0171] Continue to refer Figure 3 According to some embodiments of the present invention, after step 130, the method may further include: updating the current session state in the target scenario based on the target user intention information.

[0172] In this embodiment, based on the target user intention information, the current session state can be determined, and then based on the previous round, the current session state m t Update in time and generate the next round of session state m t+1 .

[0173] In the actual execution process, the target user intention information of the current round can be averaged to obtain a new predicted intention representation c, which is the predicted information of the next round of user intention generated based on the target user intention information of this round.

[0174] Then the new predicted intent representations c and u corresponding to this round are concatenated, and the next round of session state m is obtained through a fully connected network update. t+1 .

[0175] It is understandable that a round of dialogue may have multiple target user intention information, or no specific intention. For the case of no intention, a representation vector without intention is used.

[0176] It should be noted that, in actual application, the target user intention information may be generated based on the prediction in step 130; in the training process, the user intention information may be the intention label corresponding to the round of conversation information after marking the sample conversation information.

[0177] For example, when the target scenario is to send express delivery, and the session state of the previous round is the node of entering the recipient's information, the target user intention information identified in this round is "pay on delivery", then the current session state generated based on the target user intention information is "determine the payment method", and based on the previous round of session state, the current session state is added to update the current session state under the target scenario.

[0178] In addition, based on the current target user intention information, the predicted intention for the next round of conversation can be generated, such as "make payment", and based on the predicted intention and the target user intention information, the corresponding conversation intention for the next round can be generated, such as "determine the payment method".

[0179] According to the user intention identification method provided by the embodiment of the present invention, the current session state in the target scenario is updated through the target user intention information, and the next round of predicted intention is generated based on the target user intention information. The next round of corresponding session state can also be generated based on the predicted intention and the target user intention information, with high prediction accuracy and good intelligence.

[0180] In some embodiments, the user intent recognition method can be performed through a user intent recognition model.

[0181] Step 110 may include: inputting the current session information into the encoding layer of the user intention recognition model to obtain the current session code corresponding to the current session information output by the encoding layer;

[0182] Step 120 may include: inputting the current session code into a matching layer of a user intent recognition model to obtain current session information output by the matching layer corresponding to first user intent information;

[0183] Step 130 may include: inputting the first user intention information into an output layer of the user intention recognition model to obtain the current session information output by the output layer corresponding to the target user intention information;

[0184] The user intention recognition model is obtained by training with sample session information as samples and sample user intention information corresponding to the sample session information as sample labels.

[0185] In this embodiment, the user intention recognition model includes: an encoding layer, a matching layer and an output layer.

[0186] The coding layer user encodes the first round or non-first round of session information to generate the current session code, and superimposes the codes of each round of session information before the current time node to generate the historical session code.

[0187] The matching layer is used to match the current session encoding with the historical session encoding to generate first user intention information.

[0188] The output layer is used to generate target user intention information based on the first user intention information, the target graph structure and the first intention prediction information.

[0189] The specific implementation process has been described above and will not be repeated here.

[0190] The training process of the user intent recognition model is described below.

[0191] In the actual implementation process, the method may further include:

[0192] Get sample session information;

[0193] Perform multiple rounds of labeling on sample conversation information based on time series to generate intent labels corresponding to each round of conversation information;

[0194] The user intent recognition model is trained based on intent labels and sample session information.

[0195] In this embodiment, the sample session information is a training sample in the training process, and the intent label is a sample label corresponding to the sample session information.

[0196] In the actual implementation process, multiple completed historical conversation information can be obtained as sample conversation information. For example, it can be built on an existing telephone intelligent assistant solution to obtain real multi-round conversation data. The existing telephone intelligent assistant solution can implement a basic solution by any rule-based conversation management or single-round conversation method.

[0197] For each sample conversation information, the caller’s conversation intent labels are annotated at each time node during the call cycle, and the entire call sequence with intent labels is used as a training sample.

[0198] The intent label is used to represent the real intent that the user wants to express in this round of conversation information.

[0199] For example, for the following sample session information:

[0200] User: "I want to send a courier";

[0201] Robot: "OK, please provide the sender's name, address and contact information."

[0202] User: "Name XX, address XXX, contact information XXXX."

[0203] Robot: "Please provide the recipient's name, address, and contact information."

[0204] User: "Name XX, address XXX, contact information XXXX."

[0205] Robot: "What's this?"

[0206] User: “File.”

[0207] Robot: "Please select the shipping method"

[0208] User: “Cash on delivery.”

[0209] Based on the time series, the sample conversation information can be labeled multiple times to generate the intent label corresponding to the first round of conversation as "send express", the intent label corresponding to the second round of conversation as "sender information", the intent label corresponding to the third round of conversation as "recipient information", the intent label corresponding to the fourth round of conversation as "item information", and the intent label corresponding to the fifth round of conversation as "cash on delivery".

[0210] Based on the intent label of each round of conversation, each round of conversation can be attributed to the corresponding conversation state.

[0211] It can be understood that the intent label can be used to determine the first intent prediction information, the target intent prediction information, and whether there is a negative intent.

[0212] In some embodiments, the training method may further include:

[0213] During model training, if the validation set effect does not increase for five consecutive times, the model will be returned to the parameter state of the optimal validation set effect and new training settings will be executed.

[0214] Set a probability variable p for intent labeling based on the number of training steps. The initial probability is set to 100%, and then decreases linearly with the number of training steps, eventually decreasing to 0%.

[0215] That is, during the model training process, the intent label is used with probability p to determine whether a negative intent exists, otherwise the prediction result generated by the matching layer based on the first user intent information is used to determine whether a negative intent exists.

[0216] As the value of p gradually decreases, the dependence of the user intent recognition model on the true intent label will gradually decrease.

[0217] Finally, the model with the best performance on the validation set is selected as the user intent recognition model.

[0218] In this embodiment, by setting the usage probability variable p, the user intention recognition model can gradually adapt to the method of determining negative intentions in the absence of intention labels, thereby adapting the user intention recognition model to the usage scenarios when there are no intention labels in actual use.

[0219] The user intention recognition device provided by the present invention is described below. The user intention recognition device described below and the user intention recognition method described above can be referenced to each other.

[0220] like Figure 4 As shown, the user intention recognition device includes: a first generation module 410, a second generation module 420 and a third generation module 430.

[0221] The first generating module 410 is used to encode the current session information and generate a current session code;

[0222] A second generating module 420, configured to generate current first user intention information based on the current session code and the historical session code;

[0223] The third generation module 430 is used to generate target user intention information corresponding to the current session information based on the first user intention information and the first intention prediction information; the first intention prediction information is used to characterize the correlation between the predicted intention determined by the previous round of session information and the first user intention information.

[0224] According to the user intention recognition device provided by the embodiment of the present invention, the target graph structure is determined based on the logical relationship of each intention in the target scenario, and the cross-effects between intentions are captured based on the target graph structure. The user intention understanding of the previous round is detected based on the first user intention information generated in the current round, and when it is determined that the user intention understanding of the previous round is wrong, the structural relationship of the target graph structure is dynamically updated to generate the second user intention information, so as to correct some errors in the process of the conversation in a timely manner, and ensure that when errors in intention understanding occur, the task-based dialogue can still proceed normally.

[0225] In some embodiments, the third generation module 430 may also be used to:

[0226] Performing full connection processing on the first user intention information to generate a prediction result corresponding to the first user intention information;

[0227] When the prediction result is a negative intention, the target graph structure under the target scenario corresponding to the previous round of session information is reversed to generate second user intention information, which is different from the first user intention information;

[0228] When the score corresponding to the second user intention information exceeds the target threshold, the second user intention information is determined as the target user intention information.

[0229] In some embodiments, the first generating module 410 may also be used to: encode the current session information and the previous round of machine session information to generate a current session code.

[0230] In some embodiments, the second generating module 420 may also be used to:

[0231] Insert time code into historical conversation code;

[0232] Based on the time code, the current session code and the historical session code are bidirectionally matched to generate the first user intention information.

[0233] In some embodiments, the device may also include: a first processing module, which is used to update the current session state in the target scenario based on the target user intention information after generating the target user intention information corresponding to the current session information based on the first user intention information and the first intention prediction information.

[0234] In some embodiments, the apparatus may further include: a second processing module, configured to:

[0235] Before encoding the current session information and generating the current session code, in the case of a first round of conversation, encoding the first round of conversation information of the user and generating the first round of conversation code;

[0236] The first round of user intent information is generated based on matching the first round of conversation code and the user's identity.

[0237] In some embodiments,

[0238] The first generating module 410 may also be used to: input the current session information into the encoding layer of the user intention recognition model to obtain the current session code corresponding to the current session information output by the encoding layer;

[0239] The second generating module 420 may also be used to: input the current session code into the matching layer of the user intention recognition model to obtain the current session information output by the matching layer corresponding to the first user intention information;

[0240] The third generating module 430 may also be used to: input the first user intention information into the output layer of the user intention recognition model to obtain the current session information output by the output layer corresponding to the target user intention information;

[0241] The user intention recognition model is obtained by training with sample session information as samples and sample user intention information corresponding to the sample session information as sample labels.

[0242] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the user intention recognition method, which includes: encoding the current session information to generate the current session code; generating the current first user intention information based on the current session code and the historical session code; generating the target user intention information corresponding to the current session information based on the first user intention information and the first intention prediction information; the first intention prediction information is determined by the predicted intention determined based on the previous round of session information.

[0243] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0244] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the user intention recognition method provided by the above methods, and the method includes: encoding current session information to generate a current session code; generating current first user intention information based on the current session code and the historical session code; generating target user intention information corresponding to the current session information based on the first user intention information and the first intention prediction information; the first intention prediction information is determined by the predicted intention determined based on the previous round of session information.

[0245] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned user intention recognition methods, the methods comprising: encoding current session information to generate a current session code; generating current first user intention information based on the current session code and the historical session code; generating target user intention information corresponding to the current session information based on the first user intention information and the first intention prediction information; the first intention prediction information is determined by the predicted intention determined based on the previous round of session information.

[0246] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0247] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0248] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for identifying user intention, characterized in that: include: Encode the current session information to generate a current session code; Generate current first user intention information based on the current session code and the historical session code; generating target user intention information corresponding to the current session information based on the first user intention information and the first intention prediction information; The first intention prediction information is used to characterize the correlation between the predicted intention determined by the previous round of session information and the first user intention information; The generating, based on the first user intention information and the first intention prediction information, the target user intention information corresponding to the current session information includes: Performing full connection processing on the first user intention information to generate a prediction result corresponding to the first user intention information; When the prediction result is a negative intention, the target graph structure under the target scenario corresponding to the previous round of session information is reversed to generate second user intention information, where the second user intention information is different from the first user intention information; the negative intention is used to indicate that the first user intention information is inaccurate; When the score corresponding to the second user intention information exceeds the target threshold, the second user intention information is determined as the target user intention information.

2. The method for identifying user intention according to claim 1, characterized in that: The step of encoding the current session information to generate the current session code includes: The current session information and the previous round of machine session information are encoded to generate the current session code.

3. The method for identifying user intention according to claim 1, characterized in that: The generating current first user intention information based on the current session code and the historical session code includes: Inserting a time code into the historical conversation code; Based on the time code, the current session code and the historical session code are bidirectionally matched to generate the first user intention information.

4. The method for identifying user intention according to claim 1, characterized in that: After generating the target user intention information corresponding to the current session information based on the first user intention information and the first intention prediction information, the method further includes: Based on the target user intention information, the current session state in the target scenario is updated.

5. The method for identifying user intention according to any one of claims 1 to 4, characterized in that: Before encoding the current session information to generate the current session code, the method further includes: In the case of a first round of conversation, the first round of conversation information of the user is encoded to generate a first round of conversation code; First-round user intention information is generated based on matching the first-round conversation code and the user's identity identifier.

6. The method for identifying user intention according to any one of claims 1 to 4, characterized in that: The encoding of the current session information to generate the current session code includes: inputting the current session information into a coding layer of a user intention recognition model to obtain a current session code corresponding to the current session information output by the coding layer; The generating the current first user intention information based on the current session code and the historical session code includes: inputting the current session code into a matching layer of the user intention recognition model to obtain the first user intention information corresponding to the current session information output by the matching layer; The generating, based on the first user intention information and the first intention prediction information, the target user intention information corresponding to the current session information includes: inputting the first user intention information into the output layer of the user intention recognition model, and obtaining the target user intention information corresponding to the current session information output by the output layer; The user intention recognition model is obtained by training using sample session information as samples and sample user intention information corresponding to the sample session information as sample labels.

7. A user intention recognition device, characterized in that: include: A first generating module, used for encoding the current session information to generate a current session code; A second generating module, configured to generate current first user intention information based on the current session code and the historical session code; A third generating module, configured to generate target user intention information corresponding to the current session information based on the first user intention information and the first intention prediction information; The first intention prediction information is used to characterize the correlation between the predicted intention determined by the previous round of session information and the first user intention information; The generating, based on the first user intention information and the first intention prediction information, the target user intention information corresponding to the current session information includes: Performing full connection processing on the first user intention information to generate a prediction result corresponding to the first user intention information; When the prediction result is a negative intention, the target graph structure under the target scenario corresponding to the previous round of session information is reversed to generate second user intention information, where the second user intention information is different from the first user intention information; the negative intention is used to indicate that the first user intention information is inaccurate; When the score corresponding to the second user intention information exceeds the target threshold, the second user intention information is determined as the target user intention information.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the user intention recognition method according to any one of claims 1 to 6 are implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the user intention recognition method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the user intention recognition method according to any one of claims 1 to 6 are implemented.