WO2023246393A1 - 意图识别模型训练及用户意图识别 - Google Patents

意图识别模型训练及用户意图识别 Download PDF

Info

Publication number
WO2023246393A1
WO2023246393A1 PCT/CN2023/095201 CN2023095201W WO2023246393A1 WO 2023246393 A1 WO2023246393 A1 WO 2023246393A1 CN 2023095201 W CN2023095201 W CN 2023095201W WO 2023246393 A1 WO2023246393 A1 WO 2023246393A1
Authority
WO
WIPO (PCT)
Prior art keywords
intention
training sample
risk
user
recognition model
Prior art date
Application number
PCT/CN2023/095201
Other languages
English (en)
French (fr)
Inventor
应缜哲
王昊天
王维强
Original Assignee
支付宝(杭州)信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2023246393A1 publication Critical patent/WO2023246393A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0635Risk analysis of enterprise or organisation activities

Definitions

  • This application relates to the field of computer technology, and in particular to intent recognition model training and user intent recognition.
  • This manual provides an intent recognition model training and a model-based user intent recognition method to promptly discover user behavioral risks and improve the timeliness and accuracy of risk control.
  • the embodiments of this specification provide an intention recognition model training and user intention recognition method and device, which are used to at least partially solve the problems existing in the prior art.
  • This specification adopts the following technical solution:
  • This specification provides a training method for the intent recognition model, including: determining each training sample based on historical dialogue data, and the training sample contains multiple rounds of dialogue; for each training sample, through training
  • the completed first intention recognition model determines the user intention of each round of dialogue in the training sample as the first annotation of the training sample; based on the training sample, determines the pre-order business performed by the user corresponding to the training sample, so as to Determine the subsequent business performed by the user corresponding to the preceding business, and determine the feedback intention based on the dialogue data corresponding to the subsequent business as the second annotation corresponding to the training sample; according to the first annotation corresponding to the training sample and the third annotation Second annotation, determine the first risk identification result corresponding to the training sample; input the training sample into the second intention identification model to be trained, determine each predicted intention and the second risk identification result corresponding to the training sample; according to the second intention identification result of each training sample The difference between the first risk identification result and the second risk identification result determines the loss, and trains the second
  • This specification provides a user intention recognition method, which includes: obtaining each round of dialogue data currently conducted by the user; inputting the current round of dialogue data into the first intention recognition model, and determining the corresponding dialogue data of the current round of the user.
  • the first intention of The turn dialogue data is input into the second intention recognition model to determine each second intention corresponding to the input dialogue data; determine whether there is a difference between the first intention corresponding to the designated turn dialogue data that has been carried out and each second intention; If so, it is determined that there is a risk caused by the user's false intention, and the user is prompted that the risk exists; wherein, the second intention recognition model uses several pieces of historical dialogue data as training samples, and based on the complaint intention corresponding to each training sample and the The first risk identification result determined by the user intention determined by the first intention identification model, each predicted intention determined by the second intention identification model and the second risk identification result are obtained by training.
  • This specification provides a training device for an intent recognition model, including: a training sample determination module for determining each training sample based on historical dialogue data, where the training samples include multiple rounds of dialogue; a first annotation determination module for For each training sample, the user intention of each round of dialogue in the training sample is determined through the first intention recognition model that has been trained, as the first annotation of the training sample; the second annotation determination module is used to determine based on the training sample, Determine the preamble business performed by the user corresponding to the training sample to determine the subsequent business performed by the user corresponding to the preamble business, and determine the feedback intention based on the dialogue data corresponding to the subsequent business as the corresponding to the training sample The second label; the first risk identification module is used to base the first label and the second label corresponding to the training sample on Mark, determine the first risk identification result corresponding to the training sample; the second risk identification module is used to input the training sample into the second intention identification model to be trained, and determine each predicted intention and the second risk identification corresponding to the training sample Result; a training module, used
  • This specification provides a user intention recognition device, including: an acquisition module, used to obtain each round of dialogue data currently conducted by the user; a first intention determination module, used to input the current round of dialogue data into the first intention recognition A model to determine the first intention corresponding to the user's current round of dialogue data; a first risk determination module to determine the risk identification corresponding to the dialogue data based on the first intention corresponding to each round of dialogue data that has been conducted.
  • a second intention determination module configured to, when it is determined that there is no risk according to the risk identification result, input the currently conducted designated round of dialogue data into the second intention identification model, and determine each of the dialogue data corresponding to the input The second intention; the second risk determination module is used to determine whether there is a difference between the first intention corresponding to the specified round of dialogue data and each second intention; if so, it is determined that there is a risk caused by the user's false intention, and prompts Said user is at risk.
  • This specification provides a computer-readable storage medium.
  • the storage medium stores a computer program.
  • the computer program is executed by a processor, the training method of the above-mentioned intention recognition model or the user intention recognition method is implemented.
  • This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor.
  • the processor executes the program, it implements the training method of the intention recognition model or the user intention. recognition methods.
  • At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
  • historical dialogue data containing multiple rounds of dialogue are first determined as training samples, and through the first intention
  • the identification model determines the user intention of each round of dialogue of each training sample, and determines the feedback intention based on the business performed by the user corresponding to the training sample.
  • the first risk identification result is determined based on the user intention and feedback intention of the training sample
  • the The second intention recognition model determines each predicted intention of the training sample and the second risk recognition result, and finally uses the minimum difference between the first risk recognition result and the second risk recognition result of each training sample as the optimization goal to optimize the second intention recognition model Conduct training.
  • accurate risk identification results are obtained to train the second intention recognition model, which improves the risk identification capability of the second intention recognition model.
  • Figure 1 is a schematic diagram of the training process of an intention recognition model provided in this manual
  • Figure 2 is a schematic diagram of a user intention recognition process provided in this manual
  • Figure 3 is a schematic diagram of a training device for the intention recognition model provided in this specification.
  • Figure 4 is a schematic diagram of a user intention recognition device provided in this specification.
  • Figure 5 is a schematic diagram of an electronic device that implements the training method of the intention recognition model or the user intention recognition method provided in this specification.
  • the server of the business platform usually needs to conduct dialogues with users related to user operations, confirm whether there are risks in the user's operation behavior, detect risks in a timely manner and prompt the user to avoid damage to the user's interests.
  • the server of the business platform can use outbound calls or actively initiate dialogue chats to complete communication with users through multiple rounds of dialogue, so that based on the results of each round of dialogue, a pre-trained model can be used to identify the answers in that round.
  • a pre-trained model can be used to identify the answers in that round.
  • users may be unable to fully cooperate with the business platform because they are being deceived, making it difficult for the business platform server to correctly identify the user's intentions based only on the results of a single round of dialogue, and cannot promptly discover whether there are risks in the user's operating behavior.
  • the timeliness and accuracy of risk control are low.
  • Figure 1 is a schematic diagram of the training process of an intention recognition model in this specification, which specifically includes the following steps: S100: Determine each training sample based on historical conversation data, and the training samples include multiple rounds of conversations.
  • the obtained historical dialogue data may be the entire dialogue text, or may be a combination of the unique code of the question and the corresponding user reply.
  • the server of the business platform can pre-set multiple question templates, and then adaptively generate questions according to specific users and specific user operations. Therefore, each question template can be coded in advance and given a unique identifier, then When saving, you can save only the encoding of the question template and the text content of the user's reply.
  • the server of the business platform can obtain the code of the question and the corresponding user reply.
  • the server of the business platform when the server of the business platform communicates with users through outbound calls, it can perform voice recognition on the user's voice collected during the outbound call, and then save the text content of the recognized user's reply, so that the server of the business platform can obtain to the encoding of the question and the corresponding user response.
  • the code of the saved question template and the user's reply can be directly corresponding.
  • the server of the business platform usually needs to conduct multiple rounds of dialogue with the user to repeatedly confirm whether the user's behavior is risky from multiple angles. Therefore, the historical dialogue data obtained by the server includes the coding of the question templates corresponding to the multiple rounds of dialogue and the user's responses. .
  • the server mentioned in this manual can be a server installed on the business platform, or a device such as a desktop computer, laptop computer, etc. that can execute the solution of this manual.
  • a server installed on the business platform, or a device such as a desktop computer, laptop computer, etc. that can execute the solution of this manual.
  • the following description only takes the server as the execution subject.
  • the server of the business platform can also pre-train the second intention recognition model based on the acquired pieces of historical conversation data. Specifically, the server can randomly replace at least part of the user responses in each historical dialogue data with placeholders to obtain each pre-training sample, and use the replaced user responses as the dialogue annotations corresponding to each pre-training sample, so that the subsequent dialogue can be
  • the trained second intention recognition model predicts the replaced user reply based on other conversation data, and learns the ability to make inferences in conjunction with the context.
  • replacing at least part of the user replies in each historical conversation data may refer to masking (mask) the user replies of part of the conversations in the multiple rounds of conversations.
  • the second intention recognition model may be a BERT model, and the BERT model may be a pre-trained general language representation model, thereby reducing the amount of training.
  • the model needs to provide real-time feedback based on the calculation results, therefore, a BERT model with fewer layers can be used to improve calculation efficiency and save calculation time.
  • a 6-layer BERT model can be used .
  • the specific model used can be determined according to needs, and this manual does not limit this.
  • the server can input the pre-training sample into the input layer of the second intention recognition model to be trained, and determine the predicted sentence corresponding to each replaced user's reply through the first output layer of the second intention recognition model, that is, through
  • the second intent recognition model is based on the relationship between the unreplaced conversation data and the questions corresponding to the replaced user replies, and predicts the obscured user replies word by word or word by word based on the number of words in the extracted user reply. Determine the prediction statement.
  • the specific way in which the difference between the predicted statement and the annotated answer is reflected can be determined as needed, and this manual does not limit this.
  • the similarity between the predicted statement and the annotated answer can be calculated through the edit distance (Levenshtein, LEV) or the length of the Longest Common Subsequence (LCS). The higher the similarity, the greater the difference. Small.
  • LEV edit distance
  • LCS Longest Common Subsequence
  • the pre-training end conditions can be set as needed, and this manual does not limit this.
  • S102 For each training sample, use the trained first intention recognition model to determine the user intention of each round of dialogue in the training sample as the first annotation of the training sample.
  • S104 Based on the training sample, determine the preamble business performed by the user corresponding to the training sample, determine the subsequent business performed by the user corresponding to the preamble business, and determine the feedback intention based on the dialogue data corresponding to the subsequent business. , as the second label corresponding to the training sample.
  • the server can determine the user intention of each round of dialogue in the training sample through the first intention recognition model completed by training, as the third intention of the training sample.
  • One mark the server can determine the user intention of each round of dialogue in the training sample through the first intention recognition model completed by training, as the third intention of the training sample.
  • the first intention recognition model determines the user's intention based on the dialogue data can be determined as needed, and this specification does not limit this.
  • the first intention recognition model can perform named entity recognition based on the user's reply, so that the intention information corresponding to the user's reply can be extracted based on the user's reply.
  • the server asks the question "What are you buying?" during the conversation, and the corresponding user replies "I am buying furniture.”
  • the server can use the first intention recognition model to reply " "I'm buying furniture” extracts the intent information corresponding to the user's (transaction purpose: furniture).
  • the above description is based on the example of one round of dialogue containing one intention. However, this specification does not limit the number of intentions recognized in each round of dialogue.
  • the server in addition to determining the intention annotation of each training sample through the first intention recognition model, can also identify the first intention recognition model at historical moments when historical conversations occur. Each user intention is stored correspondingly with the historical dialogue, and then the server can directly obtain each user intention of the historical dialogue data corresponding to each training sample stored as the intention annotation of each training sample.
  • the server can determine the subsequent business performed by the user corresponding to the preceding business based on the preceding business.
  • the subsequent service may be other services performed by the user based on the preceding service.
  • the subsequent service may be a complaint service. Then the server can determine the user intention corresponding to the dialogue data based on the dialogue data corresponding to the complaint service, as the feedback intention corresponding to the training sample, and use the feedback intention as the second annotation corresponding to the training sample.
  • the second annotation corresponding to the training sample is empty. It can be considered that the user intention identified as the first annotation by the first intention recognition model is acceptable. It is believed that after the user complains about the business that cannot be performed normally due to fraud or other reasons, the complaint intention as the second annotation can be obtained based on the complaint content recognition. In this case, the first intention recognition model can be considered to identify The obtained user intention and complaint intention together reflect the user's true intention, and the combination of the user intention and the complaint intention is credible. Subsequently, a credible first risk identification result can be determined through the first annotation and the second annotation, and the intention identification model to be trained can be trained.
  • S108 Input the training sample into the second intention recognition model to be trained, and determine each predicted intention and the second risk recognition result corresponding to the training sample.
  • the server may first determine the first annotation and the second annotation corresponding to the training sample based on the first annotation and the second annotation corresponding to the training sample.
  • the first risk identification result is thereby further used to train the second intention identification model to be trained based on the first risk identification result.
  • the server can predetermine each risk intention combination that is risky.
  • the intention combination (transaction method: online personal, transaction purpose: valuables) can be used as a risk intention combination.
  • the risk intention combination does not limit the number of intentions in the intention combination.
  • (Transaction purpose: virtual items are risky) can be regarded as a risky risk intention combination, and there can be only one intention in the combination.
  • the second annotation can be regarded as a supplement to the first annotation.
  • the intent annotation determined by the first intention recognition model may not be completely accurate. For example, when the user is in a state of being deceived and cannot fully cooperate with the server dialogue to understand the situation. When the user may give a false answer, the first intention recognition model will identify the user's false intention based on the user's false answer. When the user escapes from being deceived, he or she may ask the server to perform follow-up services, such as complaint services, based on the pre-order services performed by the user who generated the corresponding historical conversation data.
  • the combination of the first label and the second label corresponding to the training sample is (transaction method: online personal, transaction purpose: virtual items are risky), then taking the aforementioned risk intention combination as an example, the first label corresponding to the training sample
  • the risk identification result is that there is a risk.
  • the combination of the first label and the second label corresponding to the training sample is (transaction method: offline store, transaction purpose: physical goods), then taking the above risk intention combination as an example, the first risk identification corresponding to the training sample The result is no risk.
  • the user can input the training sample into the intention identification model to be trained, and determine the predicted intentions corresponding to the training sample by integrating the user responses and the connections between the multi-round dialogue contexts. and second risk identification results.
  • the server can determine the second risk identification result based on each predicted intention, and subsequently train the second intention identification model based on the first risk identification result.
  • the server can determine whether the combination of predicted intentions corresponding to the training sample matches any risk intention combination based on the preset risky intention combinations, and if so, determine the second risk corresponding to the training sample.
  • the identification result is that there is a risk. If not, it is determined that the second risk identification result corresponding to the training sample is that there is no risk.
  • the specific process is the same as the process of determining the first risk identification result, and please refer to the corresponding description above.
  • the server can use the pre-trained second intention recognition model to The first output layer is replaced by a second output layer configured to output prediction intentions based on training samples.
  • the server can then input the training sample into the input layer of the pre-trained second intention recognition model, and obtain each predicted intention corresponding to the training sample through the second output layer.
  • the pre-trained intention recognition model when determining the user intention corresponding to the training sample based on the input training sample, it is not only based on the user's reply for objective intent recognition.
  • the The pre-trained intention recognition model can integrate user responses and the connections between multiple rounds of conversations for intent recognition, thereby identifying more accurate predicted intentions. Through pre-training, the training efficiency of the second intention recognition model is improved.
  • S110 Determine the loss based on the difference between the first risk identification result and the second risk identification result of each training sample, and train the second intention identification model to be trained with the minimum loss as the optimization goal.
  • the server After determining the first intention recognition result and the second risk recognition result corresponding to the training sample through the above, the server can determine the loss based on the difference between the first intention recognition result and the second risk recognition result of each training sample, and minimize the loss. In order to optimize the target, the second intention recognition model to be trained is trained.
  • the specific algorithm used to determine the loss can be determined according to needs, and this manual does not limit this. For example, if the presence of risk in the risk identification result is 1 and the absence of risk is 0, the loss can be determined based on the sum of squares of the differences between the first risk identification result and the second risk identification result of each training sample.
  • the intention recognition model can continuously improve the accuracy of predicting intentions during the iterative training process, thereby improving the accuracy of risk identification.
  • this specification also provides a user intention recognition method, as shown in Figure 2.
  • the server of the business platform can use outbound calls or actively initiate dialogue chats to complete communication with users through multiple rounds of dialogue, so as to promptly discover users' operational risks and conduct risk control.
  • the server of the business platform can obtain the data of each round of dialogue currently conducted by the user, thereby identifying the user's intention based on the data of each round of dialogue that has been carried out, and confirming the recognition result as Prompt when there are risks.
  • the data of each round of dialogue that has been currently conducted may include the questions raised by the dialogue server in each round of dialogue and the corresponding user responses in each round of dialogue that have been completed up to the current moment.
  • the codes corresponding to the question templates raised by the server can be saved based on the precoding of the question templates.
  • each round of dialogue data can include the codes of the question templates raised by the server in each round of dialogue. and corresponding user responses.
  • the specific content of the template question please refer to the corresponding description in step S100 and will not be described again here.
  • the server mentioned in this manual can be a server installed on the business platform, or a device such as a desktop computer, laptop computer, etc. that can execute the solution of this manual.
  • a server installed on the business platform, or a device such as a desktop computer, laptop computer, etc. that can execute the solution of this manual.
  • the following description only takes the server as the execution subject.
  • S202 Input the current round of dialogue data into the first intention recognition model, and determine the first intention corresponding to the user's current round of dialogue data.
  • S204 Determine the risk identification results corresponding to the dialogue data based on the first intention corresponding to each round of dialogue data that has been conducted.
  • the server can first use the first intention recognition model, input the current round of dialogue data into the first intention recognition model, and determine the first intention corresponding to the user's current round of dialogue data.
  • the first intention refers to all intentions identified by the dialogue data corresponding to the current round, and may include one or more intentions.
  • the server can determine the first risk identification results corresponding to each round of conversation data that have been conducted based on each determined first intention. Specifically, the server can save each first intention corresponding to each round of dialogue data determined by the first intention recognition model round by round, and then determine the correspondence of each round of dialogue data that has been carried out based on the preset risky intention combinations.
  • the combination of first intentions that is, whether the combination of each saved first intention and the first intention corresponding to the current round of dialogue data matches any risk intention combination, and if so, determine the current round of dialogue data
  • the corresponding first risk identification result is that there is a risk. If not, it is determined that the first risk identification result corresponding to the current round of dialogue data is that there is no risk.
  • the first risk identification result determined in the current round is the result obtained after adding the first intention corresponding to the dialogue data of the current round. Therefore, the first risk identification result determined in the current round is The first risk identification result can also be said to be the dialogue data corresponding to the current round.
  • the server can directly determine the risk and prompt the user that there is a risk in the previous business performed by the user corresponding to this conversation.
  • the server can directly determine the risk and prompt the user that there is a risk in the previous business performed by the user corresponding to this conversation.
  • the first intention recognition model identifies the false intention based on the user's false answer.
  • the server can input the current designated round of dialogue data into the second intention recognition model, and determine each second intention corresponding to the input dialogue data.
  • the designated rounds can be determined according to needs or the settings of model input parameters, and this manual does not limit this.
  • the server can also input the dialogue data of each round that has been carried out into the second intention recognition model.
  • specifying the number of rounds may be to select part of the input second intention recognition model when the number of dialogue rounds that have been carried out is large.
  • the specified number of rounds here can also refer to the number of rounds each time the second intention recognition model is input.
  • the server can also use the The data is fed into the second intent recognition model in batches.
  • the more rounds of dialogue data are input the higher the accuracy of intent recognition by the model.
  • the longer the model takes to run the less timely it is to provide feedback on the recognition results.
  • the second intention recognition model here uses several pieces of historical dialogue data as training samples, and determines the first risk identification result based on the feedback intention corresponding to each training sample and the user intention determined by the first intention recognition model. Each predicted intention determined by the second intention recognition model and the second risk recognition result are obtained through training.
  • the second intention recognition model can be specifically trained based on any of the training methods of the intention recognition model provided above.
  • S210 Determine that there is a risk caused by the user's false intention, and prompt the user that there is a risk.
  • the server can determine the relationship between each first intention and each second intention based on each first intention and each second intention. Are there differences.
  • the server may determine whether there is a difference between each first intention and each second intention based on the determined first intention and each second intention corresponding to each second intention. If there is a difference, it means that the user response given by the user in the current round of dialogue conflicts with the information displayed in the data of the ongoing dialogue round, and the user may have given false information in the current round of dialogue. If the user replies, the user may be in a state of being deceived. The business performed by the user corresponding to this conversation may have risks caused by the user's false intentions. The server can promptly prompt the user. If there is no difference, it means that the user's performance during the entire dialogue process is relatively consistent, and there is no conflict in the information displayed in all the dialogue rounds that have been carried out, and the next round of dialogue can be continued until the entire dialogue process is completed. .
  • step S206 the server inputs the current specified round of dialogue data into the second intention recognition model, and when determining each second intention corresponding to the input dialogue data, Since the second intention recognition model performs intent recognition based on the user's multiple rounds of dialogue data, it may be difficult to obtain a more accurate recognition result if there are fewer dialogue rounds. Therefore, the server can also use the preset dialogue rounds to identify the intention. number of times, determine whether the current dialogue round is less than the number of dialogue rounds. If so, continue the next round of dialogue until the dialogue rounds reach the preset number of dialogue rounds.
  • the server can Input the current designated round of dialogue data into the second intention recognition model to determine each second intention corresponding to the user's current round of dialogue data.
  • the server can Input the current designated round of dialogue data into the second intention recognition model to determine each second intention corresponding to the user's current round of dialogue data.
  • step S206 the server inputs the currently conducted designated turn conversation data into the second intention recognition model, and determines each second intention corresponding to the user's current turn conversation data.
  • the server can also determine the designated round based on the length of the conversation data.
  • the server can According to the length of the dialogue data, the ongoing dialogue data is input into the second intention recognition model in batches. The number of rounds of dialogue data in the second intention recognition model can be outputted each time, making the input of dialogue data more flexible.
  • step S208 when the server determines whether there is a difference between the first intention and the second intention corresponding to the specified round of conversation data that has been conducted, the server may first For each risk intention combination, it is judged whether the combination of each second intention matches any risk intention combination. If so, it is determined that there is a risk caused by the user's false intention, and the user is prompted that there is a risk. If not, it is judged that the designation has been made. Whether there is a difference between the first intention and each second intention corresponding to the turn dialogue data. That is, a second judgment is first made based on each determined second intention to determine whether it is consistent with the determined first risk identification result. If consistent, further judgment is made. If inconsistent, it means that the user may be in a state of being deceived. The business performed by the user corresponding to this conversation may have risks caused by the user's false intentions, and the server can prompt the user in a timely manner.
  • Figure 3 is a schematic diagram of a training device for an intent recognition model provided in this specification, including: a training sample determination module 300, used to determine each training sample based on historical conversation data, where the training samples include multiple rounds of conversations; the first annotation is determined Module 302 is configured to determine, for each training sample, the user intention of each round of dialogue in the training sample through the first intention recognition model completed by training, as the first annotation of the training sample; the second annotation determination module 304, Used to determine, based on the training sample, the preamble business performed by the user corresponding to the training sample, to determine the subsequent business performed by the user corresponding to the preamble business, and to determine the feedback intention based on the dialogue data corresponding to the subsequent business.
  • a training sample determination module 300 used to determine each training sample based on historical conversation data, where the training samples include multiple rounds of conversations
  • the first annotation is determined Module 302 is configured to determine, for each training sample, the user intention of each round of dialogue in the training sample through the first intention recognition model completed by training, as the first annotation of
  • the first risk identification module 306 is used to determine the first risk identification result corresponding to the training sample according to the first annotation and the second annotation corresponding to the training sample;
  • the second risk identification Module 308 is used to input the training sample into the second intention recognition model to be trained, and determine each predicted intention corresponding to the training sample and the second risk recognition result;
  • the training module 310 is used to determine the first risk recognition result based on each training sample and the second risk identification result, determine the loss, and train the second intention recognition model to be trained with the minimum loss as the optimization goal, and the second intention recognition model is used to communicate with the third intention recognition model.
  • An intent recognition model jointly identifies risks caused by users' false intentions in conversations.
  • the device further includes: a pre-training module 312, configured to replace at least part of the user responses in each round of dialogue of the training sample with placeholders to obtain each pre-training sample, and determine each pre-training sample based on the replaced user response.
  • a pre-training module 312 configured to replace at least part of the user responses in each round of dialogue of the training sample with placeholders to obtain each pre-training sample, and determine each pre-training sample based on the replaced user response.
  • each pre-training sample is input into the input layer of the second intention recognition model to be trained, and through the first output layer of the second intention recognition model, the predicted sentences corresponding to the replies of each replaced user are determined.
  • pre-train the second intention recognition model pre-train the second intention recognition model to be trained until the training end condition is reached, and determine the second intention recognition obtained by pre-training Model.
  • the second risk identification module 308 replaces the first output layer of the pre-trained second intention identification model with a second output layer, and the second output layer is configured to output predicted intentions. , input the training sample into the input layer of the second intention recognition model obtained by pre-training, and obtain each predicted intention corresponding to the training sample through the second output layer.
  • the second annotation determination module 304 determines, based on the historical dialogue data corresponding to the training sample, the preceding business that generated the historical dialogue data, and based on the preceding business, determines the preceding business performed by the user that is related to the preceding business.
  • Complaint service corresponding to the sequence service, and based on the determined dialogue data corresponding to the complaint service, the user intention corresponding to the dialogue data is determined as the feedback intention corresponding to the training sample.
  • the first risk identification module 306 determines whether the combination of the first annotation and the second annotation corresponding to the training sample matches any risk intention combination according to each preset risk intention combination. If so, then It is determined that the first risk identification result corresponding to the training sample is that there is a risk; if not, it is determined that the first risk identification result corresponding to the training sample is that there is no risk.
  • the second risk identification module 308 determines whether the combination of predicted intentions corresponding to the training sample matches any combination of risk intentions based on the preset risk intention combinations, and if so, determines whether the training sample right The corresponding second risk identification result is that there is a risk; if not, it is determined that the second risk identification result corresponding to the training sample is that there is no risk.
  • this specification also provides a corresponding user intention recognition device, as shown in Figure 4.
  • Figure 4 is a schematic diagram of a user intention recognition device provided in this specification, including: an acquisition module 400, used to obtain the conversation data of each round currently conducted by the user; a first intention determination module 402, used to obtain the current round of conversation data. The data is input into the first intention recognition model to determine the first intention corresponding to the user's current round of dialogue data;
  • the first risk determination module 404 is used to determine the risk identification result corresponding to the dialogue data according to the first intention corresponding to each round of dialogue data that has been conducted; the second intention determination module 406 is used to determine the risk identification result according to the risk identification When it is determined that there is no risk, the currently conducted designated round of dialogue data is input into the second intention identification model to determine each second intention corresponding to the input dialogue data; the second risk determination module 408 is used to determine that the dialogue has been carried out Whether there is a difference between the first intention and each second intention corresponding to the specified round of dialogue data. If so, it is determined that there is a risk caused by the user's false intention, and the user is prompted that the risk exists.
  • the first risk determination module 404 determines, based on each preset combination of risk intentions, whether the combination of first intentions corresponding to each round of dialogue data that has been conducted matches any combination of risk intentions. If so, Then it is determined that the risk identification result corresponding to the dialogue data is that there is a risk; if not, it is determined that the risk identification result corresponding to the dialogue data is that there is no risk.
  • the electronic device includes a processor, internal bus, network interface, memory and non-volatile memory, and of course may also include other hardware required for business.
  • the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above-mentioned intention recognition model training method provided in Figure 1 or the user intention identification method provided in Figure 2.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • HDL High-Speed Integrated Circuit Hardware Description Language
  • the controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor. , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers and embedded microcontrollers.
  • controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, For Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller in addition to implementing the controller in the form of pure computer-readable program code, the controller can be completely programmed with logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded logic by logically programming the method steps. Microcontroller, etc. to achieve the same function. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the means for implementing various functions can be considered as structures within hardware components as well as software modules implementing the methods.
  • a typical implementation device is a computer.
  • the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or A combination of any of these devices.
  • embodiments of the present invention may be provided as methods, systems, or computer program products.
  • the invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
  • the invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-volatile storage in computer-readable media, random access memory (RAM) and/or Forms of non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash random access memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • compact disc read-only memory CD-ROM
  • DVD digital versatile disc
  • Magnetic tape cassettes tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium can be used to store information that can be accessed by a computing device.
  • computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • embodiments of the present specification may be provided as methods, systems, or computer program products.
  • the present description may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects.
  • the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk memory, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • the present description may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through communications networks.
  • program modules may be located in both local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Strategic Management (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • Educational Administration (AREA)
  • Development Economics (AREA)
  • Game Theory and Decision Science (AREA)
  • Human Computer Interaction (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Machine Translation (AREA)

Abstract

本说明书公开了一种意图识别模型训练及用户意图识别方法及装置,先确定包含多轮对话的历史对话数据作为训练样本,通过第一意图识别模型确定每个训练样本各轮对话的用户意图,并基于用户执行的与该训练样本对应的业务确定反馈意图,然后根据该训练样本的用户意图以及反馈意图确定第一风险识别结果,并通过第二意图识别模型确定该训练样本的各预测意图以及第二风险识别结果,最后以各训练样本第一风险识别结果与第二风险识别结果之间的差异最小为优化目标对第二意图识别模型进行训练。通过结合反馈意图以及由第一意图识别模型确定的用户意图,得到准确的风险识别结果,以对第二意图识别模型进行训练,提高了第二意图识别模型的风险识别能力。

Description

意图识别模型训练及用户意图识别 技术领域
本申请涉及计算机技术领域,尤其涉及意图识别模型训练及用户意图识别。
背景技术
目前,随着互联网的快速发展,交互式风控技术也在不断发展,在交互式风控的应用场景中,业务平台可以通过外呼的方式实现与用户的双向沟通,从而及时发现用户的行为风险,对用户进行行为劝阻或风险提示。因此,能否及时准确地发现用户的行为风险是需要重点考虑的问题。
本说明书提供一种意图识别模型的训练及基于模型的用户意图识别方法,以及时发现用户的行为风险,提高风控的时效性和准确度。
发明内容
本说明书实施例提供的一种意图识别模型训练及用户意图识别方法及装置,用于至少部分的解决现有技术中存在的问题。
本说明书采用下述技术方案:本说明书提供了一种意图识别模型的训练方法,包括:根据历史对话数据,确定各训练样本,所述训练样本包含多轮对话;针对每个训练样本,通过训练完成的第一意图识别模型,分别确定该训练样本中各轮对话的用户意图,作为该训练样本的第一标注;根据该训练样本,确定用户执行的与该训练样本对应的前序业务,以确定用户执行的与所述前序业务对应的后续业务,并基于所述后续业务对应的对话数据确定反馈意图,作为该训练样本对应的第二标注;根据该训练样本对应的第一标注以及第二标注,确定该训练样本对应的第一风险识别结果;将该训练样本输入待训练的第二意图识别模型,确定该训练样本对应的各预测意图以及第二风险识别结果;根据各训练样本第一风险识别结果与第二风险识别结果之间的差异,确定损失,并以所述损失最小为优化目标对所述待训练的第二意图识别模型进行训练,所述第二意图识别模型用于与所述第一意图识别模型共同识别对话中由用户虚假意图引起的风险。
本说明书提供了一种用户意图识别方法,包括:获取用户当前已进行的各轮次对话数据;将当前轮次的对话数据输入第一意图识别模型,确定所述用户当前轮次的对话数据对应的第一意图;根据已进行的各轮次对话数据对应的第一意图,确定所述对话数据对应的风险识别结果;当根据所述风险识别结果确定不存在风险时,将当前已进行的指定轮次对话数据输入第二意图识别模型,确定所述输入的对话数据对应的各第二意图;判断已进行的指定轮次对话数据对应的第一意图与各第二意图之间是否存在差异;若是,则确定存在用户虚假意图引起的风险,提示所述用户存在风险;其中,所述第二意图识别模型通过以若干段历史对话数据作为训练样本,根据由各训练样本对应的投诉意图以及所述第一意图识别模型确定出的用户意图确定出的第一风险识别结果、所述第二意图识别模型确定出的各预测意图以及第二风险识别结果,进行训练得到。
本说明书提供了一种意图识别模型的训练装置,包括:训练样本确定模块,用于根据历史对话数据,确定各训练样本,所述训练样本包含多轮对话;第一标注确定模块,用于针对每个训练样本,通过训练完成的第一意图识别模型,分别确定该训练样本中各轮对话的用户意图,作为该训练样本的第一标注;第二标注确定模块,用于根据该训练样本,确定用户执行的与该训练样本对应的前序业务,以确定用户执行的与所述前序业务对应的后续业务,并基于所述后续业务对应的对话数据确定反馈意图,作为该训练样本对应的第二标注;第一风险识别模块,用于根据该训练样本对应的第一标注以及第二 标注,确定该训练样本对应的第一风险识别结果;第二风险识别模块,用于将该训练样本输入待训练的第二意图识别模型,确定该训练样本对应的各预测意图以及第二风险识别结果;训练模块,用于根据各训练样本第一风险识别结果与第二风险识别结果之间的差异,确定损失,并以所述损失最小为优化目标对所述待训练的第二意图识别模型进行训练,所述第二意图识别模型用于与所述第一意图识别模型共同识别对话中由用户虚假意图引起的风险。
本说明书提供了一种用户意图识别装置,包括:获取模块,用于获取用户当前已进行的各轮次对话数据;第一意图确定模块,用于将当前轮次的对话数据输入第一意图识别模型,确定所述用户当前轮次的对话数据对应的第一意图;第一风险确定模块,用于根据已进行的各轮次对话数据对应的第一意图,确定所述对话数据对应的风险识别结果;第二意图确定模块,用于当根据所述风险识别结果确定不存在风险时,将当前已进行的指定轮次对话数据输入第二意图识别模型,确定所述输入的对话数据对应的各第二意图;第二风险确定模块,用于判断已进行的指定轮次对话数据对应的第一意图与各第二意图之间是否存在差异;若是,则确定存在用户虚假意图引起的风险,提示所述用户存在风险。
本说明书提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述意图识别模型的训练方法或用户意图识别方法。
本说明书提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述意图识别模型的训练方法或用户意图识别方法。
本说明书采用的上述至少一个技术方案能够达到以下有益效果:在本说明书提供的意图识别模型训练及用户意图识别方法及装置,先确定包含多轮对话的历史对话数据作为训练样本,通过第一意图识别模型确定每个训练样本各轮对话的用户意图,并基于用户执行的与该训练样本对应的业务确定反馈意图,然后根据该训练样本的用户意图以及反馈意图确定第一风险识别结果,并通过第二意图识别模型确定该训练样本的各预测意图以及第二风险识别结果,最后以各训练样本第一风险识别结果与第二风险识别结果之间的差异最小为优化目标对第二意图识别模型进行训练。通过结合反馈意图以及由第一意图识别模型确定的用户意图,得到准确的风险识别结果,以对第二意图识别模型进行训练,提高了第二意图识别模型的风险识别能力。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1为本说明书提供的一种意图识别模型的训练流程示意图;
图2为本说明书提供的一种用户意图识别流程示意图;
图3为本说明书提供的一种意图识别模型的训练装置示意图;
图4为本说明书提供的一种用户意图识别装置示意图;
图5为本说明书提供的一种实现意图识别模型的训练方法或用户意图识别方法的电子设备示意图。
具体实施方式
为使本说明书的目的、技术方案和优点更加清楚,下面将结合本说明书具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于说明书中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
随着互联网的快速发展,越来越多的用户通过互联网完成各种需求,例如,网络购物、网络转账、外卖预定等等。由于网络的隐匿性,使得可能存在用户遭遇网络诈骗等损害用户利益的行为。因此,为了保障用户利益,业务平台的服务器通常需要与用户进行用户操作相关的对话,确认用户的操作行为是否存在风险,以及时发现风险并提示用户,避免用户利益受到损害。
一般的,业务平台的服务器可采用外呼或主动发起对话聊天等方式,通过多轮对话来完成与用户的沟通交流,从而根据每一轮对话结果,通过预先训练的模型,来识别该轮回答中显示的用户意图是否存在风险。但是,用户可能会因为处于被欺骗的状态,而不能完全配合业务平台,使得业务平台的服务器仅根据单轮的对话结果,难以正确识别用户意图,则无法及时发现用户的操作行为是否存在风险,风控的时效性和准确度较低。
以下结合附图,详细说明本申请各实施例提供的技术方案。
图1为本说明书中一种意图识别模型训练流程示意图,具体包括以下步骤:S100:根据历史对话数据,确定各训练样本,所述训练样本包含多轮对话。
一般的,业务平台的服务器可根据用户数据,采用外呼等方式,主动与用户通过简单的对话沟通交流,在对话过程中,可保存具体的对话内容,以应用于其他业务。基于此,在本说明书一个或多个实施例中,业务平台的服务器可获取若干段历史对话数据,确定各训练样本,进行模型训练,该训练样本可包含多轮对话。
其中,所获取的历史对话数据可以是全部对话文本,还可以是问题的唯一编码与对应的用户回复的组合。通常,业务平台的服务器可预先设置多种问题模板,然后根据具体的用户以及具体的用户操作适应性地生成问题,因此,可预先给各问题模板进行编码,赋予各问题模板唯一性标识,则保存时可只保存问题模板的编码以及用户回复的文本内容。对应的,业务平台的服务器可获取问题的编码与对应的用户回复。
当然了,对于业务平台的服务器采取外呼的方式与用户交流时,可对外呼过程中采集到的用户语音进行语音识别,然后保存识别得到的用户回复的文本内容,使得业务平台的服务器可获取到问题的编码与对应的用户回复。对于并非采用语音通话方式与用户交流的情况,则可直接对应保存问题模板的编码以及用户回复。
此外,业务平台的服务器通常需要与用户进行多轮对话,从多个角度反复确认用户的行为是否存在风险,因此,服务器所获取的历史对话数据包含多轮对话对应的问题模板的编码以及用户回复。
本说明书中提到的服务器可以是设置于业务平台的服务器,或能够执行本说明书方案的诸如台式机、笔记本电脑等设备。为了方便说明,下面仅以服务器为执行主体进行说明。
在获取到若干段历史对话数据后,在本说明书一个或多个实施例中,业务平台的服务器还可根据获取到的若干段历史对话数据,对第二意图识别模型进行预训练。具体的,服务器可通过占位符随机替换各历史对话数据中至少部分用户回复,得到各预训练样本,并将被替换的各用户回复作为各预训练样本对应的对话标注,从而后续可通过待训练的第二意图识别模型对被替换的用户回复根据其他对话数据进行预测,学习到联系上下文进行推断的能力。其中,替换各历史对话数据中至少部分用户回复可以是指将多轮对话中部分对话的用户回复屏蔽(mask)。
得到各预训练样本以及对应的对话标注后,服务器可根据各预训练样本以及对话标注,先对待训练的第二意图识别模型进行预训练。
其中,第二意图识别模型可以是BERT模型,该BERT模型可以是经过预先训练的通用的语言表征模型,以此减少训练量。此外,考虑到在模型应用过程中,需要模型根据运算结果实时地进行反馈,因此,可采用层数较少的BERT模型,以提高运算效率,节省运算时间,如,可采用6层的BERT模型。当然了,具体采用何种模型,可根据需要确定,本说明书对此不做限制。
具体的,服务器可将预训练样本输入到待训练的第二意图识别模型的输入层,通过第二意图识别模型的第一输出层,确定被替换的各用户回复对应的预测语句,即,通过第二意图识别模型基于未被替换的对话数据与被替换的用户回复对应的问题之间的关系,根据被抽取的用户回复的字数,逐字或逐词的对被遮盖的用户回复进行预测,确定预测语句。
于是,服务器可根据各预训练样本对应的预测语句与对话标注之间的差异,确定损失,并以该损失最小为优化目标,预训练第二意图识别模型,直至达到训练结束条件为止,确定预训练得到的第二意图识别模型,使得第二意图识别模型可学习到联系上下文进行推断的能力。
其中,预测语句与标注答案的差异具体采用何种方式体现,可根据需要确定,本说明书对此不做限制。例如,可以通过编辑距离(Levenshtein,LEV),或最长公共子序列(Longest Common Subsequence,LCS)长度等方式,计算该预测语句与该标注答案之间的相似度,相似度越高则差异越小。预训练结束条件可根据需要设置,本说明书对此不做限制。
通过大量的预训练样本进行预训练后,该第二意图识别模型即可掌握语句级别的联系上下文进行推断的能力。
S102:针对每个训练样本,通过训练完成的第一意图识别模型,分别确定该训练样本中各轮对话的用户意图,作为该训练样本的第一标注。
S104:根据该训练样本,确定用户执行的与该训练样本对应的前序业务,以确定用户执行的与所述前序业务对应的后续业务,并基于所述后续业务对应的对话数据确定反馈意图,作为该训练样本对应的第二标注。
获取到训练样本后,在本说明书一个或多个实施例中,服务器可进一步根据各训练样本、各训练样本对应的历史意图识别信息以及用户已进行的反馈行为,对该第二意图识别模型进行训练。
于是,对于各训练样本对应的历史意图识别信息,服务器可针对每个训练样本,通过训练完成的第一意图识别模型,分别确定该训练样本中各轮对话的用户意图,作为该训练样本的第一标注。
其中,第一意图识别模型可以是历史对话发生时,服务器所采用的意图识别模型,服务器可针对每个训练样本,先将该训练样本对应的历史对话数据中各轮对话分别输入训练完成的第一意图识别模型,分别确定各轮对话对应的用户意图,然后,根据各轮对话对应的用户意图,确定该训练样本对应的第一标注。各轮对话的用户意图是指对应每轮对话识别得到的所有意图,可以包含一个或多个意图。
例如,假设该训练样本对应的历史对话数据中包含3轮对话数据,则服务器可分别将每轮对话数据输入第一意图识别模型,通过第一意图识别模型分别确定每轮对话数据对应的用户意图,然后将3轮对话数据各自得到的用户意图作为该训练样本对应的历史对话数据的各用户意图。
具体第一意图识别模型如何根据对话数据确定用户意图,可根据需要确定,本说明书对此不做限制。例如,第一意图识别模型可根据用户回复进行命名实体识别,从而可根据用户回复,抽取出用户回复对应的意图信息。假设对于某历史对话数据,服务器在对话时,提出问句“请问你是在买什么商品”,对应的用户回复为“我在买家具”,则服务器可通过第一意图识别模型根据用户回复“我在买家具”抽取出对应该用户的(交易目的:家具)此类的意图信息。以上以一轮对话包含一个意图为例进行说明,但是,本说明书对具体每轮对话识别得到的意图数量不做限制。
当然了,还可以进一步对抽取得到的实体进一步分类,从而确定更进一步的用户意图,如,可将家具划分为实体类、虚拟类、有风险类、无风险类,于是,服务器可通过第一意图识别模型根据用户回复“我在买家具”抽取出对应该用户的(交易目的:实体 无风险)此类的意图信息。以上仅为举例说明,本说明书对意图具体以何种方式体现不做限制。
此外,在本说明书一个或多个实施例中,服务器通过第一意图识别模型确定各训练样本的意图标注之外,服务器还可将历史对话发生时,该第一意图识别模型在历史时刻识别得到的各用户意图与历史对话对应存储,则服务器后续可直接获取存储的各训练样本对应的历史对话数据的各用户意图,作为各训练样本的意图标注。
对于用户已进行的反馈行为,服务器可先根据该训练样本,确定用户执行的与该训练样本,即该历史对话数据对应的前序业务,如,用户执行下单业务后,服务器可以通过外呼等方式,主动与用户取得联系,确定该下单业务的风险,在此过程中,服务器可存储本次对话对应的历史对话数据,该下单业务即为产生该历史对话数据的前序业务。
然后,服务器可根据该前序业务,确定用户执行的与该前序业务对应的后续业务。所说的后续业务可以是用户基于该前序业务执行的其他业务,在本说明书一个或多个实施例中,该后续业务可以是投诉业务。则服务器可根据该投诉业务对应的对话数据,确定该对话数据对应的用户意图,作为该训练样本对应的反馈意图,并将该反馈意图作为该训练样本对应的第二标注。
当然了,在本说明书一个或多个实施例中,后续业务还可以是评价业务或退货业务等用户基于该前序业务执行的其他业务,以评价业务为例,服务器可根据该评价业务对应的对话数据,确定该对话数据对应的用户意图,作为该训练样本对应的反馈意图,并将该反馈意图作为该训练样本对应的第二标注。后续业务为退货业务等其他业务与此同理,此处不再意义赘述。
假设用户因为受到诈骗导致该笔订单未能正常完成,用户对该笔订单发起投诉,投诉内容为“我在线上向线上认识的张三购买电脑,被张三诈骗”,则该投诉内容对应的用户意图可为(交易方式:线上)、(交易对象:张三)、(交易目的:贵重物品有风险)、(诈骗:确认)等。于是,可将该投诉内容对应的用户意图,作为该训练样本对应的投诉意图,从而作为该训练样本对应的第二标注。以上仅为举例说明,本说明书对负投诉反馈意图具体以何种方式体现不做限制。
当然,用户对于正常完成的业务通常不会执行对应的投诉业务,此时,该训练样本对应的第二标注为空,可认为第一意图识别模型识别得到的作为第一标注的用户意图为可信的,而用户因为受到诈骗等原因导致对未能正常执行的业务执行投诉业务后,可基于投诉内容识别得到作为第二标注的投诉意图,这种情况下,可认为第一意图识别模型识别得到的用户意图与投诉意图共同反映了用户的真实意图,该用户意图与该投诉意图的组合是可信的。后续可通过第一标注以及第二标注确定可信的第一风险识别结果,对待训练的意图识别模型进行训练。
S106:根据该训练样本对应的第一标注以及第二标注,确定该训练样本对应的第一风险识别结果。
S108:将该训练样本输入待训练的第二意图识别模型,确定该训练样本对应的各预测意图以及第二风险识别结果。
通过上述确定训练样本对应的第一标注以及第二标注后,在本说明书一个或多个实施例中,服务器可先根据该训练样本对应的第一标注以及第二标注,确定该训练样本对应的第一风险识别结果,从而进一步根据该第一风险识别结果,对待训练的第二意图识别模型进行训练。
具体的,服务器可预先确定存在风险的各风险意图组合,如,意图组合(交易方式:线上个人、交易目的:贵重物品)可作为存在风险的的风险意图组合。当然了,风险意图组合并不限制意图组合中意图的个数,如,(交易目的:虚拟物品有风险)可作为存在风险的风险意图组合,该组合中可仅有这一个意图。
然后,服务器可根据各风险意图组合,判断该训练样本对应的第一标注以及第二标 注的组合,是否与任一风险意图组合匹配,若是,则确定该训练样本对应的第一风险识别结果为存在风险,若否,则确定该训练样本对应的第一风险识别结果为不存在风险。
其中,第二标注可视为对第一标注的补充,通常,由第一意图识别模型的确定的意图标注可能并不完全准确,例如,当用户处于被欺骗状态而不能完全配合服务器对话了解情况时,用户可能会给出虚假的回答,则第一意图识别模型会根据用户虚假的回答,识别得到用户的虚假意图。而当用户在脱离被欺骗状态后,可能会向服务器基于产生对应的历史对话数据的用户执行的前序业务,执行后续业务,如投诉业务。以投诉业务为例,则服务器可进一步根据用户执行的投诉业务的对话数据,确定该对话数据对应的用户意图,从而确定该训练样本对应的第二标注。并以第二标注对第一标注进行补充,使得第二标注对第一标注能够真实反映该训练样本对应的用户意图。则服务器可根据该训练样本对应的意图标注和投诉反馈意图,确定可信的第一风险识别结果,并根据该第一风险识别结果对第二意图识别模型进行训练。
假设该训练样本对应的第一标注和第二标注的组合为(交易方式:线上个人、交易目的:虚拟物品有风险),则以前述的风险意图组合为例,该训练样本对应的第一风险识别结果为存在风险。假设该训练样本对应的第一标注和第二标注的组合为(交易方式:线下门店、交易目的:实物),则还以上述的风险意图组合为例,该训练样本对应的第一风险识别结果为不存在风险。
在确定第一风险识别结果后,用户可将该训练样本输入待训练的意图识别模型,通过联系多轮对话上下文综合用户回复以及多轮对话之间的联系,确定该训练样本对应的各预测意图以及第二风险识别结果。
在得到该训练样本对应的各预测意图后,服务器可根据各预测意图,确定第二风险识别结果,后续可根据第一风险识别结果,对第二意图识别模型进行训练。
具体的,服务器可据预设的存在风险的各风险意图组合,判断该训练样本对应的各预测意图的组合,是否与任一风险意图组合匹配,若是,则确定该训练样本对应的第二风险识别结果为存在风险,若否,则确定该训练样本对应的第二风险识别结果为不存在风险。具体过程与确定第一风险识别结果的过程同理,可参考前述对应说明。
当然了,在本说明书一个或多个实施例中,若第二意图识别模型在步骤S108之前经过了步骤S100中所说的预训练过程,则服务器可将预训练得到的第二意图识别模型的第一输出层替换为第二输出层,该第二输出层设置为用于根据训练样本输出预测意图。
然后服务器可将该训练样本输入预训练得到的第二意图识别模型的输入层,通过该第二输出层,得到该训练样本对应的各预测意图。
此时,对于预训练后的意图识别模型,在根据输入的训练样本确定该训练样本对应的用户意图时,并非仅根据用户回复进行客观意图识别,经过了联系上下文进行推断的预训练后,该预训练后的意图识别模型可综合用户回复以及多轮对话之间的联系进行意图识别,从而识别得到更准确的各预测意图。通过预训练,提高了第二意图识别模型的训练效率。
S110:根据各训练样本第一风险识别结果与第二风险识别结果之间的差异,确定损失,并以所述损失最小为优化目标对所述待训练的第二意图识别模型进行训练。
通过上述确定训练样本对应的第一意图识别结果以及第二风险识别结果后,服务器可根据各训练样本第一意图识别结果与第二风险识别结果之间的差异,确定损失,并以该损失最小为优化目标,对待训练的第二意图识别模型进行训练。
具体如何采用何种算法确定损失,可根据需要确定,本说明书对此不做限制。例如,以风险识别结果存在风险为1,不存在风险为0,可根据各各训练样本第一风险识别结果与第二风险识别结果之间的差的平方和,确定损失。
通过不断的迭代训练后,可使得该意图识别模型能够在迭代训练过程中,不断的提高预测意图的准确度,从而提高风险识别准确度。
基于图1所示的意图识别模型训练方法,先确定包含多轮对话的历史对话数据作为训练样本,通过第一意图识别模型确定每个训练样本各轮对话的用户意图,并基于用户执行的与该训练样本对应的业务确定反馈意图,然后根据该训练样本的用户意图以及反馈意图确定第一风险识别结果,并通过第二意图识别模型确定该训练样本的各预测意图以及第二风险识别结果,最后以各训练样本第一风险识别结果与第二风险识别结果之间的差异最小为优化目标对第二意图识别模型进行训练。通过结合反馈意图以及由第一意图识别模型确定的用户意图,得到准确的风险识别结果,以对第二意图识别模型进行训练,提高了第二意图识别模型的风险识别能力。
基于图1提供的意图识别模型的训练方法,本说明书还提供一种用户意图识别方法,如图2所示。
图2为本说明书中一种用户意图识别流程示意图,具体包括以下步骤:S200:获取用户当前已进行的各轮次对话数据。
一般的,业务平台的服务器可采用外呼或主动发起对话聊天等方式,通过多轮对话来完成与用户的沟通交流,从而及时发现用户的操作风险,进行风控。
于是,在本说明书一个或多个实施例中,业务平台的服务器可获取用户当前已进行的各轮次对话数据,从而基于已进行的各轮次对话数据,识别用户意图,对识别结果确认为存在风险的情况进行提示。
其中,当前已进行的各轮次对话数据,可包括截止到当前时刻,已完成的各轮对话中,各轮对话服务器所提出的问题以及对应的用户回复。当然了,对于服务器所提出的问题,可根据预先对问题模板的编码,只保存服务器所提出的问题模板对应的编码,则各轮次对话数据可包含各轮对话服务器所提出的问题模板的编码以及对应的用户回复。模板问题的具体内容可参考步骤S100中的相应说明,此处不再赘述。
本说明书中提到的服务器可以是设置于业务平台的服务器,或能够执行本说明书方案的诸如台式机、笔记本电脑等设备。为了方便说明,下面仅以服务器为执行主体进行说明。
S202:将当前轮次的对话数据输入第一意图识别模型,确定所述用户当前轮次的对话数据对应的第一意图。
S204:根据已进行的各轮次对话数据对应的第一意图,确定所述对话数据对应的风险识别结果。
S206:当根据所述风险识别结果确定不存在风险时,将当前已进行的指定轮次对话数据输入第二意图识别模型,确定所述输入的对话数据对应的各第二意图。
在完成第二意图识别模型的训练后,即可在风控场景使用经本说明书提供的意图识别模型训练方法训练后的第二意图识别模型。
当然了,服务器可先使用第一意图识别模型,将当前轮次的对话数据输入第一意图识别模型,确定用户当前轮次的对话数据对应的第一意图。其中,第一意图是指对应当前轮次的对话数据识别得到的所有意图,可以包含一个或多个意图。
然后,服务器可根据已确定出的各第一意图,确定已进行的各轮对话数据对应的第一风险识别结果。具体的,服务器可逐轮保存第一意图识别模型确定得到的每轮对话数据对应的各第一意图,然后根据预设的存在风险的各风险意图组合,判断已进行的各轮次对话数据对应的第一意图的组合,即,已保存的各第一意图和当前轮次的对话数据对应的第一意图的组合,是否与任一风险意图组合匹配,若是,则确定当前轮次的对话数据对应的第一风险识别结果为存在风险,若否,则确定当前轮次的对话数据对应的第一风险识别结果为不存在风险。风险意图组合的具体内容,可参考前述步骤S106中的相应描述,此处不再赘述。当然,对于每轮对话来说,当前轮次下确定的第一风险识别结果,都是加入了当前轮次的对话数据对应的第一意图后识别得到的结果,因此,当前轮次下确定的第一风险识别结果也可以说是对应于当前轮次的对话数据。
当确定该第一意图存在风险时,服务器可直接确定风险,并提示用户本次对话对应的用户执行的前序业务存在风险。具体前序业务的内容可参考前述步骤S106中的相应说明,此处不再赘述。
当确定该第一意图不存在风险时,往往存在两种可能性,其中一种可能是用户的操作为正常操作,确实不存在风险,另一种可能是用户受到欺骗,不能完全配合业务平台的服务器发起的对话,即用户针对服务器的问题选择隐瞒性的说谎,给出了虚假的回答,而第一意图识别模型根据用户的虚假回答,识别得到了虚假意图。
此时,服务器可将当前已进行的指定轮次对话数据输入第二意图识别模型,确定所输入的对话数据对应的各第二意图。其中,指定轮次可以根据需要,或模型输入参数的设置而确定,本说明书对此不做限制。当然,即使已进行的对话轮数小于指定轮数,服务器也可将已进行的各轮次对话数据输入第二意图识别模型。此外,指定轮数可以是在已进行的对话轮数较多的情况下,选择部分输入第二意图识别模型。当然了,这里的指定轮数还可以是指每次输入第二意图识别模型的轮数,此时,即使已进行的对话轮数大于指定轮数,服务器也可将以进行的各轮次对话数据分批输入第二意图识别模型。当然了,通常输入的对话数据轮次越多,则模型进行意图识别的准确度越高,相对应的,模型运行所需的时间越长,将识别结果进行反馈的时效性越差。
这里的第二意图识别模型通过以若干段历史对话数据作为训练样本,根据由各训练样本对应的反馈意图以及所述第一意图识别模型确定出的用户意图确定出的第一风险识别结果、所述第二意图识别模型确定出的各预测意图以及第二风险识别结果,进行训练得到。第二意图识别模型具体可基于前述提供的任一意图识别模型的训练方法训练得到。
S208:判断已进行的指定轮次对话数据对应的第一意图与各第二意图之间是否存在差异,若是,则执行步骤S210。
S210:确定存在用户虚假意图引起的风险,提示所述用户存在风险。
通过上述确定各第一意图以及各第二意图后,在本说明书一个或多个实施例中,服务器可根据各第一意图以及各第二意图,判断各第一意图以及各第二意图之间是否存在差异。
具体的,服务器可根据已确定的与各第二意图对应的各第一意图和各第二意图,判断各第一意图与各第二意图之间是否存在差异。若存在差异,则说明用户可能在当前轮次的对话中给出的用户回复与已进行的对话轮次数据中所显示的信息存在冲突,用户可能在当前轮次的对话中给出了虚假的用户回复,则用户可能处于被欺骗的状态,本次对话对应的用户执行的业务可能存在用户虚假意图引起的风险,服务器可及时对用户做出提示。若不存在差异,则说明用户在整个对话过程中,表现的前后较为一致,所有已进行的对话轮次中所显示的信息不存在冲突,则可继续进行下一轮对话,直至完成整个对话过程。
此外,在本说明书一个或多个实施例中,步骤S206中,服务器将当前已进行的指定轮次对话数据输入第二意图识别模型,确定所述输入的对话数据对应的各第二意图时,由于第二意图识别模型是根据用户的多轮对话数据进行意图识别,因此,若已进行的对话轮次较少时,可能难以得到较为准确的识别结果,于是,服务器还可根据预设对话轮次数量,判断当前对话轮次是否小于该对话轮次数量,若是,则继续下轮对话直至对话轮次达到预设对话轮次数量,若否,则说明已有足够的对话数据,则服务器可将当前已进行的指定轮次对话数据输入第二意图识别模型,确定用户当前轮次的对话数据对应的各第二意图。确定各第二意图的具体内容可参考前述相应说明,此处不在赘述。
另外,在本说明书一个或多个实施例中,步骤S206中,服务器将当前已进行的指定轮次对话数据输入第二意图识别模型,确定所述用户当前轮次的对话数据对应的各第二意图时,服务器还可根据对话数据的长度,确定指定轮次。此时,服务器可根据已进行 的对话数据的长度,将已进行的对话数据分批输入第二意图识别模型,每次输出第二意图识别模型中的对话数据的轮次数量可以不同,使得输入对话数据时更加灵活。
另外,在本说明书一个或多个实施例中,步骤S208中,服务器判断已进行的指定轮次对话数据对应的第一意图与各第二意图之间是否存在差异时,可先根据预设的各风险意图组合,判断各第二意图的组合,是否与任一风险意图组合匹配,若是,则确定存在用户虚假意图引起的风险,提示所述用户存在风险,若否,则判断已进行的指定轮次对话数据对应的第一意图与各第二意图之间是否存在差异。即,先根据已确定的各第二意图进行二次判断,确定是否与确定得到的第一风险识别结果一致,若一致,则进一步判断,若不一致,则说明用户可能处于被欺骗的状态,本次对话对应的用户执行的业务可能存在用户虚假意图引起的风险,服务器可及时对用户做出提示。
以上为本说明书的一个或多个实施例提供的意图识别模型的训练方法,基于同样的思路,本说明书还提供了相应的意图识别模型的训练装置,如图3所示。
图3为本说明书提供的一种意图识别模型的训练装置示意图,包括:训练样本确定模块300,用于根据历史对话数据,确定各训练样本,所述训练样本包含多轮对话;第一标注确定模块302,用于针对每个训练样本,通过训练完成的第一意图识别模型,分别确定该训练样本中各轮对话的用户意图,作为该训练样本的第一标注;第二标注确定模块304,用于根据该训练样本,确定用户执行的与该训练样本对应的前序业务,以确定用户执行的与所述前序业务对应的后续业务,并基于所述后续业务对应的对话数据确定反馈意图,作为该训练样本对应的第二标注;第一风险识别模块306,用于根据该训练样本对应的第一标注以及第二标注,确定该训练样本对应的第一风险识别结果;第二风险识别模块308,用于将该训练样本输入待训练的第二意图识别模型,确定该训练样本对应的各预测意图以及第二风险识别结果;训练模块310,用于根据各训练样本第一风险识别结果与第二风险识别结果之间的差异,确定损失,并以所述损失最小为优化目标对所述待训练的第二意图识别模型进行训练,所述第二意图识别模型用于与所述第一意图识别模型共同识别对话中由用户虚假意图引起的风险。
可选地,所述装置还包括:预训练模块312,用于通过采用占位符替换训练样本的各轮对话中至少部分用户回复,得到各预训练样本,根据被替换的用户回复,确定各预训练样本的对话标注,将各预训练样本输入待训练的第二意图识别模型的输入层,通过所述第二意图识别模型的第一输出层,确定被替换的各用户回复对应的预测语句,以各预训练样本对应的预测语句与对话标注差异最小为优化目标,对所述待训练的第二意图识别模型进行预训练,直至达到训练结束条件为止,确定预训练得到的第二意图识别模型。
可选地,所述第二风险识别模块308,将所述预训练得到的第二意图识别模型的第一输出层替换为第二输出层,所述第二输出层设置为用于输出预测意图,将该训练样本输入所述预训练得到的第二意图识别模型的输入层,通过所述第二输出层,得到该训练样本对应的各预测意图。
可选地,所述第二标注确定模块304,根据该训练样本对应的历史对话数据,确定产生所述历史对话数据的前序业务,根据所述前序业务,确定用户执行的与所述前序业务对应的投诉业务,根据确定出的投诉业务对应的对话数据,确定所述对话数据对应的用户意图,作为该训练样本对应的反馈意图。
可选地,所述第一风险识别模块306,根据预设的各风险意图组合,判断该训练样本对应的第一标注与第二标注的组合,是否与任一风险意图组合匹配,若是,则确定该训练样本对应的第一风险识别结果为存在风险,若否,则确定该训练样本对应的第一风险识别结果为不存在风险。
可选地,所述第二风险识别模块308,据预设的各风险意图组合,判断该训练样本对应的各预测意图的组合,是否与任一风险意图组合匹配,若是,则确定该训练样本对 应的第二风险识别结果为存在风险,若否,则确定该训练样本对应的第二风险识别结果为不存在风险。
基于本说明书的一个或多个实施例提供的用户意图识别方法,本说明书还提供了相应的用户意图识别装置,如图4所示。
图4为本说明书提供的一种用户意图识别装置示意图,包括:获取模块400,用于获取用户当前已进行的各轮次对话数据;第一意图确定模块402,用于将当前轮次的对话数据输入第一意图识别模型,确定所述用户当前轮次的对话数据对应的第一意图;
第一风险确定模块404,用于根据已进行的各轮次对话数据对应的第一意图,确定所述对话数据对应的风险识别结果;第二意图确定模块406,用于当根据所述风险识别结果确定不存在风险时,将当前已进行的指定轮次对话数据输入第二意图识别模型,确定所述输入的对话数据对应的各第二意图;第二风险确定模块408,用于判断已进行的指定轮次对话数据对应的第一意图与各第二意图之间是否存在差异,若是,则确定存在用户虚假意图引起的风险,提示所述用户存在风险。
可选地,所述第二风险确定模块408,根据预设的各风险意图组合,判断各第二意图的组合,是否与任一风险意图组合匹配,若是,则确定存在用户虚假意图引起的风险,提示所述用户存在风险,若否,则判断已进行的指定轮次对话数据对应的第一意图与各第二意图之间是否存在差异。
可选地,所述第一风险确定模块404,根据预设的各风险意图组合,判断已进行的各轮次对话数据对应的第一意图的组合,是否与任一风险意图组合匹配,若是,则确定所述对话数据对应的风险识别结果为存在风险,若否,则确定所述对话数据对应的风险识别结果为不存在风险。
本说明书还提供了一种计算机可读存储介质,该存储介质存储有计算机程序,计算机程序可用于执行上述图1提供的意图识别模型的训练方法或图2提供的用户意图识别方法。
本说明书还提供了图5所示的电子设备的结构示意图。如图5所述,在硬件层面,该电子设备包括处理器、内部总线、网络接口、内存以及非易失性存储器,当然还可能包括其他业务所需要的硬件。处理器从非易失性存储器中读取对应的计算机程序到内存中然后运行,以实现上述图1提供的意图识别模型的训练方法或图2提供的用户意图识别方法。
当然,除了软件实现方式之外,本说明书并不排除其他实现方式,比如逻辑器件异或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University  Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本说明书时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或 非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
本领域技术人员应明白,本说明书的实施例可提供为方法、系统或计算机程序产品。因此,本说明书可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本说明书可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本说明书的实施例而已,并不用于限制本说明书。对于本领域技术人员来说,本说明书可以有各种更改和变化。凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本说明书的权利要求范围之内。

Claims (13)

  1. 一种意图识别模型的训练方法,所述方法包括:
    根据历史对话数据,确定各训练样本,所述训练样本包含多轮对话;
    针对每个训练样本,通过训练完成的第一意图识别模型,分别确定该训练样本中各轮对话的用户意图,作为该训练样本的第一标注;
    根据该训练样本,确定用户执行的与该训练样本对应的前序业务,以确定用户执行的与所述前序业务对应的后续业务,并基于所述后续业务对应的对话数据确定反馈意图,作为该训练样本对应的第二标注;
    根据该训练样本对应的第一标注以及第二标注,确定该训练样本对应的第一风险识别结果;
    将该训练样本输入待训练的第二意图识别模型,确定该训练样本对应的各预测意图以及第二风险识别结果;
    根据各训练样本第一风险识别结果与第二风险识别结果之间的差异,确定损失,并以所述损失最小为优化目标对所述待训练的第二意图识别模型进行训练,所述第二意图识别模型用于与所述第一意图识别模型共同识别对话中由用户虚假意图引起的风险。
  2. 如权利要求1所述的方法,将该训练样本输入待训练的第二意图识别模型,确定该训练样本对应的各预测意图以及第二风险识别结果之前,所述方法还包括:
    通过采用占位符替换训练样本的各轮对话中至少部分用户回复,得到各预训练样本,根据被替换的用户回复,确定各预训练样本的对话标注;
    将各预训练样本输入待训练的第二意图识别模型的输入层,通过所述第二意图识别模型的第一输出层,确定被替换的各用户回复对应的预测语句;
    以各预训练样本对应的预测语句与对话标注差异最小为优化目标,对所述待训练的第二意图识别模型进行预训练,直至达到训练结束条件为止,确定预训练得到的第二意图识别模型。
  3. 如权利要求2所述的方法,将该训练样本输入待训练的第二意图识别模型,确定该训练样本对应的各预测意图,具体包括:
    将所述预训练得到的第二意图识别模型的第一输出层替换为第二输出层,所述第二输出层设置为用于输出预测意图;
    将该训练样本输入所述预训练得到的第二意图识别模型的输入层,通过所述第二输出层,得到该训练样本对应的各预测意图。
  4. 如权利要求1所述的方法,确定用户执行的与该训练样本对应的前序业务,确定用户执行的与所述前序业务对应的后续业务,并基于所述后续业务对应的对话数据确定反馈意图,具体包括:
    根据该训练样本对应的历史对话数据,确定产生所述历史对话数据的前序业务;
    根据所述前序业务,确定用户执行的与所述前序业务对应的投诉业务;
    根据确定出的投诉业务对应的对话数据,确定所述对话数据对应的用户意图,作为该训练样本对应的反馈意图。
  5. 如权利要求1所述的方法,根据该训练样本对应的第一标注以及第二标注,确定该训练样本对应的第一风险识别结果,具体包括:
    根据预设的各风险意图组合,判断该训练样本对应的第一标注与第二标注的组合,是否与任一风险意图组合匹配;
    若是,则确定该训练样本对应的第一风险识别结果为存在风险;
    若否,则确定该训练样本对应的第一风险识别结果为不存在风险。
  6. 如权利要求1所述的方法,确定该训练样本对应的第二风险识别结果,具体包括:
    据预设的各风险意图组合,判断该训练样本对应的各预测意图的组合,是否与任一风险意图组合匹配;
    若是,则确定该训练样本对应的第二风险识别结果为存在风险;
    若否,则确定该训练样本对应的第二风险识别结果为不存在风险。
  7. 一种用户意图识别方法,所述方法包括:
    获取用户当前已进行的各轮次对话数据;
    将当前轮次的对话数据输入第一意图识别模型,确定所述用户当前轮次的对话数据对应的第一意图;
    根据已进行的各轮次对话数据对应的第一意图,确定所述对话数据对应的风险识别结果;
    当根据所述风险识别结果确定不存在风险时,将当前已进行的指定轮次对话数据输入第二意图识别模型,确定所述输入的对话数据对应的各第二意图;
    判断已进行的指定轮次对话数据对应的第一意图与各第二意图之间是否存在差异;
    若是,则确定存在用户虚假意图引起的风险,提示所述用户存在风险;
    其中,所述第二意图识别模型通过以若干段历史对话数据作为训练样本,根据由各训练样本对应的反馈意图以及所述第一意图识别模型确定出的用户意图确定出的第一风险识别结果、所述第二意图识别模型确定出的各预测意图以及第二风险识别结果,进行训练得到。
  8. 如权利要求7所述的方法,判断已进行的指定轮次对话数据对应的第一意图与各第二意图之间是否存在差异,具体包括:
    根据预设的各风险意图组合,判断各第二意图的组合,是否与任一风险意图组合匹配;
    若是,则确定存在用户虚假意图引起的风险,提示所述用户存在风险;
    若否,则判断已进行的指定轮次对话数据对应的第一意图与各第二意图之间是否存在差异。
  9. 如权利要求7所述的方法,根据已进行的各轮次对话数据对应的第一意图,确定所述对话数据对应的风险识别结果,具体包括:
    根据预设的各风险意图组合,判断已进行的各轮次对话数据对应的第一意图的组合,是否与任一风险意图组合匹配;
    若是,则确定所述对话数据对应的风险识别结果为存在风险;
    若否,则确定所述对话数据对应的风险识别结果为不存在风险。
  10. 一种意图识别模型的训练装置,所述装置包括:
    训练样本确定模块,用于根据历史对话数据,确定各训练样本,所述训练样本包含多轮对话;
    第一标注确定模块,用于针对每个训练样本,通过训练完成的第一意图识别模型,分别确定该训练样本中各轮对话的用户意图,作为该训练样本的第一标注;
    第二标注确定模块,用于根据该训练样本,确定用户执行的与该训练样本对应的前序业务,以确定用户执行的与所述前序业务对应的后续业务,并基于所述后续业务对应的对话数据确定反馈意图,作为该训练样本对应的第二标注;
    第一风险识别模块,用于根据该训练样本对应的第一标注以及第二标注,确定该训练样本对应的第一风险识别结果;
    第二风险识别模块,用于将该训练样本输入待训练的第二意图识别模型,确定该训练样本对应的各预测意图以及第二风险识别结果;
    训练模块,用于根据各训练样本第一风险识别结果与第二风险识别结果之间的差异,确定损失,并以所述损失最小为优化目标对所述待训练的第二意图识别模型进行训练,所述第二意图识别模型用于与所述第一意图识别模型共同识别对话中由用户虚假意图 引起的风险。
  11. 一种用户意图识别装置,所述装置包括:
    获取模块,用于获取用户当前已进行的各轮次对话数据;
    第一意图确定模块,用于将当前轮次的对话数据输入第一意图识别模型,确定所述用户当前轮次的对话数据对应的第一意图;
    第一风险确定模块,用于根据已进行的各轮次对话数据对应的第一意图,确定所述对话数据对应的风险识别结果;
    第二意图确定模块,用于当根据所述风险识别结果确定不存在风险时,将当前已进行的指定轮次对话数据输入第二意图识别模型,确定所述输入的对话数据对应的各第二意图;
    第二风险确定模块,用于判断已进行的指定轮次对话数据对应的第一意图与各第二意图之间是否存在差异;若是,则确定存在用户虚假意图引起的风险,提示所述用户存在风险。
  12. 一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述权利要求1~9任一项所述的方法。
  13. 一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述权利要求1~9任一项所述的方法。
PCT/CN2023/095201 2022-06-22 2023-05-19 意图识别模型训练及用户意图识别 WO2023246393A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210713723.0A CN115033676B (zh) 2022-06-22 2022-06-22 一种意图识别模型训练及用户意图识别方法及装置
CN202210713723.0 2022-06-22

Publications (1)

Publication Number Publication Date
WO2023246393A1 true WO2023246393A1 (zh) 2023-12-28

Family

ID=83127206

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/095201 WO2023246393A1 (zh) 2022-06-22 2023-05-19 意图识别模型训练及用户意图识别

Country Status (2)

Country Link
CN (1) CN115033676B (zh)
WO (1) WO2023246393A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117666971A (zh) * 2024-01-31 2024-03-08 之江实验室 一种工业领域的数据存储方法、装置及设备
CN117786417A (zh) * 2024-02-28 2024-03-29 之江实验室 一种模型训练方法、瞬变源的识别方法、装置及电子设备

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115033676B (zh) * 2022-06-22 2024-04-26 支付宝(杭州)信息技术有限公司 一种意图识别模型训练及用户意图识别方法及装置
CN115471840B (zh) * 2022-11-03 2023-04-18 北京百度网讯科技有限公司 生成、模型的训练、识别方法、装置、电子设备及介质
CN115759122A (zh) * 2022-11-03 2023-03-07 支付宝(杭州)信息技术有限公司 一种意图识别方法、装置、设备及可读存储介质
CN115545938B (zh) * 2022-11-29 2023-03-28 支付宝(杭州)信息技术有限公司 一种执行风险识别业务的方法、装置、存储介质及设备
CN115599891B (zh) * 2022-11-29 2023-03-21 支付宝(杭州)信息技术有限公司 一种确定异常对话数据方法、装置、设备及可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10616411B1 (en) * 2017-08-21 2020-04-07 Wells Fargo Bank, N.A. System and method for intelligent call interception and fraud detecting audio assistant
CN111553701A (zh) * 2020-05-14 2020-08-18 支付宝(杭州)信息技术有限公司 一种基于会话的风险交易确定方法和装置
CN112612894A (zh) * 2020-12-29 2021-04-06 平安科技(深圳)有限公司 意图识别模型的训练方法、装置、计算机设备和存储介质
CN112988991A (zh) * 2021-02-04 2021-06-18 支付宝(杭州)信息技术有限公司 一种通过人机对话进行反欺诈干预的方法和系统
CN115033676A (zh) * 2022-06-22 2022-09-09 支付宝(杭州)信息技术有限公司 一种意图识别模型训练及用户意图识别方法及装置

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112363507A (zh) * 2015-09-08 2021-02-12 苹果公司 意图识别
US11120353B2 (en) * 2016-08-16 2021-09-14 Toyota Jidosha Kabushiki Kaisha Efficient driver action prediction system based on temporal fusion of sensor data using deep (bidirectional) recurrent neural network
CN109784599A (zh) * 2017-11-14 2019-05-21 阿里巴巴集团控股有限公司 一种模型训练、风险识别的方法、装置及设备
CN108427722A (zh) * 2018-02-09 2018-08-21 卫盈联信息技术(深圳)有限公司 智能交互方法、电子装置及存储介质
CN110555095B (zh) * 2018-05-31 2024-04-16 北京京东尚科信息技术有限公司 人机对话方法和装置
CN109829153A (zh) * 2019-01-04 2019-05-31 平安科技(深圳)有限公司 基于卷积神经网络的意图识别方法、装置、设备及介质
CN111831799A (zh) * 2019-04-23 2020-10-27 北京京东尚科信息技术有限公司 信息处理方法、信息处理装置和信息处理系统
CN110457449B (zh) * 2019-07-05 2023-07-11 创新先进技术有限公司 在线训练模型的方法、装置、设备及存储介质
CN111191016B (zh) * 2019-12-27 2023-06-02 车智互联(北京)科技有限公司 一种多轮对话处理方法、装置及计算设备
CN111696535B (zh) * 2020-05-22 2021-10-26 百度在线网络技术(北京)有限公司 基于语音交互的信息核实方法、装置、设备和计算机存储介质
CN113407689A (zh) * 2021-06-15 2021-09-17 北京三快在线科技有限公司 一种模型训练和业务执行的方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10616411B1 (en) * 2017-08-21 2020-04-07 Wells Fargo Bank, N.A. System and method for intelligent call interception and fraud detecting audio assistant
CN111553701A (zh) * 2020-05-14 2020-08-18 支付宝(杭州)信息技术有限公司 一种基于会话的风险交易确定方法和装置
CN112612894A (zh) * 2020-12-29 2021-04-06 平安科技(深圳)有限公司 意图识别模型的训练方法、装置、计算机设备和存储介质
CN112988991A (zh) * 2021-02-04 2021-06-18 支付宝(杭州)信息技术有限公司 一种通过人机对话进行反欺诈干预的方法和系统
CN115033676A (zh) * 2022-06-22 2022-09-09 支付宝(杭州)信息技术有限公司 一种意图识别模型训练及用户意图识别方法及装置

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117666971A (zh) * 2024-01-31 2024-03-08 之江实验室 一种工业领域的数据存储方法、装置及设备
CN117666971B (zh) * 2024-01-31 2024-04-30 之江实验室 一种工业领域的数据存储方法、装置及设备
CN117786417A (zh) * 2024-02-28 2024-03-29 之江实验室 一种模型训练方法、瞬变源的识别方法、装置及电子设备
CN117786417B (zh) * 2024-02-28 2024-05-10 之江实验室 一种模型训练方法、瞬变源的识别方法、装置及电子设备

Also Published As

Publication number Publication date
CN115033676B (zh) 2024-04-26
CN115033676A (zh) 2022-09-09

Similar Documents

Publication Publication Date Title
WO2023246393A1 (zh) 意图识别模型训练及用户意图识别
KR102625761B1 (ko) 사용자 프로그래머블 자동화 어시스턴트
CN112632961B (zh) 基于上下文推理的自然语言理解处理方法、装置以及设备
CN107437416A (zh) 一种基于语音识别的咨询业务处理方法及装置
US11868727B2 (en) Context tag integration with named entity recognition models
US11176466B2 (en) Enhanced conversational bots processing
WO2023231785A1 (zh) 数据处理方法、装置及设备
CN115545002B (zh) 一种模型训练和业务处理的方法、装置、存储介质及设备
CN115203394A (zh) 一种模型训练的方法、业务执行的方法及装置
WO2024093403A1 (zh) 一种意图识别方法、装置、设备及可读存储介质
CN113486170B (zh) 基于人机交互的自然语言处理方法、装置、设备及介质
EP4252143A1 (en) Distance-based logit values for natural language processing
CN116635862A (zh) 用于自然语言处理的域外数据扩充
WO2022235353A1 (en) Variant inconsistency attack (via) as a simple and effective adversarial attack method
CN112735374A (zh) 一种自动语音交互的方法及装置
EP4060517A1 (en) System and method for designing artificial intelligence (ai) based hierarchical multi-conversation system
US20220075960A1 (en) Interactive Communication System with Natural Language Adaptive Components
CN112908315B (zh) 一种基于声音特征和语音识别的问答意图判断方法
JP2023538923A (ja) テキスト分類についての説明を与えるための技術
CN116909889A (zh) 一种模型的风险评测方法、装置及设备
WO2023207212A1 (zh) 语音对话检测方法及装置
CN112396444A (zh) 一种智能机器人应答方法及装置
US20220229991A1 (en) Multi-feature balancing for natural language processors
CN113220852B (zh) 人机对话方法、装置、设备和存储介质
CN111414468A (zh) 话术选择方法、装置和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23826042

Country of ref document: EP

Kind code of ref document: A1