Question and answer method and device, and training method of question and answer robot

By combining historical dialogue data and standard corpora to generate a training dataset, and using multiple algorithm models to train the question-answering robot, the accuracy and efficiency issues of intelligent question-answering robots when faced with various questioning methods are solved, achieving a more efficient question-answering service.

CN116150306BActive Publication Date: 2026-07-03MASHANG CONSUMER FINANCE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MASHANG CONSUMER FINANCE CO LTD
Filing Date
2022-07-01
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

When faced with multiple ways of asking the same question from different users, existing intelligent question-answering robots struggle to efficiently and accurately find matching pre-set questions from the knowledge base, resulting in decreased answer accuracy and reduced operational efficiency.

Method used

By combining historical dialogue data and pre-set standard corpora to generate a training dataset, the question-answering robot is trained using multiple algorithm models. This ensures that the knowledge base stores different ways of asking the same question, and the most suitable training algorithm model is selected for iterative training.

Benefits of technology

This improves the efficiency and accuracy of the question-answering robot when facing questions from real users, enabling it to match user questions and provide answers more quickly, thus enhancing training efficiency and effectiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116150306B_ABST
    Figure CN116150306B_ABST
Patent Text Reader

Abstract

This application discloses a training method and apparatus for a question-answering robot, which improves both the operational efficiency and the answer accuracy of the trained question-answering robot. The method includes: acquiring an initial question-answering robot and initializing it; acquiring corpus data from historical dialogue data according to training instructions; acquiring a preset standard corpus corresponding to the business identifier; generating a training dataset based on the corpus data and the standard corpus; determining the corresponding training algorithm model from at least two pre-configured algorithm models of the initial question-answering robot; inputting the training dataset into the initial question-answering robot and outputting a predicted answer; constructing a target loss function based on the predicted answer and the standard answer; and iteratively training the initial question-answering robot based on the target loss function to obtain a target question-answering robot.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a training method, question-answering method and apparatus for a question-answering robot. Background Technology

[0002] With the development of the internet, various applications and websites often face enormous pressure from user inquiries. Traditional human customer service suffers from limitations such as slow response times, limited service hours, and high turnover. Most customer service questions are actually high-frequency, repetitive issues with standard answers that can be resolved by machines. By building an intelligent question-and-answer robot to automatically match user questions, users can seek assistance from human customer service when they are dissatisfied with the answer. This not only improves the user experience but also increases the efficiency of customer service personnel.

[0003] Therefore, whether an intelligent question-answering robot can accurately answer a user's question depends primarily on whether it can accurately find the most relevant pre-set question in the knowledge base.

[0004] In practice, different users may ask the same question in various ways. For example, the question "How's the weather?" can be phrased as "Is it raining today?", "Do I need to bring an umbrella today?", "What's the temperature today?", "What clothes should I wear today?", etc. These questions can all be considered the same, and their corresponding answers in the knowledge base should be identical. To ensure that all question types can find matching pre-defined questions in the knowledge base, the knowledge base needs to store as many question types as possible. This would lead to a surge in the amount of data stored in the knowledge base, which would slow down the speed of question matching through the knowledge base. Conversely, if the knowledge base lacks the support of massive amounts of question type data, it will be unable to accurately find matching pre-defined questions in the knowledge base, thus preventing the intelligent question-answering robot from providing the correct answer.

[0005] Therefore, how to ensure the accuracy of intelligent question-answering robots while improving their operating efficiency has become an urgent problem to be solved in related technologies. Summary of the Invention

[0006] This application provides a training method and apparatus for a question-answering robot, which improves both the operating efficiency and the accuracy of the robot's answers.

[0007] Firstly, this application provides a method for training a question-answering robot, comprising:

[0008] According to the received training instructions, the original question-answering robot is obtained and the original question-answering robot is initialized. The training instructions carry the business identifier corresponding to the original question-answering robot, and the original question-answering robot is pre-configured with at least two algorithm models.

[0009] According to the training instructions, corpus data corresponding to the business identifier is obtained from historical dialogue data, wherein the corpus data includes user questions and answers corresponding to the user questions;

[0010] Obtain a preset standard corpus corresponding to the business identifier, and generate a training dataset based on the corpus data and the standard corpus, wherein the standard corpus includes standard questions and standard answers corresponding to the business identifier;

[0011] Among the at least two pre-configured algorithm models of the original question-answering robot, determine the training algorithm model corresponding to the training dataset;

[0012] The training dataset is input into the original question-answering robot so that the original question-answering robot can determine the question intent of each training data in the training dataset, and perform answer search according to the training algorithm model for each question intent, and output the predicted answer.

[0013] Construct a target loss function based on the predicted answer and the standard answer;

[0014] The original question-answering robot is iteratively trained based on the target loss function to obtain the target question-answering robot.

[0015] Secondly, this application provides a question-answering method based on a question-answering robot, comprising:

[0016] Obtain the unanswered questions entered by the user through the terminal device;

[0017] The question to be answered is input into a pre-trained question-answering robot, which performs semantic recognition on the question to determine the question intent and keywords corresponding to the question to be answered.

[0018] The system searches for answers based on the intent of the question and the keywords used in the question to obtain the response information corresponding to the question to be answered, and then returns the response information to the user.

[0019] Thirdly, this application provides a training device for a question-answering robot, comprising:

[0020] The original robot initialization module is used to obtain the original question-answering robot according to the received training instructions and to initialize the original question-answering robot. The training instructions carry the business identifier corresponding to the original question-answering robot, and the original question-answering robot is pre-configured with at least two algorithm models.

[0021] The corpus acquisition module is used to acquire corpus data corresponding to the business identifier from historical dialogue data according to the training instructions, wherein the corpus data includes user questions and answers corresponding to the user questions;

[0022] The training dataset generation module is used to obtain a preset standard corpus corresponding to the business identifier, and generate a training dataset based on the corpus data and the standard corpus, wherein the standard corpus includes standard questions and standard answers corresponding to the business identifier;

[0023] The algorithm model determination module is used to determine the training algorithm model corresponding to the training dataset from at least two pre-configured algorithm models of the original question-answering robot.

[0024] The training module is used to input the training dataset into the original question-answering robot, so that the original question-answering robot can determine the question intent of each training data in the training dataset, perform answer search according to the training algorithm model for each question intent, and output a predicted answer; construct a target loss function based on the predicted answer and the standard answer; and perform iterative training on the original question-answering robot based on the target loss function to obtain a target question-answering robot.

[0025] Fourthly, this application provides a question-answering device based on a question-answering robot, comprising:

