Dialogue robot reply method, model training method and device combining RPA and AI
By combining RPA and AI, using preset knowledge base training to determine the target similarity problem with the highest similarity to the user's question statement, the problem that traditional models cannot learn the semantic distribution of the knowledge base is solved, and the accuracy and efficiency of dialogue robot answers are improved.
Patent Information
- Application Number
- CN202010792940.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-06-30
- Filing Date
- 2020-08-07
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2040-08-07
AI Technical Summary
Traditional pre-trained dialogue robot models are unable to learn the semantic distribution of the knowledge base, resulting in errors in answers and insufficient accuracy.
By combining RPA and AI, the preset search model is trained using similar problems in the preset knowledge base to establish the correlation between similar problems and similarity, determine the target similar problems and return the answer.
It improves the accuracy of dialogue robots to answer questions, solves the problem of inaccurate scoring of traditional models, and saves the cost of manpower labeling corpus.
Smart Images

Figure CN111897938B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent conversations, and specifically to a method for a dialogue robot to reply, a model training method, a device, a device, and a medium that combine RPA (Robotic Process Automation) and AI (Artificial Intelligence). Background Art
[0002] Robotic Process Automation (RPA) is to simulate human operations on a computer through specific "robot software" and automatically execute process tasks according to rules. Artificial Intelligence (AI) is a technical science that studies, develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. Among them, Natural Language Processing (NLP) is an important direction in the field of computer science and the field of AI. Dialogue robots based on AI are becoming more and more common in daily life.
[0003] Currently, the dialogue robot technology mainly scores the similarity between the user's question and the retrieved similar questions using a pre-trained model, and returns the answer of the knowledge point to which the similar question with the highest score belongs. Since the traditional pre-trained model needs to separately label sentence pair corpora for training, the traditional pre-trained model cannot learn the semantic distribution of the knowledge base itself, so it may cause phenomena such as inaccurate model scoring and incorrect answers. Summary of the Invention
[0004] The embodiments of this application disclose a method for a dialogue robot to reply, a model training method, a device, a device, and a medium that combine RPA and AI, which improve the accuracy of the dialogue robot in answering questions.
[0005] In a first aspect, the embodiments of this application disclose a method for a dialogue robot to reply in combination, and the method includes:
[0006] Receiving a question sentence from a user;
[0007] Based on a preset retrieval model, using natural language processing NLP technology to determine a target similar question that meets the similarity requirement with the question sentence;
[0008] Returning the answer of the knowledge point to which the target similar question belongs to the user;
[0009] Among them, the preset retrieval model is trained by similar questions in the preset knowledge base to establish the association relationship between each similar question and the similarity.
[0010] Optionally, based on the preset retrieval model, using natural language processing (NLP) technology to determine the target similar question that meets the similarity requirement with the question statement, including:
[0011] Recall each similar question corresponding to the question statement from the preset knowledge base;
[0012] Based on the preset retrieval model, using natural language processing (NLP) technology to determine the target similar question with the highest similarity to the question statement from the recalled similar questions.
[0013] Optionally, based on the preset retrieval model, using natural language processing (NLP) technology to determine the target similar question with the highest similarity to the question statement from the recalled similar questions, including:
[0014] Use natural language processing (NLP) technology to calculate the similarity value between the question statement and each similar question;
[0015] Input all the similarity values into the preset retrieval model;
[0016] According to the confidence result output by the preset retrieval model, determine the target similar question with the highest similarity to the question statement from the recalled similar questions.
[0017] Optionally, according to the confidence result output by the preset retrieval model, determine the target similar question with the highest similarity to the question statement from the recalled similar questions, including:
[0018] Based on all the confidence values output by the preset retrieval model, select the similarity question with the highest confidence value from the recalled similar questions;
[0019] Take the similarity question with the highest confidence value as the target similar question with the highest similarity to the question statement.
[0020] Optionally, calculating the similarity value between the question statement and each similar question includes:
[0021] Calculate the features between the question statement and each similar question, and use the obtained feature information as the similarity value;
[0022] Among them, the features include one or more of the following: minimum edit distance, longest common substring length, cosine distance of word vectors weighted by TFIDF (Term Frequency-Inverse Document Frequency), Word Mover's Distance (abbreviated as: WMD) score, and neural network features based on sentence pairs.
[0023] Optionally, the preset retrieval model is obtained in the following manner:
[0024] Add labels to each pair of similar questions in the training samples, where the labels are used to indicate whether each similar question in each pair of similar questions belongs to the same knowledge point in the knowledge base;
[0025] Use natural language processing (NLP) techniques to determine the similarity between each similar question in each pair of similar questions;
[0026] Train a preset supervised model using the training samples with labels and similarity values to obtain a retrieval model;
[0027] Among them, each similar question in the training samples is a similar question in the preset knowledge base.
[0028] In a second aspect, an embodiment of the present application provides a method for training a retrieval model for a combined chatbot, the method including:
[0029] Add labels to each pair of similar questions in the training sample set, where the labels are used to indicate whether each similar question in each pair of similar questions belongs to the same knowledge point;
[0030] Use natural language processing (NLP) techniques to determine the similarity between each similar question in each pair of similar questions;
[0031] Train a preset supervised model using the training sample set with labels and similarity values to obtain a retrieval model;
[0032] Among them, each similar question in the training sample set belongs to the preset knowledge base.
[0033] Optionally, the training sample set is obtained in the following manner:
[0034] Select a set number of similar questions from the preset knowledge base as seed questions;
[0035] Retrieve various sub-questions in the preset knowledge base and recall the similar questions corresponding to various sub-questions;
[0036] For each seed question, combine it with the corresponding similar questions, and use the set of multiple pairs of similar questions after combination as the training sample set.
[0037] Optionally, using natural language processing (NLP) technology to determine the similarity between each similar question in each pair of similar questions includes:
[0038] Using natural language processing (NLP) technology to calculate the features between each similar question in each pair of similar questions, and using the obtained features as the similarity value;
[0039] Among them, the features include one or more of the following: minimum edit distance, longest common substring length, cosine distance of TFIDF weighted average word vectors, word mover's distance (WMD) score, and neural network features based on sentence pairs.
[0040] Optionally, the preset supervised model is:
[0041] One of logistic regression, distributed gradient boosting library XGBoost, or gradient boosting algorithm library CatBoost model.
[0042] In a third aspect, an embodiment of the present application further provides a dialogue robot reply device combining RPA and AI, and the device includes:
[0043] A question statement receiving module, configured to receive a user's question statement;
[0044] A target similar question determining module, configured to determine a target similar question that meets the similarity requirement with the question statement based on a preset retrieval model and using natural language processing (NLP) technology;
[0045] An answer returning module, configured to return the answer of the knowledge point to which the target similar question belongs to the user;
[0046] Among them, the preset retrieval model is trained through similar questions in a preset knowledge base to establish an association relationship between each similar question and its similarity.
[0047] Optionally, the target similar question determining module specifically includes:
[0048] A similar question recalling unit, configured to recall each similar question corresponding to the question statement from a preset knowledge base;
[0049] A target similar question determining unit, configured to determine the target similar question with the highest similarity to the question statement from the recalled similar questions based on a preset retrieval model and using natural language processing (NLP) technology.
[0050] Optionally, the target similar question determining unit specifically includes:
[0051] A similarity value calculation subunit, configured to calculate the similarity value between the query statement and each similar question by using natural language processing (NLP) technology;
[0052] An input subunit, configured to input all similarity values into a preset retrieval model;
[0053] A target similar question determination subunit, configured to determine, according to the confidence result output by the preset retrieval model, a target similar question with the highest similarity to the query statement from each of the recalled similar questions.
[0054] Optionally, the target similar question determination subunit is specifically configured to:
[0055] Based on all the confidence values output by the preset retrieval model, select a similarity question with the highest confidence value from each of the recalled similar questions, and use the similarity question with the highest confidence value as the target similar question with the highest similarity to the query statement.
[0056] Optionally, the similarity value calculation subunit is specifically configured to:
[0057] Calculate the features between the query statement and each similar question, and use the obtained features as the similarity value;
[0058] Wherein, the features include one or more of the following: minimum edit distance, longest common substring length, cosine distance of TFIDF weighted average word vectors, word mover's distance (WMD) score, and neural network features based on sentence pairs.
[0059] Optionally, the preset retrieval model is obtained by the following method:
[0060] Add labels to each pair of similar questions in the training samples, where the labels are used to indicate whether each similar question in each pair of similar questions belongs to the same knowledge point in the knowledge base;
[0061] Use natural language processing (NLP) technology to determine the similarity of each similar question in each pair of similar questions;
[0062] Use the training samples with labels and similarity values to train a preset supervised model to obtain a retrieval model.
[0063] In a fourth aspect, an embodiment of the present application further discloses a retrieval model training device for a combined dialogue robot, and the device includes:
[0064] A label adding module, configured to add labels to each pair of similar questions in a training sample set, where the labels are used to indicate whether each similar question in each pair of similar questions belongs to the same knowledge point;
[0065] A similarity determination module, configured to use natural language processing (NLP) technology to determine the similarity between each pair of similar questions;
[0066] A model training module, configured to train a preset supervised model using the training sample set with labels and similarity values to obtain a retrieval model;
[0067] Wherein, each similar question in the training sample set belongs to a preset knowledge base.
[0068] Optionally, the training sample set is obtained through the following method:
[0069] Select a set number of similar questions from the preset knowledge base as seed questions;
[0070] Retrieve various sub-questions in the preset knowledge base and recall the corresponding similar questions for various sub-questions;
[0071] For each seed question, combine it with its corresponding similar questions, and use the set of multiple pairs of combined similar questions as the training sample set.
[0072] Optionally, the similarity determination module is specifically configured to:
[0073] Use natural language processing (NLP) technology to calculate the features between each pair of similar questions, and use the obtained features as similarity values;
[0074] Wherein, the features include one or more of the following: minimum edit distance, longest common substring length, cosine distance of TFIDF weighted average word vectors, word mover's distance (WMD) score, and neural network features based on sentence pairs.
[0075] Optionally, the preset supervised model is:
[0076] One of logistic regression, XGBoost (distributed gradient boosting library), or CatBoost model (gradient boosting algorithm library).
[0077] In a fifth aspect, an embodiment of the present application further provides a computing device, including:
[0078] A memory storing executable program code;
[0079] A processor coupled to the memory;
[0080] The processor calls the executable program code stored in the memory and executes some or all of the steps of the method for replying a dialogue robot combining RPA and AI provided in any embodiment of the present application.
[0081] In a sixth aspect, the present application also provides a computing device in real time, including:
[0082] A memory storing executable program code;
[0083] A processor coupled to the memory;
[0084] The processor calls the executable program code stored in the memory and executes some or all of the steps of the method for training a retrieval model on a dialogue robot combining RPA and AI provided in any embodiment of the present application.
[0085] In a seventh aspect, an embodiment of the present application also provides a computer-readable storage medium storing a computer program, and the computer program includes instructions for executing some or all of the steps of the method for replying a dialogue robot combining RPA and AI provided in any embodiment of the present application.
[0086] In an eighth aspect, an embodiment of the present application also provides a computer-readable storage medium storing a computer program, and the computer program includes instructions for executing some or all of the steps of the method for training a retrieval model on a dialogue robot combining RPA and AI provided in any embodiment of the present application.
[0087] For the technical solution provided in this embodiment, when a question statement of a user is received, a target similar question that meets the similarity requirement with the question statement can be determined based on a preset retrieval model, and an answer to the knowledge point to which the target similar question belongs is returned to the user. Since the preset retrieval model is trained using similar questions in a preset knowledge base, the similar questions can be used as a basis for recall scoring by the preset retrieval model, that is, the accuracy of the target similar question can be improved using the model, thereby improving the accuracy of the dialogue robot in answering questions.
[0088] Compared with the prior art, the inventive points of the present application include:
[0089] 1. Since the preset retrieval model is trained using similar questions in a preset knowledge base, the similar questions in the preset knowledge base can be used as a basis for recall scoring by the preset retrieval model, that is, the target similar question with the highest similarity to the question statement of the user can be obtained through the preset retrieval model. The dialogue robot returns an answer to the knowledge point to which the target similar question belongs to the user, thereby improving the accuracy of the dialogue robot in answering the user's questions.
[0090] 2. Add labels to each pair of similar questions in the training sample set, and determine the similarity between the similar questions in each pair of similar questions, so as to train a preset supervised model with the training sample set with similarity values and labels to obtain a retrieval model, so that the retrieval model establishes an association relationship between each similar question and the similarity. Compared with the method of separately annotating sentence pair corpora to train the model in the prior art, the retrieval model provided by the embodiments of the present application learns the semantic distribution of the knowledge base itself, which helps to improve the accuracy of the question answering robot in answering questions.
[0091] 3. During the training process of the preset retrieval model, select a set number of similar questions from the preset knowledge base as seed questions, and use each seed question as the user's query statement to retrieve in the preset knowledge base to recall similar questions corresponding to the seed question; for each seed question, combine it with the corresponding similar questions, and use the set of multiple pairs of combined similar questions as the training sample set. Compared with the method of randomly selecting similar questions from the preset knowledge base for combination to establish a training sample set, the embodiments of the present application are set in this way, so that the similar questions used for model training have a certain similarity, thereby reducing the number of training samples and improving the training rate of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to these drawings.
[0093] Figure 1 is a schematic flowchart of a method for training a retrieval model on a dialogue robot for combining RPA and AI provided by an embodiment of the present application;
[0094] Figure 2 is a schematic flowchart of a method for a dialogue robot for combining RPA and AI to reply provided by an embodiment of the present application;
[0095] Figure 3a is an effect diagram of the dialogue process of a user dialogue robot provided by an embodiment of the present application;
[0096] Figure 3b is an effect diagram of the dialogue process of a user dialogue robot provided by an embodiment of the present application;
[0097] Figure 4 is a schematic structural diagram of a device for a dialogue robot for combining RPA and AI to reply provided by an embodiment of the present application;
[0098] Figure 5It is a schematic structural diagram of a retrieval model training device on a dialogue robot for combining RPA and AI provided by an embodiment of the present application;
[0099] Figure 6 It is a schematic structural diagram of a computing device provided by an embodiment of the present application. Detailed implementation manners
[0100] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0101] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.
[0102] In the description of the present application, the term "dialogue robot", in a broad sense, refers to a computer program that can conduct dialogue interactions with humans through voice or text.
[0103] In the description of the present application, the term "knowledge base" is a structured collection formed by several knowledge points in a certain business field. Each knowledge point in the knowledge base consists of a question and an answer. Creating a knowledge point requires a standard question, multiple similar questions, and one or more answers.
[0104] In the description of the present application, the term "similar questions" refers to multiple questions that are highly similar or consistent in semantics with the standard question of the knowledge point to which they belong. For example, different expressions of a certain question, etc.
[0105] In the description of the present application, the term "supervised learning" is a method in machine learning. It uses samples with known certain characteristics as the training set to establish a mathematical model, such as a discriminant model in pattern recognition, a weight model in the artificial neural network method, etc., and then uses the established model to predict unknown samples. In the embodiments of the present application, a dataset of similar questions with similarity values and labels is used as the training sample set to train a preset supervised model. Among them, the label is used to indicate whether the similar questions belong to the same knowledge point.
[0106] In the description of this application, the term "confidence" is an index indicating the degree of relevance between the knowledge points or intents recalled by the robot and the user's question. The higher the confidence, the more relevant it is. The confidence is a two-decimal number between 0 and 1.
[0107] Next, the content provided in the embodiments of this application will be introduced in detail with reference to the accompanying drawings.
[0108] Embodiment 1
[0109] Please refer to Figure 1 , Figure 1 is a schematic flowchart of a retrieval model training method on a dialogue robot for combining RPA provided in the embodiments of this application. This model can be applied in the interaction process between the user and the dialogue robot. Based on the output result of this model, the dialogue robot can match the user's question to the most similar question in the preset knowledge base and return the answer of the knowledge point to which the similar question belongs to the user. The retrieval model training method on the dialogue robot for combining RPA and AI provided in this embodiment can be executed by a retrieval model training device on the dialogue robot for combining RPA and AI, and this device can be implemented in a software and / or hardware manner. As Figure 1 shown, this method includes:
[0110] S110. Add labels to each pair of similar questions in the training sample set.
[0111] Among them, each training sample in the training sample set belongs to a similar question in the preset knowledge base. In the training sample set, each pair of similar questions is combined to form multiple pairs of similar questions, that is, each training sample exists in the form of a pair of similar questions.
[0112] Exemplarily, there are multiple ways to select similar questions from the preset knowledge base to obtain the training sample set. For example, multiple similar questions can be randomly selected from the preset knowledge base and combined in pairs to obtain the training sample set. Or, one or more similar questions belonging to each knowledge point in the preset knowledge base can be selected, and then the selected similar questions are randomly combined in pairs to form the training sample set.
[0113] Preferably, the construction of the training sample set can also be achieved through the following method:
[0114] Select a set number of similar questions from the preset knowledge base as seed questions; for each seed question, retrieve the corresponding similar questions in the preset knowledge base with it as the user's question statement; for each seed question, combine it with the corresponding similar questions, and use the set of multiple pairs of combined similar questions as the training sample set.
[0115] Among them, the seed questions can be randomly selected from a preset knowledge base. For example, 1,000 similar questions can be randomly selected from the preset knowledge base as seed questions. If each seed question is regarded as a user query and 200 similar questions are recalled from the knowledge base, then a dataset of up to 1,000 * 200 = 200,000 pairs of similar questions can be formed. Compared with the method of randomly selecting similar questions from the preset knowledge base to establish a training sample set, such a setting in this embodiment can make the training samples in the training sample set have a certain similarity, thereby reducing the number of training samples and improving the training rate of the model.
[0116] In this embodiment, the labels added to each pair of similar questions are used to indicate whether the two similar questions in each pair of similar question pairs belong to the same knowledge point in the preset knowledge base. For example, if they belong to the same knowledge point, the label can be set to 1; if they belong to different knowledge points, the label can be set to 2.
[0117] S120. Determine the similarity between each pair of similar questions.
[0118] It should be noted that NLP is an important direction in the fields of computer science and AI. The content studied by NLP includes but is not limited to the following sub-fields: text classification, information extraction, automatic summarization, intelligent question answering, topic recommendation, machine translation, subject term recognition, knowledge base construction, deep text representation, named entity recognition, text generation, text analysis (lexical, syntactic, grammatical, etc.), speech recognition and synthesis, text similarity calculation, etc.
[0119] In this embodiment, NLP technology can be used to determine the similarity between each pair of similar questions. Among them, the similarity between each pair of similar questions can be represented by a similarity value. This similarity value can be a feature between sentences, and these features can include one or more of the following features: minimum edit distance, longest common substring length, cosine distance of TFIDF weighted average word vectors, word moving distance WMD score, and neural network features based on sentence pairs.
[0120] S130. Use the training sample set with labels and similarity values to train a preset supervised model to obtain a retrieval model.
[0121] In this embodiment, the training model adopts a supervised learning training method. That is, when using a training sample set to train a preset supervised model, each training sample has a corresponding annotation. That is, in the training sample set, each pair of similar questions carries a corresponding label, which is used to indicate whether the two similar questions in each pair of similar questions belong to the same knowledge point, and the similarity value between the two similar questions in each pair of similar questions is also determined. Among them, the preset supervised model can be a logistic regression, XGBoost, or CatBoost model.
[0122] For the retrieval model training method on the dialogue robot that combines RPA and AI provided in this embodiment, since each pair of similar questions in the training sample set belongs to a preset knowledge base, and the similarity value between the two similar questions in each pair of similar questions and whether the two similar questions belong to the same knowledge point are both determined. Therefore, after using this training sample set to train the preset supervised model, the obtained retrieval model can learn the semantic distribution of the knowledge base itself. When using this model to score the confidence of the user's question and the recalled similar questions, the problem of inaccurate scoring is solved, thereby improving the accuracy of the dialogue robot's answer to the question and enhancing the user experience. In addition, compared with the method of using separately annotated sentence pairs of corpus to train the model in the prior art, the model training method provided in this embodiment does not require separate annotation of the corpus, saving manpower.
[0123] Further, after the retrieval model training is completed, during the application process of the retrieval model, the dialogue robot first recalls similar questions in the knowledge base through the user's question, and then uses this retrieval model to score the confidence of each similar question according to the similarity between the user's question sentence and the recalled similar questions, and outputs the confidence value corresponding to each similar question. The dialogue robot can select the similar question corresponding to the maximum confidence value from multiple confidence values and return the answer of the knowledge point to which the similar question belongs to the user. Specifically, the application process of this retrieval model will be introduced in detail in the following embodiments.
[0124] Embodiment Two
[0125] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a method for a dialogue robot to combine RPA and AI to reply provided by an embodiment of the present application. This method can be executed by a dialogue robot reply device that combines RPA and AI, and this device can be implemented in software and / or hardware. As Figure 2 shown, the method provided in this embodiment specifically includes:
[0126] S210. Receive the user's question sentence.
[0127] Specifically, the dialogue robot can receive the question statements input or sent by the user through the client. Here, the client can be a smart phone, a tablet computer, a PC, a humanoid intelligent robot, or the like. After receiving the question statement, the dialogue robot can display the question statement in the dialogue box with the user.
[0128] Specifically, Figure 3a and Figure 3b are the effect diagrams of the dialogue process of the user dialogue robot provided by the embodiments of the present application. As Figure 3a shown, when the user wants to consult questions related to pregnancy diet, the user can open the dialogue box with the pregnancy diet knowledge robot and input the questions he wants to consult.
[0129] S220. Based on a preset retrieval model, determine a target similar question that meets the similarity requirement with the question statement.
[0130] Optionally, in the embodiments of the present application, based on a preset retrieval model, use natural language processing NLP technology to determine a target similar question that meets the similarity requirement with the question statement.
[0131] Exemplarily, step S220 may specifically include:
[0132] Recall each similar question corresponding to the question statement from a preset knowledge base; based on a preset retrieval model, use natural language processing NLP technology to determine the target similar question with the highest similarity to the question statement from each similar question.
[0133] Specifically, the dialogue robot has a search engine function. When receiving the question statement of the user, it can use the search engine function to search in the preset knowledge base and recall the similar questions to the question statement. Among them, the recalled similar questions may belong to the same knowledge point as the question statement, or may belong to different knowledge points from the question statement.
[0134] Specifically, as Figure 3a shown, when the user wants to consult questions related to pregnancy diet, the user can open the dialogue box with the pregnancy diet knowledge robot and input the questions he wants to consult. As Figure 3b shown, when the user inputs the question statement "Can I eat crabs during pregnancy?", the robot will search in the preset knowledge base and recall the similar questions corresponding to the question statement, such as "Can I eat crabs in the first trimester of pregnancy?", "Can expectant mothers eat crabs?", and "Adverse reactions to eating crabs", etc. If there are multiple similar questions, the dialogue robot needs to return the answer of the knowledge point to which the similar question with the highest similarity to the user's question statement belongs to the user.
[0135] In this embodiment, the preset retrieval model can be used to select the target similar question with the highest confidence from each similar question as the similar question with the highest similarity to the query statement. The training method of the preset retrieval model can refer to the description of the above embodiment, which will not be elaborated in this embodiment.
[0136] Specifically, after the dialogue robot recalls the similar questions corresponding to the query statement, it can calculate the similarity values between the query statement and each similar question, and input all the similarity values into the preset retrieval model; according to the confidence results output by the preset retrieval model, determine the target similar question with the highest similarity to the query statement.
[0137] Among them, the similarity values between the user's query statement and each similar question can be represented by the features between the query statement and each similar question, and the features can include one or more of the following: minimum edit distance, longest common substring length, cosine distance of TFIDF weighted average word vectors, WMD score, and neural network features based on sentence pairs.
[0138] In the application process of the preset retrieval model in this embodiment, after inputting the feature information between the query statement and each similar question into the preset retrieval model, the preset retrieval model will score the confidence of each similar question and output the confidence value corresponding to each similar question. The dialogue robot can select the similar question with the highest confidence value from all the confidence values as the target similar question with the highest similarity to the user's query statement. For example, for the query statement "Can I eat crabs during pregnancy", if among the results output by the preset retrieval model, the confidence value corresponding to "Can I eat crabs in the first trimester of pregnancy" is 0.73, the confidence value corresponding to "Can expectant mothers eat crabs" is 0.87, and the confidence value corresponding to "Adverse reactions of eating crabs" is 0.64, then the dialogue robot selects the similar question "Can expectant mothers eat crabs" corresponding to the confidence value of 0.87 as the target similar question with the highest similarity to the query statement "Can I eat crabs during pregnancy".
[0139] S230. Return the answer of the knowledge point to which the target similar question belongs to the user.
[0140] Specifically, when answering the user's question, in addition to returning the answer of the knowledge point to which the target similar question belongs to the user, the dialogue robot can also return the corresponding explanation of the answer to the user for the user to refer to, so as to improve the user experience. For example, Figure 3bAs shown in the figure, for the question sentence "Can pregnant women eat crabs?", when the dialogue robot answers the user's question, in addition to sending the answer "Eat crabs with caution during pregnancy" to the user, it also returns its explanation "Pregnant women may experience a decline in gastrointestinal function in the early and even mid-pregnancy. Moreover, if they did not often eat crabs before pregnancy or have a history of allergies, food allergies may occur when eating crabs during pregnancy; in addition, if crabs are not cleaned or cooked properly, it may also lead to microbial infections" to the user for reference.
[0141] For the technical solution provided in this embodiment, when receiving the user's question sentence, based on the preset retrieval model, the target similar question that meets the similarity requirement with the question sentence can be determined, and the answer of the knowledge point to which the target similar question belongs is returned to the user. Since the preset retrieval model is trained using similar questions in the preset knowledge base, this similar question can be used as the basis for the preset retrieval model to perform recall scoring. Using this model can improve the accuracy of the target similar question, thereby improving the accuracy of the robot's answer to the question.
[0142] Embodiment III
[0143] Please refer to Figure 4 , Figure 4 is a schematic structural diagram of a dialogue robot reply device combining RPA and AI provided by an embodiment of the present application. As Figure 4 shown, the device includes: a question sentence receiving module 310, a target similar question determining module 320, and an answer returning module 330; where
[0144] The question sentence receiving module 310 is configured to receive the user's question sentence;
[0145] The target similar question determining module 320 is configured to determine the target similar question that meets the similarity requirement with the question sentence based on the preset retrieval model by using natural language processing NLP technology;
[0146] The answer returning module 330 is configured to return the answer of the knowledge point to which the target similar question belongs to the user;
[0147] Among them, the preset retrieval model is trained by similar questions in the preset knowledge base to establish the association relationship between each similar question and its similarity.
[0148] Optionally, the target similar question determining module 320 specifically includes:
[0149] The similar question recall unit is configured to recall each similar question corresponding to the question sentence from the preset knowledge base;
[0150] A target similar question determination unit, configured to determine a target similar question with the highest similarity to the query statement from each similar question based on a preset retrieval model.
[0151] Optionally, the target similar question determination unit specifically includes:
[0152] A similarity value calculation subunit, configured to calculate the similarity value between the query statement and each similar question;
[0153] An input subunit, configured to input all similarity values into a preset retrieval model;
[0154] A target similar question determination subunit, configured to determine a target similar question with the highest similarity to the query statement according to the confidence result output by the preset retrieval model.
[0155] Optionally, the target similar question determination subunit is specifically configured to:
[0156] Select the similar question with the highest confidence value from all the confidence values output by the preset retrieval model as the target similar question with the highest similarity to the query statement.
[0157] Optionally, the similarity value calculation subunit is specifically configured to:
[0158] Calculate the features between the query statement and each similar question, and use the obtained feature information as the similarity value;
[0159] Wherein, the features include one or more of the following: minimum edit distance, longest common substring length, cosine distance of TFIDF weighted average word vectors, word mover's distance (WMD) score, and neural network features based on sentence pairs.
[0160] Optionally, the preset retrieval model is obtained through the following method:
[0161] Add labels to each pair of similar questions in the training samples, where the labels are used to indicate whether each similar question in each pair of similar questions belongs to the same knowledge point in the knowledge base;
[0162] Determine the similarity of each similar question in each pair of similar questions;
[0163] Use the training samples with labels and similarity values to train a preset supervised model to obtain a retrieval model.
[0164] The dialogue robot reply device combining RPA and AI provided by the embodiments of the present application can execute the dialogue robot reply method combining RPA and AI provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in the above embodiments, reference may be made to the dialogue robot reply method combining RPA and AI provided by any embodiment of the present application.
[0165] Embodiment 4
[0166] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of a retrieval model training device on a dialogue robot for combining RPA and AI provided by an embodiment of the present application. As Figure 5 shown, the device includes: a label adding module 410, a similarity determining module 420, and a model training module 430, where
[0167] The label adding module 410 is configured to add labels to each pair of similar questions in the training sample set, where the labels are used to indicate whether each similar question in each pair of similar questions belongs to the same knowledge point;
[0168] The similarity determining module 420 is configured to determine the similarity between each similar question in each pair of similar questions;
[0169] The model training module 430 is configured to train a preset supervised model using the training sample set with labels and similarity values to obtain a retrieval model;
[0170] where each similar question in the training sample belongs to a preset knowledge base.
[0171] Optionally, the training sample set is obtained in the following manner:
[0172] Select a set number of similar questions from the preset knowledge base as seed questions;
[0173] Retrieve similar questions corresponding to each seed question in the preset knowledge base;
[0174] For each seed question, combine it with its corresponding similar questions, and use the set of multiple pairs of combined similar questions as the training sample set.
[0175] Optionally, the similarity determining module is specifically configured to:
[0176] Calculate the features between each similar question in each pair of similar questions, and use the obtained feature information as the similarity value;
[0177] Among them, the features include one or more of the following: minimum edit distance, longest common substring length, cosine distance of TFIDF-weighted average word vectors, word mover's distance (WMD) score, and neural network features based on sentence pairs.
[0178] Optionally, the preset supervised model is:
[0179] Logistic regression, distributed gradient boosting library XGBoost, or gradient boosting algorithm library CatBoost model.
[0180] The retrieval model training device for the dialogue robot combining RPA and AI provided by the embodiments of the present application can execute the retrieval model training method for the dialogue robot combining RPA and AI provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in the above embodiments, reference can be made to the retrieval model training method for the dialogue robot combining RPA and AI provided by any embodiment of the present application.
[0181] Embodiment Six
[0182] Please refer to Figure 6 , Figure 6 which is a schematic structural diagram of a computing device provided by an embodiment of the present application. As Figure 6 shown, the computing device may include:
[0183] A memory 701 storing executable program code;
[0184] A processor 702 coupled to the memory 701;
[0185] Among them, the processor 702 calls the executable program code stored in the memory 701 to execute the dialogue robot response method combining RPA and AI provided by any embodiment of the present application.
[0186] The embodiments of the present application also provide another computer device, including a memory storing executable program code; a processor coupled to the memory; among them, the processor calls the executable program code stored in the memory to execute the retrieval model training method for the dialogue robot combining RPA and AI provided by any embodiment of the present application.
[0187] The embodiments of the present application disclose a computer-readable storage medium, which stores a computer program, and wherein the computer program enables a computer to execute the dialogue robot response method combining RPA and AI provided by any embodiment of the present application.
[0188] The embodiments of the present application also disclose a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the retrieval model training method on a dialogue robot for combining RPA and AI provided in any embodiment of the present application.
[0189] In various embodiments of the present application, it should be understood that the order of the above processes does not necessarily mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0190] In the embodiments provided by the present application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.
[0191] In addition, in each embodiment of the present application, each functional unit can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0192] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a memory and includes several requests for causing a computer device (which can be a personal computer, a server, or a network device, etc., specifically, the processor in the computer device) to execute some or all of the steps of the above methods in each embodiment of the present application.
[0193] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium includes read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM) 、 compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disc storage, tape storage, or any other computer-readable medium capable of carrying or storing data.
[0194] The above has introduced in detail a method, training method, device, equipment and medium for a dialogue robot reply combining RPA and AI disclosed in the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for replying of a dialogue robot combining RPA and AI, characterized in that, Including: The dialogue robot RPA receives the question statement sent by the user through the client, displays the question statement in the dialogue box with the user, and gives a prompt message in the dialogue box to remind the user to continue asking questions; wherein, the dialogue robot RPA has a search engine function. Using the search engine function to recall each similar question corresponding to the question statement from the preset knowledge base, using natural language processing NLP technology to calculate the similarity value between the question statement and each similar question, inputting all similarity values into the preset retrieval model, and determining the target similar question with the highest similarity to the question statement from the recalled similar questions according to the confidence result output by the preset retrieval model. Return the answer of the knowledge point to which the target similar question belongs to the user through the dialogue box. Determine the preset retrieval model by the following method: Add labels to each pair of similar questions in the training sample set, where the label is used to indicate whether each similar question in each pair of similar questions belongs to the same knowledge point; randomly select a set number of similar questions from the preset knowledge base as seed questions, retrieve various seed questions in the preset knowledge base to recall the similar questions corresponding to various seed questions, for each seed question, combine it with each corresponding similar question in pairs, and use the set of multiple pairs of combined similar questions as the training sample set. Use natural language processing NLP technology to determine the similarity between each similar question in each pair of similar questions. Use the training sample set with labels and similarity values to train the preset supervised model; wherein, each similar question in the training sample set belongs to the preset knowledge base.
2. The method according to claim 1, characterized in that The determining the target similar question with the highest similarity to the question statement from the recalled similar questions according to the confidence result output by the preset retrieval model includes: Based on all the confidence values output by the preset retrieval model, select the similarity question with the highest confidence value from the recalled similar questions. Use the similarity question with the highest confidence value as the target similar question with the highest similarity to the question statement.
3. The method according to claim 1, wherein The using natural language processing NLP technology to determine the similarity between each similar question in each pair of similar questions includes: Use natural language processing NLP technology to calculate the features between each similar question in each pair of similar questions, and use the obtained features as the similarity value; wherein, the features include one or more of the minimum edit distance, the longest common substring length, the cosine distance of the TFIDF weighted average of the word frequency - inverse document frequency, the word mover's distance WMD score, and the neural network feature based on sentence pairs.
4. The method according to claim 1, wherein The preset supervised model is: One of logistic regression, the distributed gradient boosting library XGBoost, or the gradient boosting algorithm library CatBoost model.
5. A dialogue robot reply device combining RPA and AI, characterized in that, Including: A question statement receiving module, configured to receive a question statement sent by a user through a client by a dialogue robot RPA, display the question statement in a dialogue box with the user, and give a prompt message in the dialogue box to remind the user to continue asking questions; wherein, the dialogue robot RPA has a search engine function; A target similar question determining module, configured to recall each similar question corresponding to the question statement from a preset knowledge base by using the search engine function, calculate a similarity value between the question statement and each similar question by using natural language processing NLP technology, input all the similarity values into a preset retrieval model, and determine a target similar question with the highest similarity to the question statement from the recalled similar questions according to the confidence result output by the preset retrieval model; An answer returning module, configured to return the answer of the knowledge point to which the target similar question belongs to the user through the dialogue box; The preset retrieval model is determined by the following method: Adding labels to each pair of similar questions in a training sample set, where the label is used to indicate whether each similar question in each pair of similar questions belongs to the same knowledge point; wherein, a set number of similar questions are selected from the preset knowledge base as seed questions, and various seed questions are retrieved in the preset knowledge base to recall similar questions corresponding to various seed questions. For each seed question, it is combined with each corresponding similar question pairwise, and the set of multiple pairs of combined similar questions is used as the training sample set; Using natural language processing NLP technology to determine the similarity between each similar question in each pair of similar questions; Training a preset supervised model by using the training sample set with labels and similarity values; wherein, each similar question in the training sample set belongs to the preset knowledge base.
6. A computing device, characterized in that, Including: A memory storing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory and executes the dialogue robot reply method combining RPA and AI according to any one of claims 1-4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the dialogue robot reply method combining RPA and AI according to any one of claims 1-4.
Citation Information
Patent Citations
Question and answer recommendation method based on artificial intelligence, device and computer device
CN107220380A
A method for implementing a question answering system based on a question-answer pair
CN109271505A