[0026] The question receiving unit is used to acquire the questions to be answered by the user through the terminal device;

[0027] An intent recognition unit is used to input the question to be answered into a pre-trained question-answering robot, and the question-answering robot performs semantic recognition on the question to be answered to determine the question intent and question keywords corresponding to the question to be answered.

[0028] The feedback unit is used to search for answers based on the question intent and the question keywords to obtain the response information corresponding to the question to be answered, and to provide the response information back to the user.

[0029] Fifthly, this application provides an electronic device, comprising:

[0030] processor;

[0031] Memory used to store the processor's executable instructions;

[0032] The processor is configured to execute the instructions to implement the method as described in the first aspect.

[0033] In a sixth aspect, this application provides a computer-readable storage medium that, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the method described in the first aspect.

[0034] As can be seen in this embodiment, when training the question-answering robot, the training sample dataset is composed of corpus data extracted from historical dialogues and pre-set standard corpus. Since the corpus data extracted from historical dialogues consists of a massive number of questions actually asked by users, compared to the pre-set standard questions in the standard corpus, the corpus data extracted from historical dialogues contains different questioning methods for the same question (such as similar questions, ambiguous questions, etc.). This ensures that the knowledge base of the question-answering robot trained using this training dataset stores different questioning methods for the same question. However, in actual use, users generally do not ask questions according to the pre-set standard question format. Therefore, the question-answering robot trained using the training method provided in this application can more quickly find a matching question from the knowledge base when faced with a real user's question, thus providing a more efficient and accurate answer. Furthermore, the original question-answering robot provided in this application has two or more pre-set training algorithm models. During model training, the training algorithm model most suitable for the training dataset can be selected as the algorithm model used in subsequent training. Since this training algorithm model is adapted to the current training data and training scenario, the training efficiency and effect of the question-answering robot can be improved. Thus, the training method provided in this application can, on the one hand, train a question-answering robot more efficiently, and on the other hand, the question-answering robot trained using the training dataset provided in this application can broadly cover various question types, enabling the question-answering robot to provide a more efficient and accurate answer to the user. Attached Figure Description

[0035] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings:

[0036] Figure 1 A flowchart illustrating a training method for a question-answering robot, provided as an embodiment of this specification;

[0037] Figure 2 A flowchart illustrating a training method for a question-answering robot, provided as an embodiment of this specification;

[0038] Figure 3 A flowchart illustrating a question-answering method based on a question-answering robot, provided as one embodiment of this specification;

[0039] Figure 4 A schematic diagram of the structure of a training device for a question-answering robot provided as an embodiment of this specification;

[0040] Figure 5 A schematic diagram of the structure of a question-answering device based on a question-answering robot, provided as an embodiment of this specification;

[0041] Figure 6 This is a schematic diagram of an electronic device provided as an embodiment of the present specification. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0043] The terms "first," "second," etc., used in this specification and claims are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this specification can be implemented in orders other than those illustrated or described herein. Furthermore, in this specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0044] As mentioned earlier, currently, intelligent question-answering robots, upon receiving a user's input, can process the input, such as through word segmentation, keyword extraction, and synonym expansion. They then search the knowledge base for a set of questions similar to the user's input using keywords, select the question most similar to the user's input based on similarity, and finally use a pre-set answer from the knowledge base as the answer to the user's input, returning it to the user. However, in practical use, different users may ask the same question in various ways. To ensure that all types of questions can find matching pre-set questions in the knowledge base, the knowledge base needs to store as many question types as possible. This would lead to a surge in the amount of data stored in the knowledge base, which would slow down the question matching speed. Conversely, if the knowledge base lacks the support of massive amounts of question type data, it will be unable to accurately find matching pre-set questions, resulting in the intelligent question-answering robot being unable to provide the correct answer. Therefore, how to ensure the accuracy of intelligent question-answering robots while improving their operating efficiency has become an urgent problem to be solved in related technologies.

[0045] Therefore, this specification aims to provide a training method for a question-answering robot. During training, the training sample dataset is composed of corpus data extracted from historical dialogues and pre-set standard corpus. Since the corpus data extracted from historical dialogues consists of a massive number of questions actually asked by users, compared to the pre-set standard questions in the standard corpus, the corpus data extracted from historical dialogues contains different questioning methods for the same question (such as similar questions, ambiguous questions, etc.). This ensures that the knowledge base of the question-answering robot trained using this training dataset stores different questioning methods for the same question. However, in actual use, users generally do not follow the pre-set standard questions. The question-answering robot trained using the training method provided in the embodiments of this specification can more quickly find a matching question format from the knowledge base when faced with questions from real users, thus providing more efficient and accurate answers. Furthermore, the original question-answering robot provided in this application has two or more pre-set training algorithm models. During model training, the training algorithm model most suitable for the training dataset can be selected as the algorithm model used in subsequent training. Since this training algorithm model is adapted to the current training data and training scenario, the training efficiency and training effect of the question-answering robot can be improved. Therefore, the training method provided in the embodiments of this specification can, on the one hand, train the question-answering robot more efficiently, and on the other hand, the question-answering robot trained using the training dataset provided in this application can broadly cover various question formats, enabling the question-answering robot to provide more efficient and accurate answers to users.

[0046] It should be understood that the training method for the question-answering robot and the question-answering method based on the question-answering robot provided in the embodiments of this specification can both be executed by an electronic device or by software installed in an electronic device, specifically by a terminal device or a server device. The training method for the question-answering robot and the question-answering method based on the question-answering robot can be executed by the same electronic device, or they can be executed by different electronic devices.

[0047] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0048] Please refer to Figure 1 The following is a flowchart illustrating a training method for a question-answering robot, provided as an embodiment of this specification. The method may include:

[0049] Step 11: According to the received training instructions, obtain the original question-answering robot and initialize the original question-answering robot;

[0050] The training instruction contains the business identifier corresponding to the original question-answering robot, which is pre-configured with at least two algorithm models.

[0051] In the embodiments of this specification, when it is necessary to train a question-and-answer robot for a specific business area (such as logistics service, after-sales service, and sales service), a training instruction carrying the identifier of the specified business can be sent to the intelligent customer service system. In response to the training instruction, the intelligent customer service system can create an original question-and-answer robot for that business area and perform initialization processing on the original question-and-answer robot.

[0052] It should be noted that, in order to ensure that the final trained question-answering robot can perform question-answering service tasks not only for specific business areas, but also for general areas, such as the intelligent customer service system of a shopping application, which can be divided into different business areas such as pre-sales customer service, after-sales customer service, repair customer service, and sales customer service, and that customers in these different business areas all need to respond to and answer user questions in areas such as order number inquiries, transferring to human agents, discount recommendations, and daily Q&A, these service areas can be called general areas, and the daily basic questions for these general areas can be called general questions.

[0053] In one implementation, when creating an original question-and-answer robot for a specific business domain, the intelligent customer service system can acquire a pre-set public knowledge base and load it into the original question-and-answer robot to complete its initialization process. Specifically, this application embodiment can initialize the original question-and-answer robot as follows: acquire a pre-set public knowledge base, wherein the public knowledge base includes general corpus data corresponding to a general domain, wherein the general corpus data includes general questions and general answers corresponding to the general questions; load the public knowledge base into the original question-and-answer robot to complete its initialization process.

[0054] After completing the initialization process of the original question-and-answer robot, the intelligent customer service system can further set a name and corresponding business type for the original question-and-answer robot, so that in subsequent use, the question-and-answer robot that needs to be called in the current scenario can be determined directly based on the name of the question-and-answer robot.

[0055] Additionally, it should be noted that the original question-answering robot is pre-configured with at least two training algorithm models. These training algorithm models can be implemented using neural networks. For example, the pre-configured training algorithm models can include at least two of the following: deep neural network models, convolutional neural network models, recurrent neural network models, and long short-term memory neural network models.

[0056] The pre-configured training algorithm model is generally a pre-trained model. It should be noted that the pre-training process of this training algorithm model is unrelated to the subsequent training process for a specific business domain using the training dataset obtained in the embodiments of this application. This training algorithm model can generally be obtained directly from public channels, such as the BERT Chinese model released by Google and the ERNIE model released by Baidu. The pre-training method of the training algorithm model and the method of obtaining the training algorithm model are common technical means in this field and will not be described in detail here.

[0057] Additionally, it should be noted that the overall training process of the question-answering robot provided in the embodiments of this specification is as follows: Figure 2 As shown, it mainly includes a preprocessing stage, a data processing stage, a training task creation stage, and a training stage. Since the preprocessing stage, data processing stage, and training task creation stage are all conventional techniques in this field, they will not be described in detail in the embodiments of this specification.

[0058] Step 12: According to the training instructions, obtain the corpus data corresponding to the business identifier from the historical dialogue data;

[0059] The historical dialogue data refers to the data generated in one or more rounds of historical dialogue between the user and the respondent (such as intelligent customer service, human customer service, etc.). The historical dialogue data can include not only the user's questions, but also the respondent's answers to the user's questions.

[0060] In this embodiment of the application, business keywords corresponding to business identifiers can be obtained, and these business keywords can be used as query keywords to query dialogues carrying these business keywords in historical dialogue data. Then, the dialogues queried from the historical dialogue data can be used as corpus data corresponding to business identifiers.

[0061] In practical applications, historical dialogue data can take various forms. For example, when a user engages in human-computer dialogue using text, the historical dialogue data is in text format; similarly, when a user engages in human-computer dialogue using voice, the historical dialogue data is in voice format, and so on. Correspondingly, the methods for extracting user statements from historical dialogue data can also be diverse. For instance, if the historical dialogue data is in text format, it can be directly processed to extract user statements, such as the user's questions; or, if the historical dialogue data is in voice format, Automatic Speech Recognition (ASR) technology can be used to convert the voice-based historical dialogue data into text format, and then the text-based historical dialogue data can be processed to extract user statements, such as the user's questions or the respondent's answers.

[0062] Step 13: Obtain a preset standard corpus corresponding to the business identifier, and generate a training dataset based on the corpus data and the standard corpus;

[0063] The standard corpus consists of pre-set standard questions and answers corresponding to business identifiers. This standard corpus can be manually compiled by staff (such as business experts in the relevant business area), or it can be obtained by manually annotating existing text data in the business area by business experts. This application embodiment does not limit the method of generating this standard corpus.

[0064] It should be noted that although the standard corpus contains standard answers to various questions in this business domain, because the standard corpus is manually compiled by staff, the standard questions in it may not cover all ways of asking the question. Therefore, if the standard corpus is used as the training dataset to train the question-answering robot, the knowledge base of the trained question-answering robot will be incomplete and unable to handle questions asked by actual users through non-standard questions.

[0065] On the other hand, the corpus data obtained from historical dialogue data through step 12 consists of a large number of questions actually asked by users. Different users have different questioning habits. Therefore, compared with the pre-set standard questions in the standard corpus, the corpus data extracted from historical dialogues can often cover different ways of asking the same question (such as similar questions, vague questions, etc.). However, the answers contained therein are entered by the respondent. Since the respondent (such as human customers) has different levels of expertise, the corpus data extracted from historical dialogues may not necessarily contain standard answers.

[0066] Therefore, in the embodiments of this specification, a training dataset can be generated by combining corpus data extracted from historical dialogues and standard corpus data. This allows the different questioning methods of users in the corpus data to supplement the questioning methods of each standard question in the standard corpus, so that the training dataset generated in this way can cover as many different questioning methods as possible for the same question. This improves the quality of the question-answering robot knowledge base trained using the training dataset. With the help of a high-quality question-answering knowledge base, when faced with questions from real users, the question-answering robot can find the questioning method that matches the user's current question from the knowledge base more quickly, and thus provide answers to users more efficiently and accurately.

[0067] In the embodiments of this specification, the corpus data and the standard corpus can be combined based on the similarity between user questions in the corpus data and labeled questions in the standard corpus to generate a training dataset. Specifically, the method provided in the embodiments of this specification may include: determining the similarity between the corpus data and the standard corpus; determining similar user questions to the standard questions based on the similarity between the corpus data and the standard corpus; and generating a training dataset based on the corpus data, the standard corpus, and the similar user questions.

[0068] It's important to note that if two user questions express similar intents, for example, user question 1: "Is there any promotion on this item?" and user question 2: "Can this item be cheaper?", both expressing the intent to "inquire about discounts," then these two user questions have a certain similarity in intent. However, judging the similarity between two sentences solely based on their intent might be inaccurate. Considering that sentences are composed of individual words, and keywords within a sentence can further reflect its theme, to more accurately determine the similarity between the corpus data and the standard corpus, one optional implementation method includes the following steps:

[0069] Sub-step 1301: Based on semantic recognition technology, determine the first intent corresponding to the user question in the corpus data and the second intent corresponding to the standard question in the standard corpus.

[0070] In the embodiments of this specification, a pre-trained intent recognition model can be used to input user questions from the corpus data and standard questions from the standard corpus into the intent recognition model, and then obtain the first intent corresponding to the user question and the second intent corresponding to the standard question through the intent recognition model.

[0071] In one alternative implementation, the intent recognition model can be based on a Bidirectional Long Short-Term Memory (Bi-LSTM) network and a Conditional Random Field (CRF) model, trained using intent term samples relevant to the business scenario. This intent recognition model extracts contextual intent features from a standard question (or user question), and then identifies these features. The identification process includes using CRF constraint rules for part-of-speech tagging and evaluation, predicting the probabilities of various intent categories, and ultimately obtaining the intent result for the standard question (or user question).

[0072] Additionally, it should be noted that the intent recognition model can be trained using traditional machine learning algorithms or deep learning algorithms. In practical applications, various training methods known to those skilled in the art can be used to train the intent recognition model. For example, intent recognition models based on word vectors, convolutional neural networks (CNNs), and recurrent neural networks (RNNs) can be trained. The embodiments in this specification do not specifically limit the structure of the intent recognition model or the training method of the intent recognition model.

[0073] Sub-step 1302: Determine the first keyword corresponding to the user question and the second keyword corresponding to the standard question;

[0074] Generally, by performing word segmentation and part-of-speech tagging on the sentence, stopping words can be filtered out, and words can be filtered according to their parts of speech, retaining only words of the specified parts of speech, such as nouns, verbs, and adjectives, thus obtaining the keywords corresponding to the sentence.

[0075] In the embodiments of this specification, keywords can be extracted based on the frequency, part of speech, sentence structure, and word model of each word in a sentence, using a preset keyword extraction tool. Commonly used keyword extraction tools include Term Frequency-Inverse Document Frequency (TF-IDF) algorithms, TextRank algorithms, and Latent Dirichlet Allocation (LDA) document topic generation models. This embodiment of the specification does not specifically limit the choice of keyword extraction tool or the method of keyword extraction.

[0076] Sub-step 1303: Determine the similarity between the user question and the standard question based on the similarity between the first keyword and the second keyword, and the similarity between the first intent and the second intent.

[0077] In one alternative implementation, the first keyword and the second keyword can be converted into word vectors, and then the distance between the two word vectors can be calculated using a cosine similarity algorithm. Based on the vector distance, the similarity between the first keyword and the second keyword can be determined.

[0078] Specifically, in the embodiments of this specification, the first keyword and the second keyword can be sent to the word2vec model for word embedding to obtain word vectors corresponding to these keywords. The word2vec model is a set of related models used to generate word embeddings. In one optional implementation, the word2vec model can be trained as a shallow (two-layer) neural network that reconstructs the linguistic environment of words. Word embedding is a general term for a collection of language modeling and feature learning techniques in Natural Language Processing (NLP). Through word embedding, a high-dimensional space with the number of all words can be embedded into a much lower-dimensional continuous vector space, where each word or phrase is mapped to a vector in the real number domain. Using the word2vec model to convert words into corresponding word vectors is a common technique in the field of natural language processing. The embodiments of this specification do not specifically limit the structure or training method of the word2vec model.

[0079] After obtaining the word vector a corresponding to the first keyword and the word vector b corresponding to the second keyword output by the word2vec model, the distance between word vector a and word vector b can be calculated using the following formula [1] based on the cosine similarity method:

[0080]

[0081] Where a represents the word vector a corresponding to the first keyword, and b represents the word vector b corresponding to the second keyword. The closer the distance between the two vectors, the more similar the two word vectors are, and thus the higher the similarity between the keywords corresponding to the two word vectors.

[0082] Of course, alternatively, shared nearest neighbor (SNN) or other word vector similarity calculation schemes known in the art can be used to determine the similarity between the first keyword and the second keyword.

[0083] When multiple keywords are extracted from the user question and the standard corpus through sub-step 1302, that is, the first keyword set corresponding to the user question and the second keyword set corresponding to the standard corpus are obtained through sub-step 1302, the similarity value between each keyword in the first keyword set and each keyword in the second keyword set can be calculated using the above method. The similarity between the first keyword set and the second keyword set is calculated by weighted summation of the calculated keyword similarities, and is used as the similarity between the first keyword and the second keyword.

[0084] Following the same method for calculating keyword similarity, the similarity between the first intent and the second intent can also be calculated. The first intent and the second intent are converted into first intent vector and second intent vector respectively using the word2vec model. Then, the similarity between the first intent and the second intent is determined by calculating the distance between the intent vectors. For details on the specific scheme, please refer to the relevant description on determining keyword similarity above, which will not be repeated here.

[0085] In one alternative implementation, after determining the similarity between the first keyword and the second keyword (hereinafter referred to as keyword similarity for ease of description) and the similarity between the first intent and the second intent (hereinafter referred to as intent similarity for ease of description) through the above method, the keyword similarity and intent similarity can be weighted and summed. The weighted summation result is used to determine the similarity between the user question and the standard question. In one implementation, the similarity between the user question and the standard question can be calculated according to the following formula [2]:

[0086] score=w1similarity1+w2similarity2 [2]

[0087] Wherein, score represents the similarity between the user's question and the standard question, similarity1 represents keyword similarity, w1 represents the weight corresponding to keyword similarity, similarity2 represents intent similarity, and w2 represents the weight corresponding to intent similarity. In specific implementations, the weights corresponding to keyword similarity and intent similarity can be set according to actual needs, and this specification does not impose specific limitations on this.

[0088] Of course, alternatively, the similarity between the user question and the standard question can also be determined by other methods based on keyword similarity and intent similarity. For example, the maximum value of keyword similarity and intent similarity can be determined as the similarity between the user question and the standard question, etc. The embodiments in this specification do not specifically limit this.

[0089] If the above scheme determines that the user questions in the corpus data have a high degree of similarity with the standard questions in the standard corpus, then it can be determined that the user question and the standard question are different ways of asking the same question. Therefore, the user question can be regarded as a similar user question to the standard question, and a set of user questions corresponding to the standard question can be generated, thereby expanding the questioning methods corresponding to the standard question.

[0090] In one optional implementation, a threshold can be preset. The similarity between user questions in the corpus data and standard questions in the standard corpus can be compared with the preset threshold to determine whether to include user questions in the corpus data as similar user questions to the standard questions. Specifically, the method provided in this embodiment of the invention may include: including user questions with a similarity greater than the preset threshold as similar user questions to the standard questions; and generating a set of user questions corresponding to the standard questions based on the similar user questions.

[0091] Then, a training dataset can be generated based on the set of user questions corresponding to the standard question and the standard answer corresponding to the standard question. Additionally, it should be noted that if the similarity between a user question and a standard question is less than a preset threshold, although this indicates that the user question is not a similar user question to the standard question, it is possible that the user question is a new question for this business domain. To avoid directly discarding user questions with similarity less than the preset threshold, which could potentially affect the integrity of the training dataset generated subsequently based on the corpus data and the standard corpus, in one optional implementation, user questions with similarity less than the preset threshold to the standard question can be treated as new user questions. Then, the training dataset is generated based on the set of user questions corresponding to the standard question, the standard answer corresponding to the standard question, and the new user question. Specifically, the embodiments of this specification can generate the training dataset according to the following method: using the standard answer corresponding to the standard question as the question answer corresponding to each similar user question in the set of user questions corresponding to the standard question to generate a first training dataset; treating the user questions with similarity less than the preset threshold as new user questions; generating a second training dataset based on the new user questions and their corresponding answers; and generating the training dataset based on the first training dataset and the second training dataset.

[0092] It's also worth noting that, to avoid including low-quality user questions (such as those with obvious grammatical errors or those clearly irrelevant to the current business domain) in new user questions, which could negatively impact the quality of the subsequently trained question-answering robot, one optional implementation involves sending the user question to an approval platform if the similarity between the user question and the standard question is less than a preset threshold. The platform reviews the user question for quality (e.g., sentence fluency, grammatical errors, relevance to the current business domain), and only after the user question passes the platform's review is it considered a new user question and used in generating the subsequent training dataset. This avoids directly using low-quality user questions as new user questions to generate the training dataset, thus preventing any impact on the quality of the subsequently trained question-answering robot.

[0093] By using the training dataset generation method provided in the embodiments of this specification, the similarity between user questions obtained from historical dialogue data and standard questions in a preset standard corpus is calculated to determine the set of similar user questions for the standard questions. This expands the questioning methods corresponding to the standard questions. Based on the above method, a high-quality training dataset with comprehensive question coverage can be generated to ensure that a high-quality question-answering robot can be trained using the training dataset.

[0094] Step 14: Among the at least two pre-configured algorithm models of the original question-answering robot, determine the training algorithm model corresponding to the training dataset;

[0095] In one alternative implementation, the training algorithm model that best matches the data type of the training data in the training dataset can be selected, and then this training algorithm model can be used as the algorithm model for subsequent training of the question-answering robot.

[0096] The training dataset can contain various data types, including text, audio, and image data. The data type can be determined by the proportion of different types of training data within the dataset. For example, if over 50% of the corpus data in the training dataset is in image format, then the data type of the training dataset can be defined as image data. This allows for the selection of a convolutional neural network model that matches the image data type as the corresponding training algorithm model, thereby improving the training efficiency and effectiveness of the subsequent question-answering robot.

[0097] Step 15: Input the training dataset into the original question-answering robot so that the original question-answering robot can determine the question intent of each training data in the training dataset. For each question intent, search for answers according to the training algorithm model, output the predicted answer, construct the target loss function based on the predicted answer and the standard answer, and iteratively train the original question-answering robot based on the target loss function to obtain the target question-answering robot.

[0098] In one alternative implementation, the training sample dataset from the training dataset can be input into the original question-answering robot to obtain the predicted answer output by the original question-answering robot. Using the predicted answer and the standard answer, a target loss function is constructed, and the total loss value of the training dataset in the original question-answering robot is calculated. This loss value is used to characterize the deviation between the predicted answer output by the original question-answering robot during training and the standard answer. Then, with the goal of reducing the loss value of the question-answering robot, starting from the last network layer of the question-answering robot, the network parameters of each network layer in the question-answering robot are adjusted layer by layer through backpropagation until the loss value reaches a preset standard, and the question-answering robot can be trained.

[0099] Specifically, starting from the last network layer of the original question-answering robot, based on the structure of each network layer in the original question-answering robot and the connection relationships and connection weights between different network layers, the partial derivative of the loss value of the original question-answering robot is calculated forward to obtain the loss value of each network layer. The loss value of each network layer is used to characterize the detection bias caused by each network layer. Then, with the goal of reducing the loss value of the question-answering robot, the network parameters of each network layer are updated sequentially based on the loss value of each network layer.

[0100] It should be noted that the loss function used when training the object detection model can be any appropriate form, and can be set according to actual needs. This specification does not impose specific limitations on this aspect in the embodiments.

[0101] After training the question-answering robot using the methods described above, the final question-answering robot model file is generated and uploaded to the backend server of the intelligent customer service system for use. Subsequently, when the intelligent customer service system receives a question uploaded by a user, after determining the corresponding business domain, it can invoke a pre-trained question-answering robot for that business domain, input the question into the robot, and allow the robot to match and provide the most suitable answer to the user.

[0102] The question-answering robot training method provided in the embodiments of this specification uses a training sample dataset composed of corpus data extracted from historical dialogues and pre-set standard corpus. Since the corpus data extracted from historical dialogues consists of a massive number of questions actually asked by users, compared to the pre-set standard questions in the standard corpus, the corpus data extracted from historical dialogues contains different question formats for the same question (such as similar questions, ambiguous questions, etc.). This ensures that the knowledge base of the question-answering robot trained using this training dataset stores different question formats for the same question. However, in actual use, users generally do not follow the pre-set standard question format. The question-answering robot trained using the training method provided in this application can more quickly find a matching question from the knowledge base when faced with a real user's question, thus providing a more efficient and accurate answer. Furthermore, the original question-answering robot provided in this application has two or more pre-set training algorithm models. During model training, the training algorithm model most suitable for the training dataset can be selected as the algorithm model used in subsequent training. Since this training algorithm model is adapted to the current training data and training scenario, the training efficiency and effect of the question-answering robot can be improved. Therefore, the training method provided in this application can, on the one hand, train a question-answering robot more efficiently, and on the other hand, the question-answering robot trained using the training dataset provided in this application can broadly cover various question types, enabling the question-answering robot to provide a more efficient and accurate answer to the user.

[0103] With the above Figure 1 Corresponding to the training method of the question-answering robot shown, this specification also provides a question-answering method based on the question-answering robot, which improves both the operating efficiency of the trained question-answering robot and the accuracy of its answers.

[0104] The question-answering method based on a question-answering robot provided in the embodiments of this specification can be applied to any scenario with a need for intelligent machine customer service, such as intelligent customer service scenarios in applications including but not limited to shopping apps, financial apps, sports apps, and video apps. The following uses the application scenario of e-commerce after-sales service question-answering based on a question-answering robot as an example to provide a detailed description of the question-answering method based on a question-answering robot provided in the embodiments of this specification. For the specific processing flow, please refer to [link / reference]. Figure 3 As shown, it mainly includes the following steps.

[0105] Step 21: Obtain the unanswered question input by the user through the terminal device;

[0106] When using the intelligent customer service system, users can input questions they need to ask through their terminal devices. After receiving the questions sent by the terminal devices, the intelligent customer service system can first determine the business area corresponding to the questions through semantic recognition.

[0107] Generally, intelligent customer service systems can respond to questions from different business areas. These business areas include e-commerce, finance, sports, and more. Specifically, the system receives questions entered by users on their devices, sends the questions to the intelligent customer service system, and the system determines the corresponding business type. For example, for the question "My clothes don't fit, how do I return them?", the corresponding business area is e-commerce after-sales service.

[0108] Step 22: Input the question to be answered into the pre-trained question-answering robot, and use the question-answering robot to perform semantic recognition on the question to determine the question intent and question keywords corresponding to the question to be answered;

[0109] It's important to note that different question-and-answer robots on the intelligent customer service system can handle question-and-answer needs from different business areas. Therefore, after determining the business type corresponding to the user's input question through step 21, the intelligent customer service system can distribute the question to the corresponding question-and-answer robot based on the business type. For example, for the question "My clothes don't fit, how do I return them?", if the corresponding business type is determined to be e-commerce after-sales service, the intelligent customer service system can distribute the question to the question-and-answer robot corresponding to e-commerce after-sales service.

[0110] By using a question-answering robot to perform semantic recognition on the questions to be answered, the intent of the question and the keywords of the question can be determined.

[0111] In the embodiments of this specification, a pre-trained intent recognition model can be used. The question to be answered is input into the intent recognition model, and then the intent corresponding to the question to be answered is obtained through the intent recognition model.

[0112] In one optional implementation, the intent recognition model can be based on a Bidirectional Long Short-Term Memory (Bi-LSTM) network and a Conditional Random Field (CRF) model, trained using intent term samples relevant to the business scenario. This intent recognition model extracts contextual intent features from standard questions (or user-generated questions), and identifies these features. The identification process includes using CRF constraint rules for part-of-speech tagging and evaluation, predicting the probability of various intent categories, and ultimately obtaining the question intent to be answered. This specification does not specifically limit the structure or training method of the intent recognition model in the embodiments.

[0113] In one optional implementation, the keywords for the sentence can be obtained by performing word segmentation and part-of-speech tagging on the sentence, filtering out stop words, and filtering words according to their parts of speech, retaining only words of the specified parts of speech, such as nouns, verbs, and adjectives. The embodiments in this specification do not specifically limit the keyword extraction tool used or the method of extracting keywords.

[0114] Step 23: Search for answers based on the question intent and keywords determined by executing Step 22 to obtain the response information corresponding to the question to be answered, and then provide the response information to the user.

[0115] The question-answering robot uses the question intent and keywords as search keywords, searches for answers in the knowledge base according to a pre-trained algorithm model, obtains the response information corresponding to the question to be answered, and then feeds back the response information to the user.

[0116] The question-answering method based on a question-answering robot provided in the embodiments of this specification utilizes a training sample dataset composed of corpus data extracted from historical dialogues and pre-set standard corpus. The corpus data extracted from historical dialogues consists of a massive number of questions actually asked by users. Compared to the pre-set standard questions in the standard corpus, the corpus data extracted from historical dialogues contains different question formats for the same question (such as similar questions, ambiguous questions, etc.). This ensures that the knowledge base of the question-answering robot trained using this dataset stores different question formats for the same question. Since users generally do not ask questions according to the pre-set standard question format in actual use, the question-answering method based on a question-answering robot provided in the embodiments of this application can more quickly find a question format matching the user's current question from the knowledge base when faced with a real user's question, thus providing more efficient and accurate answers to the user.

[0117] In addition, with the above Figure 1 Corresponding to the training method of the question-answering robot shown, this specification also provides a training device for a question-answering robot, which improves both the operating efficiency and the answer accuracy of the trained question-answering robot. Figure 4 This is a schematic diagram of the structure of a training device for a question-answering robot provided in an embodiment of this application, including: an original robot initialization module 401, a corpus acquisition module 402, a training dataset generation module 403, an algorithm model determination module 404, and a training module 405.

[0118] The original robot initialization module 401 is used to obtain the original question-answering robot according to the received training instructions and to initialize the original question-answering robot. The training instructions carry the business identifier corresponding to the original question-answering robot, and the original question-answering robot is pre-configured with at least two algorithm models.

[0119] The corpus acquisition module 402 is used to acquire corpus data corresponding to the business identifier from historical dialogue data according to the training instructions, wherein the corpus data includes user questions and answers corresponding to the user questions;

[0120] The training dataset generation module 403 is used to obtain a preset standard corpus corresponding to the business identifier, and generate a training dataset based on the corpus data and the standard corpus, wherein the standard corpus includes standard questions and standard answers corresponding to the business identifier;

[0121] The algorithm model determination module 404 is used to determine the training algorithm model corresponding to the training dataset from at least two pre-configured algorithm models of the original question-answering robot.

[0122] The training module 405 is used to input the training dataset into the original question-answering robot, so that the original question-answering robot can determine the question intent of each training data in the training dataset, perform answer search according to the training algorithm model for each question intent, and output a predicted answer; construct a target loss function based on the predicted answer and the standard answer; and perform iterative training on the original question-answering robot based on the target loss function to obtain a target question-answering robot.

[0123] When using the question-answering robot training device provided in the embodiments of this specification, the training sample dataset is composed of corpus data extracted from historical dialogues and pre-set standard corpus during question-answering robot training. Since the corpus data extracted from historical dialogues consists of a massive number of questions actually asked by users, compared to the pre-set standard questions in the standard corpus, the corpus data extracted from historical dialogues contains different questioning methods for the same question (such as similar questions, ambiguous questions, etc.). This ensures that the knowledge base of the question-answering robot trained using this training dataset stores different questioning methods for the same question. However, in actual use, users generally do not follow the pre-set standard question format. The question-answering robot trained using the training method provided in this application can more quickly find a matching question from the knowledge base when faced with a real user's question, thus providing a more efficient and accurate answer. Furthermore, the original question-answering robot provided in this application has two or more pre-set training algorithm models. During model training, the training algorithm model most suitable for the training dataset can be selected as the algorithm model used in subsequent training. Since this training algorithm model is adapted to the current training data and training scenario, the training efficiency and effect of the question-answering robot can be improved. Therefore, the training device provided in this application can, on the one hand, train a question-answering robot more efficiently, and on the other hand, the question-answering robot trained using the training dataset provided in this application can broadly cover various question types, enabling the question-answering robot to provide a more efficient and accurate answer to the user.

[0124] Optionally, the original robot initialization module 401 includes:

[0125] The public knowledge base acquisition submodule is used to acquire a pre-set public knowledge base, wherein the public knowledge base includes general corpus data corresponding to a general domain, and the general corpus data includes general questions and general answers corresponding to the general questions;

[0126] An initialization submodule is used to determine the second similarity between the user statement and the standard question in the word dimension based on the word features of the first word and the word features of the second word;

[0127] The third similarity determination submodule is used to load the public knowledge base into the original question-answering robot to complete the initialization process of the original question-answering robot.

[0128] Optionally, the training dataset generation module 403 includes:

[0129] A similarity determination submodule is used to determine the similarity between the corpus data and the standard corpus;

[0130] The similar user question determination submodule is used to determine similar user questions of the standard question based on the similarity between the corpus data and the standard corpus.

[0131] The training dataset generation submodule is used to generate a training dataset based on the corpus data, the standard corpus, and the similar user questions.

[0132] Optionally, the similarity determination submodule is specifically used for: performing semantic recognition on the corpus data and the standard corpus, respectively determining the first intent corresponding to the user question in the corpus data and the second intent corresponding to the standard question in the standard corpus; respectively determining the first keyword corresponding to the user question and the second keyword corresponding to the standard question; and determining the similarity between the user question and the standard question based on the similarity between the first keyword and the second keyword, and the similarity between the first intent and the second intent.

[0133] Optionally, the similar user question determination submodule is specifically used to: identify user questions with a similarity greater than a preset threshold as similar user questions to the standard question; and generate a set of user questions corresponding to the standard question based on the similar user questions.

[0134] Optionally, the training dataset generation submodule is specifically used to: take the standard answer corresponding to the standard question as the answer corresponding to each similar user question in the user question set corresponding to the standard question, and generate a first training dataset; take the user questions with similarity less than a preset threshold as new user questions; generate a second training dataset based on the new user questions and the answers corresponding to the new user questions; and generate the training dataset based on the first training dataset and the second training dataset.

[0135] Optionally, the algorithm model determination module 404:

[0136] The data type determination submodule is used to determine the data type of the training data in the training dataset;

[0137] The model determination submodule is used to determine the training algorithm model corresponding to the training dataset based on the data type of the training data.

[0138] Optionally, the algorithm model pre-configured by the original question-answering robot includes at least two of the following: deep neural network model, convolutional neural network model, recurrent neural network model, and long short-term memory neural network model.

[0139] Obviously, the training device for the question-answering robot in the embodiments of this specification can be used as described above. Figure 1 The entity executing the training method for the question-answering robot shown is therefore capable of implementing the training method for the question-answering robot in... Figure 1 The functions implemented are the same, so they will not be described in detail here.

[0140] In addition, with the above Figure 3 Corresponding to the question-answering method based on the question-answering robot shown, this specification also provides a question-answering device based on the question-answering robot, which improves both the operating efficiency of the trained question-answering robot and the accuracy of the robot's answers. Figure 5 This is a schematic diagram of the structure of a question-answering device based on a question-answering robot provided in an embodiment of this application, including: a question receiving unit 501, an intent recognition unit 502, and a feedback unit 503.

[0141] The question receiving unit 501 is used to acquire the question to be answered input by the user through the terminal device;

[0142] The intent recognition unit 502 is used to input the question to be answered into a pre-trained question-answering robot, and to perform semantic recognition on the question to be answered by the question-answering robot to determine the question intent and question keywords corresponding to the question to be answered.

[0143] Feedback unit 503 is used to search for answers based on the question intent and the question keywords to obtain the response information corresponding to the question to be answered, and to provide the response information back to the user.

[0144] The question-answering method based on a question-answering robot provided in the embodiments of this specification utilizes a training sample dataset composed of corpus data extracted from historical dialogues and pre-set standard corpus. The corpus data extracted from historical dialogues consists of a massive number of questions actually asked by users. Compared to the pre-set standard questions in the standard corpus, the corpus data extracted from historical dialogues contains different question formats for the same question (such as similar questions, ambiguous questions, etc.). This ensures that the knowledge base of the question-answering robot trained using this dataset stores different question formats for the same question. Since users generally do not ask questions according to the pre-set standard question format in actual use, the question-answering method based on a question-answering robot provided in the embodiments of this application can more quickly find a question format matching the user's current question from the knowledge base when faced with a real user's question, thus providing more efficient and accurate answers to the user.

[0145] Figure 6 This is a schematic diagram of the structure of an electronic device according to one embodiment of this specification. Please refer to it. Figure 6 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.

[0146] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0147] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0148] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it; this is the logical level of the training device for the question-and-answer robot. The processor executes the program stored in memory and specifically performs the following operations:

[0149] According to the received training instructions, the original question-answering robot is obtained and the original question-answering robot is initialized. The training instructions carry the business identifier corresponding to the original question-answering robot, and the original question-answering robot is pre-configured with at least two algorithm models.

[0150] According to the training instructions, corpus data corresponding to the business identifier is obtained from historical dialogue data, wherein the corpus data includes user questions and answers corresponding to the user questions;

[0151] Obtain a preset standard corpus corresponding to the business identifier, and generate a training dataset based on the corpus data and the standard corpus, wherein the standard corpus includes standard questions and standard answers corresponding to the business identifier;

[0152] Among the at least two pre-configured algorithm models of the original question-answering robot, determine the training algorithm model corresponding to the training dataset;

[0153] The training dataset is input into the original question-answering robot so that the original question-answering robot can determine the question intent of each training data in the training dataset, and perform answer search according to the training algorithm model for each question intent, and output the predicted answer.

[0154] Construct a target loss function based on the predicted answer and the standard answer;

[0155] The original question-answering robot is iteratively trained based on the target loss function to obtain the target question-answering robot.

[0156] The above is as described in this instruction manual. Figure 1 The method executed by the training device for the question-answering robot disclosed in the illustrated embodiments can be applied to a processor, or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this specification can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0157] It should be understood that the electronic devices described in the embodiments of this specification can realize a training device for a question-and-answer robot. Figure 1The embodiments shown have the same function. Since the principle is the same, the embodiments in this specification will not be described again here.

[0158] Of course, in addition to software implementation, the electronic device described in this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0159] This specification also provides an embodiment of a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by a portable electronic device including multiple applications, enable the portable electronic device to perform... Figure 1 The method of the illustrated embodiment is specifically used to perform the following operations:

[0160] According to the received training instructions, the original question-answering robot is obtained and the original question-answering robot is initialized. The training instructions carry the business identifier corresponding to the original question-answering robot, and the original question-answering robot is pre-configured with at least two algorithm models.

[0161] According to the training instructions, corpus data corresponding to the business identifier is obtained from historical dialogue data, wherein the corpus data includes user questions and answers corresponding to the user questions;

[0162] Obtain a preset standard corpus corresponding to the business identifier, and generate a training dataset based on the corpus data and the standard corpus, wherein the standard corpus includes standard questions and standard answers corresponding to the business identifier;

[0163] Among the at least two pre-configured algorithm models of the original question-answering robot, determine the training algorithm model corresponding to the training dataset;

[0164] The training dataset is input into the original question-answering robot so that the original question-answering robot can determine the question intent of each training data in the training dataset, and perform answer search according to the training algorithm model for each question intent, and output the predicted answer.

[0165] Construct a target loss function based on the predicted answer and the standard answer;

[0166] The original question-answering robot is iteratively trained based on the target loss function to obtain the target question-answering robot.

[0167] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0168] In summary, the above description is merely a preferred embodiment of this specification and is not intended to limit the scope of protection of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.

[0169] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or physical entities, or by products with certain functions. A typical implementation device is a computer.

[0170] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0171] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0172] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. A training method for a question-answering robot, characterized in that, include: According to the received training instructions, the original question-answering robot is obtained and the original question-answering robot is initialized. The training instructions carry the business identifier corresponding to the original question-answering robot, and the original question-answering robot is pre-configured with at least two algorithm models. According to the training instructions, corpus data corresponding to the business identifier is obtained from historical dialogue data, wherein the corpus data includes user questions and answers corresponding to the user questions; Obtain a preset standard corpus corresponding to the business identifier, and generate a training dataset based on the corpus data and the standard corpus, wherein the standard corpus includes standard questions and standard answers corresponding to the business identifier; Among the at least two pre-configured algorithm models of the original question-answering robot, determine the training algorithm model corresponding to the training dataset; The training dataset is input into the original question-answering robot so that the original question-answering robot can determine the question intent of each training data in the training dataset, and perform answer search according to the training algorithm model for each question intent, and output the predicted answer. Construct a target loss function based on the predicted answer and the standard answer; The original question-answering robot is iteratively trained based on the target loss function to obtain the target question-answering robot.

2. The method according to claim 1, characterized in that, Based on the received training instructions, the original question-answering robot is obtained, and the original question-answering robot is initialized, specifically including: Obtain a pre-set public knowledge base, wherein the public knowledge base includes general corpus data corresponding to a general domain, wherein the general corpus data includes general questions and general answers corresponding to the general questions; The public knowledge base is loaded into the original question-answering robot to complete the initialization process of the original question-answering robot.

3. The method according to claim 1, characterized in that, Obtain a preset standard corpus corresponding to the business identifier, and generate a training dataset based on the corpus data and the standard corpus, specifically including: Determine the similarity between the corpus data and the standard corpus; Based on the similarity between the corpus data and the standard corpus, similar user questions for the standard question are determined; A training dataset is generated based on the corpus data, the standard corpus, and the similar user questions.

4. The method according to claim 3, characterized in that, Determining the similarity between the corpus data and the standard corpus specifically includes: Semantic recognition is performed on the corpus data and the standard corpus to determine the first intent corresponding to the user question in the corpus data and the second intent corresponding to the standard question in the standard corpus. Determine the first keyword corresponding to the user question and the second keyword corresponding to the standard question; The similarity between the user question and the standard question is determined based on the similarity between the first keyword and the second keyword, and the similarity between the first intent and the second intent.

5. The method according to claim 3, characterized in that, Based on the similarity between the corpus data and the standard corpus, similar user questions to the standard questions are determined, specifically including: User questions with a similarity greater than a preset threshold are considered as similar user questions to the standard question. Based on the similar user questions, a set of user questions corresponding to the standard question is generated.

6. The method according to claim 5, characterized in that, Based on the corpus data, the standard corpus, and the similar user questions, a training dataset is generated, specifically including: The standard answer corresponding to the standard question is used as the answer to each similar user question in the user question set corresponding to the standard question to generate the first training dataset; Questions from users whose similarity is less than a preset threshold are considered as new user questions; A second training dataset is generated based on the new user question and the corresponding answer. The training dataset is generated based on the first training dataset and the second training dataset.

7. A question-answering method based on a question-answering robot, characterized in that, include: Obtain the unanswered questions entered by the user through the terminal device; The question to be answered is input into a pre-trained question-answering robot. The question-answering robot performs semantic recognition on the question to be answered to determine the question intent and question keywords corresponding to the question to be answered. The question-answering robot is trained based on the method described in any one of claims 1 to 6. The system searches for answers based on the intent of the question and the keywords used in the question to obtain the response information corresponding to the question to be answered, and then returns the response information to the user.

8. A training device for a question-answering robot, characterized in that, include: The original robot initialization module is used to obtain the original question-answering robot according to the received training instructions and to initialize the original question-answering robot. The training instructions carry the business identifier corresponding to the original question-answering robot, and the original question-answering robot is pre-configured with at least two algorithm models. The corpus acquisition module is used to acquire corpus data corresponding to the business identifier from historical dialogue data according to the training instructions, wherein the corpus data includes user questions and answers corresponding to the user questions; The training dataset generation module is used to obtain a preset standard corpus corresponding to the business identifier, and generate a training dataset based on the corpus data and the standard corpus, wherein the standard corpus includes standard questions and standard answers in the business domain corresponding to the business identifier; The algorithm model determination module is used to determine the training algorithm model corresponding to the training dataset from at least two pre-configured algorithm models of the original question-answering robot. The training module is used to input the training dataset into the original question-answering robot, so that the original question-answering robot outputs a predicted answer according to the training algorithm model; constructs a target loss function based on the predicted answer and the standard answer; and iteratively trains the original question-answering robot based on the target loss function to obtain a target question-answering robot.

9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1 to 7.