Question and answer method, device, computer equipment and storage medium
The semantic representation vectors are extracted and clustered through the question recognition model, and the vector categories are determined to obtain standard answers. This solves the problem of low answer accuracy in traditional question-and-answer systems and achieves more accurate question-and-answer answers.
Patent Information
- Application Number
- CN202011525830.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-22
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2040-12-22
AI Technical Summary
The answers in traditional question and answer systems have low accuracy, resulting in inaccurate information obtained by users.
Feature extraction is performed through the question recognition model, the target semantic representation vector is obtained, and the target vector category is determined based on clustering and vector similarity, and the corresponding standard answers are obtained, thereby improving the accuracy of the answer.
It improves the accuracy of the answers, ensures the accurate answers of questions, and enhances the reliability of the question-and-answer system.
Smart Images

Figure CN112632248B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a question-answering method, apparatus, computer device, and storage medium. Background Art
[0002] With the development of science and technology, answer searches are needed in many cases. For example, intelligent customer service robots can search for answers based on user questions and output answers. Users can also enter questions on search engines, and search engines search based on the questions and display the answers obtained from the search.
[0003] In conventional techniques, when determining an answer, the answer obtained is often inaccurate, resulting in low accuracy of the answer. Summary of the invention
[0004] Based on this, it is necessary to provide a question-answering method, device, computer equipment and storage medium to address the above technical issues.
[0005] A question-answering method, the method comprising: obtaining a target question to be answered; inputting the target sentence into a question recognition model for feature extraction to obtain a target semantic representation vector; obtaining a target vector category corresponding to the target semantic representation vector, the target vector category corresponding to a plurality of standard semantic representation vectors, the standard semantic representation vector being obtained by inputting a standard question into the question recognition model for feature extraction; obtaining a target knowledge point corresponding to the target vector category, taking the standard answer corresponding to the target knowledge point as the answer corresponding to the target question, the standard answer corresponding to the target knowledge point being the answer corresponding to the standard question.
[0006] In some embodiments, the target vector category is screened from a set of candidate vector categories, and the method further includes: obtaining a set of standard questions; inputting each standard question in the set of standard questions into the question recognition model for feature extraction to obtain a set of semantic representation vectors, wherein the set of semantic representation vectors includes standard semantic representation vectors corresponding to each of the standard questions; clustering the set of semantic representation vectors to obtain a set of candidate vector categories; establishing a knowledge correspondence between the knowledge points corresponding to each candidate vector category in the set of candidate vector categories and the standard answers to the standard questions corresponding to the candidate vector categories, so as to obtain the answer corresponding to the target question based on the knowledge correspondence.
[0007] In some embodiments, obtaining the target vector category corresponding to the target semantic representation vector includes: obtaining the category representation vector corresponding to each of the candidate vector categories, the category representation vector being obtained based on the standard semantic representation vector corresponding to the candidate vector category; obtaining the vector similarity between the target semantic representation vector and each of the category representation vectors; and taking the candidate vector category corresponding to the category representation vector with the greatest vector similarity as the target vector category corresponding to the target semantic representation vector.
[0008] In some embodiments, the training step of the question recognition model includes: obtaining conversational questions in a conversation and multiple answer statements corresponding to the conversational questions; performing intent recognition based on an answer statement set composed of the answer statements to obtain a standard intent corresponding to the answer statement set; obtaining a predicted intent corresponding to the conversational questions based on the conversational questions and the question recognition model to be trained; obtaining a model loss value based on the difference between the standard intent and the predicted intent, and adjusting the model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
[0009] In some embodiments, the intent recognition is performed on the answer sentence set composed of the answer sentences to obtain the standard intent corresponding to the answer sentence set, including: performing word segmentation processing on each answer sentence in the answer sentence set based on the answer sentence as a unit to obtain a word segmentation set corresponding to each answer sentence, and the word segmentation sets corresponding to each answer sentence constitute an answer word segmentation set; and obtaining the standard intent corresponding to the answer sentence set based on the answer word segmentation set.
[0010] In some embodiments, obtaining the standard intent corresponding to the answer sentence set based on the answer word segmentation set includes: identifying the answer word segmentation set based on an intent recognition model to obtain the standard intent corresponding to the answer sentence set, and the intent recognition model is a non-time series model.
[0011] In some embodiments, there are multiple conversational questions, and obtaining the predicted intent corresponding to the conversational questions based on the conversational questions and the question recognition model to be trained includes: splicing the conversational questions in the order of conversation to obtain spliced questions; performing word segmentation on the spliced questions, arranging the segmented words in the order of the segmentations in the spliced questions, and obtaining a segmentation sequence; and using the question recognition model to be trained based on a time series to recognize the segmentation sequence to obtain the predicted intent corresponding to the conversational questions.
[0012] In some embodiments, the training step of the question recognition model includes: obtaining a multi-round question sequence in a multi-round conversation and a multi-round answer set in the multi-round conversation; performing intent recognition based on the multi-round answer set to obtain a multi-round conversation intention corresponding to the multi-round answer set; based on the multi-round question sequence and the question recognition model to be trained, obtaining a multi-round predicted intention corresponding to the multi-round question sequence; obtaining a model loss value based on the difference between the multi-round conversation intention and the multi-round predicted intention, and adjusting the model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
[0013] A question-answering device, the device comprising: a target question acquisition module, used to acquire a target question to be answered; a target semantic representation vector acquisition module, used to input the target sentence into a question recognition model for feature extraction, and obtain a target semantic representation vector; a target vector category acquisition module, used to acquire a target vector category corresponding to the target semantic representation vector, the target vector category corresponds to a plurality of standard semantic representation vectors, the standard semantic representation vector is obtained by inputting a standard question into the question recognition model for feature extraction; an answer acquisition module, used to acquire a target knowledge point corresponding to the target vector category, and use the standard answer corresponding to the target knowledge point as the answer corresponding to the target question, and the standard answer corresponding to the target knowledge point is the answer corresponding to the standard question.
[0014] In some embodiments, the target vector category is obtained by screening from a candidate vector category set, and the device also includes: a standard question set acquisition module, used to acquire a standard question set; a semantic representation vector set acquisition module, used to input each standard question in the standard question set into the question recognition model for feature extraction, and obtain a semantic representation vector set, wherein the semantic representation vector set includes standard semantic representation vectors corresponding to each standard question; a clustering module, used to cluster the semantic representation vector set to obtain a candidate vector category set; a correspondence determination module, used to establish a knowledge correspondence between the knowledge points corresponding to each candidate vector category in the candidate vector category set and the standard answers to the standard questions corresponding to the candidate vector categories, so as to obtain the answer corresponding to the target question based on the knowledge correspondence.
[0015] In some embodiments, the target vector category acquisition module is used to: obtain the category representation vector corresponding to each of the candidate vector categories, the category representation vector being obtained based on the standard semantic representation vector corresponding to the candidate vector category; obtain the vector similarity between the target semantic representation vector and each of the category representation vectors; and take the candidate vector category corresponding to the category representation vector with the greatest vector similarity as the target vector category corresponding to the target semantic representation vector.
[0016] In some embodiments, the training module of the question recognition model is used to: obtain conversational questions in a conversation and multiple answer statements corresponding to the conversational questions; perform intent recognition based on an answer statement set composed of the answer statements to obtain a standard intent corresponding to the answer statement set; obtain a predicted intent corresponding to the conversational questions based on the conversational questions and the question recognition model to be trained; obtain a model loss value based on the difference between the standard intent and the predicted intent, and adjust the model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
[0017] In some embodiments, the training module is used to: perform word segmentation processing on each answer sentence in the answer sentence set based on the answer sentence as a unit to obtain a word segmentation set corresponding to each answer sentence, and the word segmentation sets corresponding to each answer sentence constitute an answer word segmentation set; and obtain the standard intent corresponding to the answer sentence set based on the answer word segmentation set.
[0018] In some embodiments, the training module is used to: identify the answer word set based on an intent recognition model to obtain the standard intent corresponding to the answer sentence set, and the intent recognition model is a non-time series model.
[0019] In some embodiments, there are multiple conversational questions, and the training module is used to: splice the conversational questions in the order of conversation to obtain spliced questions; perform word segmentation on the spliced questions, arrange the segmented words in the order of the segmentation in the spliced questions, and obtain a segmentation sequence; use the time series-based question recognition model to be trained to identify the segmentation sequence to obtain the predicted intent corresponding to the conversational questions.
[0020] In some embodiments, the training module of the question recognition model is used to: obtain a multi-round question sequence in a multi-round conversation and a multi-round answer set in the multi-round conversation; perform intent recognition based on the multi-round answer set to obtain a multi-round conversation intention corresponding to the multi-round answer set; obtain a multi-round predicted intention corresponding to the multi-round question sequence based on the multi-round question sequence and the question recognition model to be trained; obtain a model loss value based on the difference between the multi-round conversation intention and the multi-round predicted intention, and adjust the model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
[0021] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: obtaining a target question to be answered; inputting the target sentence into a question recognition model for feature extraction to obtain a target semantic representation vector; obtaining a target vector category corresponding to the target semantic representation vector, wherein the target vector category corresponds to a plurality of standard semantic representation vectors, and the standard semantic representation vector is obtained by inputting a standard question into the question recognition model for feature extraction; obtaining a target knowledge point corresponding to the target vector category, and using the standard answer corresponding to the target knowledge point as the answer corresponding to the target question, and the standard answer corresponding to the target knowledge point is the answer corresponding to the standard question.
[0022] In some embodiments, the target vector category is screened from a set of candidate vector categories, and the method further includes: obtaining a set of standard questions; inputting each standard question in the set of standard questions into the question recognition model for feature extraction to obtain a set of semantic representation vectors, wherein the set of semantic representation vectors includes standard semantic representation vectors corresponding to each of the standard questions; clustering the set of semantic representation vectors to obtain a set of candidate vector categories; establishing a knowledge correspondence between the knowledge points corresponding to each candidate vector category in the set of candidate vector categories and the standard answers to the standard questions corresponding to the candidate vector categories, so as to obtain the answer corresponding to the target question based on the knowledge correspondence.
[0023] In some embodiments, obtaining the target vector category corresponding to the target semantic representation vector includes: obtaining the category representation vector corresponding to each of the candidate vector categories, the category representation vector being obtained based on the standard semantic representation vector corresponding to the candidate vector category; obtaining the vector similarity between the target semantic representation vector and each of the category representation vectors; and taking the candidate vector category corresponding to the category representation vector with the greatest vector similarity as the target vector category corresponding to the target semantic representation vector.
[0024] In some embodiments, the processor implements the steps of training the model when executing the computer program: including: obtaining conversational questions in the conversation and multiple answer statements corresponding to the conversational questions; performing intent recognition based on an answer statement set composed of the answer statements to obtain the standard intent corresponding to the answer statement set; obtaining the predicted intent corresponding to the conversational questions based on the conversational questions and the question recognition model to be trained; obtaining a model loss value based on the difference between the standard intent and the predicted intent, and adjusting the model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
[0025] In some embodiments, the intent recognition is performed on the answer sentence set composed of the answer sentences to obtain the standard intent corresponding to the answer sentence set, including: performing word segmentation processing on each answer sentence in the answer sentence set based on the answer sentence as a unit to obtain a word segmentation set corresponding to each answer sentence, and the word segmentation sets corresponding to each answer sentence constitute an answer word segmentation set; and obtaining the standard intent corresponding to the answer sentence set based on the answer word segmentation set.
[0026] In some embodiments, obtaining the standard intent corresponding to the answer sentence set based on the answer word segmentation set includes: identifying the answer word segmentation set based on an intent recognition model to obtain the standard intent corresponding to the answer sentence set, and the intent recognition model is a non-time series model.
[0027] In some embodiments, there are multiple conversational questions, and obtaining the predicted intent corresponding to the conversational questions based on the conversational questions and the question recognition model to be trained includes: splicing the conversational questions in the order of conversation to obtain spliced questions; performing word segmentation on the spliced questions, arranging the segmented words in the order of the segmentations in the spliced questions, and obtaining a segmentation sequence; and using the question recognition model to be trained based on a time series to recognize the segmentation sequence to obtain the predicted intent corresponding to the conversational questions.
[0028] In some embodiments, the training step of the question recognition model includes: obtaining a multi-round question sequence in a multi-round conversation and a multi-round answer set in the multi-round conversation; performing intent recognition based on the multi-round answer set to obtain a multi-round conversation intention corresponding to the multi-round answer set; based on the multi-round question sequence and the question recognition model to be trained, obtaining a multi-round predicted intention corresponding to the multi-round question sequence; obtaining a model loss value based on the difference between the multi-round conversation intention and the multi-round predicted intention, and adjusting the model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
[0029] A computer-readable storage medium stores a computer program, which implements the following steps when executed by a processor: obtaining a target question to be answered; inputting the target sentence into a question recognition model for feature extraction to obtain a target semantic representation vector; obtaining a target vector category corresponding to the target semantic representation vector, wherein the target vector category corresponds to a plurality of standard semantic representation vectors, wherein the standard semantic representation vector is obtained by inputting a standard question into the question recognition model for feature extraction; obtaining a target knowledge point corresponding to the target vector category, and using the standard answer corresponding to the target knowledge point as the answer corresponding to the target question, wherein the standard answer corresponding to the target knowledge point is the answer corresponding to the standard question.
[0030] In some embodiments, the target vector category is screened from a set of candidate vector categories, and the method further includes: obtaining a set of standard questions; inputting each standard question in the set of standard questions into the question recognition model for feature extraction to obtain a set of semantic representation vectors, wherein the set of semantic representation vectors includes standard semantic representation vectors corresponding to each of the standard questions; clustering the set of semantic representation vectors to obtain a set of candidate vector categories; establishing a knowledge correspondence between the knowledge points corresponding to each candidate vector category in the set of candidate vector categories and the standard answers to the standard questions corresponding to the candidate vector categories, so as to obtain the answer corresponding to the target question based on the knowledge correspondence.
[0031] In some embodiments, obtaining the target vector category corresponding to the target semantic representation vector includes: obtaining the category representation vector corresponding to each of the candidate vector categories, the category representation vector being obtained based on the standard semantic representation vector corresponding to the candidate vector category; obtaining the vector similarity between the target semantic representation vector and each of the category representation vectors; and taking the candidate vector category corresponding to the category representation vector with the greatest vector similarity as the target vector category corresponding to the target semantic representation vector.
[0032] In some embodiments, the processor implements the steps of training the model when executing the computer program: including: obtaining conversational questions in the conversation and multiple answer statements corresponding to the conversational questions; performing intent recognition based on an answer statement set composed of the answer statements to obtain the standard intent corresponding to the answer statement set; obtaining the predicted intent corresponding to the conversational questions based on the conversational questions and the question recognition model to be trained; obtaining a model loss value based on the difference between the standard intent and the predicted intent, and adjusting the model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
[0033] In some embodiments, the intent recognition is performed on the answer sentence set composed of the answer sentences to obtain the standard intent corresponding to the answer sentence set, including: performing word segmentation processing on each answer sentence in the answer sentence set based on the answer sentence as a unit to obtain a word segmentation set corresponding to each answer sentence, and the word segmentation sets corresponding to each answer sentence constitute an answer word segmentation set; and obtaining the standard intent corresponding to the answer sentence set based on the answer word segmentation set.
[0034] In some embodiments, obtaining the standard intent corresponding to the answer sentence set based on the answer word segmentation set includes: identifying the answer word segmentation set based on an intent recognition model to obtain the standard intent corresponding to the answer sentence set, and the intent recognition model is a non-time series model.
[0035] In some embodiments, there are multiple conversational questions, and obtaining the predicted intent corresponding to the conversational questions based on the conversational questions and the question recognition model to be trained includes: splicing the conversational questions in the order of conversation to obtain spliced questions; performing word segmentation on the spliced questions, arranging the segmented words in the order of the segmentations in the spliced questions, and obtaining a segmentation sequence; and using the question recognition model to be trained based on a time series to recognize the segmentation sequence to obtain the predicted intent corresponding to the conversational questions.
[0036] In some embodiments, the training step of the question recognition model includes: obtaining a multi-round question sequence in a multi-round conversation and a multi-round answer set in the multi-round conversation; performing intent recognition based on the multi-round answer set to obtain a multi-round conversation intention corresponding to the multi-round answer set; based on the multi-round question sequence and the question recognition model to be trained, obtaining a multi-round predicted intention corresponding to the multi-round question sequence; obtaining a model loss value based on the difference between the multi-round conversation intention and the multi-round predicted intention, and adjusting the model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
[0037] The above-mentioned question-answering method, device, computer equipment and storage medium obtain a target semantic representation vector representing the semantics of a question by performing feature extraction based on a question recognition model. Since there are multiple standard semantic representation vectors corresponding to the target vector category, the standard semantic representation vector is obtained by inputting a standard question into the question recognition model for feature extraction. Therefore, the target vector category corresponding to the target semantic representation vector can be accurately obtained, and the standard answer to the target knowledge point corresponding to the target vector category can accurately answer the target question, thereby improving the accuracy of the obtained answer. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A diagram of an application environment of a question-answering method in some embodiments;
[0039] Figure 2 Schematic diagram of the flow of question-answering methods in some embodiments;
[0040] Figure 3 Schematic diagram of the flow of question-answering methods in some embodiments;
[0041] Figure 4 is a flowchart of the training steps of the question recognition model in some embodiments;
[0042] Figure 5 A schematic diagram of a process of obtaining a predicted intention corresponding to a conversation question based on the conversation question and the question recognition model to be trained in some embodiments;
[0043] Figure 6 is a structural block diagram of a question-answering device in some embodiments;
[0044] Figure 7 is a structural block diagram of a question-answering device in some embodiments;
[0045] Figure 8 1 is a diagram of the internal structure of a computer device in some embodiments. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] The question-answering method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. When it is necessary to obtain the answer to the question, a request for obtaining the answer to the target question can be sent to the server 104 through the terminal 102, and the server can execute the method provided in the embodiment of the present application based on the target question, obtain the answer to the target question, and return it to the terminal 102. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster composed of multiple servers. Among them, the terminal can be the user's mobile phone. The method provided in the embodiment of the present application can be executed by an application that provides a phone answering function, and the application can be set in the server. Of course, it can also be set in the terminal.
[0048] In some embodiments, Figure 2 As shown, a question-answering method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:
[0049] Step S202: obtaining a target question to be answered.
[0050] The target question is a sentence in text form. If the user's question is output in voice form, text conversion can be performed to convert the voice into a sentence in text form as the target question.
[0051] Specifically, the server may receive a target question to be answered sent by the terminal. For example, the server may receive a search request, which is used to search for an answer to a question. The search request may carry the target question.
[0052] Step S204: input the target sentence into the question recognition model for feature extraction to obtain a target semantic representation vector.
[0053] Among them, the question recognition model is a model for question recognition, for example, it can be an LSTM (Long Short-Term Memory) model, and the question recognition model can include an input layer, a hidden layer, and a classification layer. When training the model, it can be trained based on a supervised training method. For example, the question recognition mode can be an intention recognition model, which is trained with the intention of the training sentence as a label. The hidden layer is used to semantically encode the sentence to obtain a semantic representation vector representing the semantics of the sentence, and the semantic representation vector is obtained by encoding the word vectors of the words of a sentence. The classification layer can perform classification based on the semantic representation vector, for example, to identify the intention of the sentence.
[0054] Specifically, after the target sentence is input into the trained question recognition model, the target sentence is processed using the input layer and the hidden layer without passing through the classification layer, that is, model training has one more classification layer than model use.
[0055] Step S206, obtaining a target vector category corresponding to the target semantic representation vector, the target vector category corresponds to a plurality of standard semantic representation vectors, the standard semantic representation vector is obtained by inputting a standard question into a question recognition model for feature extraction.
[0056] Among them, the standard semantic representation vector is a vector that expresses the semantics of a standard question, and the standard question is a question that already exists in the question and answer library. The standard semantic representation vector can be obtained by semantically encoding the questions in the question and answer library through the trained question recognition model. By clustering the obtained standard semantic representation vector, multiple candidate vector categories can be obtained, among which the target vector category is the category corresponding to the target semantic representation vector. Clustering refers to the process of dividing a set into classes composed of similar objects. The clustering method can be, for example, K-means (K-means clustering algorithm) clustering or spectral clustering, where K represents the number of categories, and K can be determined as needed.
[0057] Specifically, after obtaining the target semantic representation vector, it can be determined to which category the target semantic representation vector belongs, and the category is used as the target vector category.
[0058] Step S208, obtaining the target knowledge point corresponding to the target vector category, taking the standard answer corresponding to the target knowledge point as the answer corresponding to the target question, and the standard answer corresponding to the target knowledge point as the answer corresponding to the standard question.
[0059] Specifically, a knowledge point represents a kind of knowledge, and a vector category corresponds to a knowledge point. For example, a knowledge point can be a knowledge point for the protection of COVID-19. The knowledge point corresponding to the vector category is determined based on the sentence corresponding to the vector of the category, which can be set manually or automatically. For example, after 50 target vectors are determined, a person can analyze the knowledge points represented by each category and set the correspondence between the target vector category and the knowledge point. For another example, the server can perform keyword extraction on the sentence corresponding to the vector category, perform knowledge point recognition based on the extracted keyword set and the knowledge point recognition model, and obtain the knowledge point corresponding to the category.
[0060] The correspondence between the knowledge point and the standard answer is preset. For example, the answer to any question sentence corresponding to the target vector category may be used as the answer corresponding to the knowledge point.
[0061] Specifically, after the server obtains the target vector category, it can determine the corresponding knowledge point, determine the corresponding standard answer through the correspondence between the knowledge point and the standard answer, and use the standard answer as the answer corresponding to the standard question.
[0062] For example, assuming the target question is "I want to apply for a credit card", and assuming that the semantic representation vector of "I want to apply for a credit card" is determined to be vector A, then the similarity between vector A and the category representation vector representing the vector category can be calculated, and the category of the category representation vector with the greatest similarity is taken as the target vector category corresponding to vector A. Assuming it is B, the knowledge point corresponding to B can be determined. Assuming it is "credit card application", the standard answer corresponding to the credit card application can be obtained, such as "what kind of credit card do you want to apply for".
[0063] In the above question-answering method, a target semantic representation vector representing the semantics of the question is obtained by performing feature extraction based on a question recognition model. Since there are multiple standard semantic representation vectors corresponding to the target vector category, the standard semantic representation vector is obtained by inputting the standard question into the question recognition model for feature extraction. Therefore, the target vector category corresponding to the target semantic representation vector can be accurately obtained, and the standard answer to the target knowledge point corresponding to the target vector category can accurately answer the target question, thereby improving the accuracy of the obtained answer.
[0064] In some embodiments, the target vector category is obtained by screening from a set of candidate vector categories, such as Figure 3 As shown, the method also includes:
[0065] Step S302: Obtain a set of standard questions.
[0066] The standard question may be a question in a conversation log. For example, if the server stores the conversation data between the user and the manual customer service, the user's question may be used as a standard question. The standard question set includes multiple standard questions.
[0067] Specifically, questions asked by users who consult manual customer service in the conversation logs may be obtained as standard questions, thereby forming a set of standard questions.
[0068] In some embodiments, when the number of questions in the conversation log is relatively large, the files of the conversation log may be screened. For example, the user's rating of the manual customer service in a conversation may be obtained, and the questions in the conversation with a rating higher than a preset score may be selected as the standard questions. Alternatively, the user's rating of the manual customer service's answer may be obtained, and the questions corresponding to the answers with a rating higher than a preset score may be selected as the standard questions.
[0069] Step S304: input each standard question in the standard question set into a question recognition model for feature extraction to obtain a semantic representation vector set, wherein the semantic representation vector set includes a standard semantic representation vector corresponding to each standard question.
[0070] Specifically, the standard semantic representation vector is a vector that represents the semantics of a standard question. The standard question can be input into a trained question recognition model, and the hidden layer in the question recognition model can perform feature extraction based on the word vectors of each word segment in the standard question. After feature extraction, the extracted feature vector is directly output as the standard semantic representation vector. For example, assuming there are 1,000 standard questions, they are respectively input into the question recognition model for feature extraction to obtain 1,000 standard semantic representation vectors.
[0071] Step S306: cluster the semantic representation vector set to obtain a candidate vector category set.
[0072] The clustering may be performed by using a K-mean clustering method. The candidate vector category set includes K candidate vector categories, where K represents a plurality of candidate vector categories, and a plurality of candidate vector categories refers to at least two, for example, greater than three.
[0073] Specifically, after obtaining the semantic representation vector set, the vectors in the semantic representation vector set may be clustered based on a clustering method to divide the semantic representation vector set into multiple categories, each of which is a candidate vector category.
[0074] Step S308, establishing a knowledge correspondence between the knowledge point corresponding to each candidate vector category in the candidate vector category set and the standard answer to the standard question corresponding to the candidate vector category, so as to obtain the answer corresponding to the target question based on the knowledge correspondence.
[0075] Among them, the knowledge correspondence is the correspondence between the knowledge point and the standard answer. For example, if the knowledge point is "buy a mask for epidemic prevention", the corresponding standard answer is "for the new coronavirus pneumonia, only disposable medical surgical masks and N95 masks are effective, paper masks, activated carbon masks, cotton masks, etc. cannot block the virus." If the target question received is "how to buy a mask for epidemic prevention", and it is determined that the corresponding knowledge point is "buy a mask for epidemic prevention", the server can output the standard answer of "buy a mask for epidemic prevention".
[0076] In the embodiment of the present application, standard questions are identified and classified through the trained question recognition model, and then the correspondence between the knowledge points of the vector category and the answers is established. Therefore, the conversation questions in the conversation log can be sorted, and the conversation data between people that have been generated is fully utilized, so that the answers to the automatic replies are learned based on the replies of manual customer service to real users, which improves the convenience and accuracy of obtaining answers to field replies.
[0077] In some embodiments, obtaining a target vector category corresponding to a target semantic representation vector includes: obtaining a category representation vector corresponding to each candidate vector category, the category representation vector being obtained based on a standard semantic representation vector corresponding to the candidate vector category; obtaining the vector similarity between the target semantic representation vector and each category representation vector; and taking the candidate vector category corresponding to the category representation vector having the greatest vector similarity as the target vector category corresponding to the target semantic representation vector.
[0078] Among them, the category representation vector is a vector representing a category, and can be any one selected from the standard semantic representation vectors corresponding to the vector category as the category representation vector of the vector category, or the vector distance between the standard semantic representation vectors corresponding to the vector category can be calculated, and then the sum of the vector distances between each standard semantic representation vector and the vectors in the same vector category is counted, and the vector with the smallest sum of vector distances is selected as the category representation vector. For example, suppose there are three standard semantic representation vectors in a vector category: vector 1, vector 2, and vector 3. The distance between vector 1 and vector 2 is 0.5, the distance between vector 2 and vector 3 is 0.6, and the distance between vector 3 and vector 1 is 0.4. Then the sum of the distances corresponding to vector 1 is 0.5+0.4=0.9, the sum of the distances corresponding to vector 2 is 0.5+0.6=1.1, and the sum of the distances corresponding to vector 3 is 0.6+0.4=1.0. The vector with the smallest sum of distances is vector 1, so vector 1 can be regarded as the category representation vector corresponding to the vector category, so that the category representation vector can more accurately represent the category.
[0079] Vector similarity indicates the degree of similarity between vectors. The greater the similarity, the more similar they are. Vector similarity can be calculated using the cosine similarity algorithm. The similarity can be a value less than or equal to 1.
[0080] Specifically, the server can obtain the category representation vector corresponding to each candidate vector category, and then calculate the vector similarity between the target semantic representation vector and each category representation vector, select the category representation vector with the greatest similarity, and obtain the vector category corresponding to the category representation vector with the greatest similarity as the target vector category. For a practical example, assuming that there are 3 vector categories and 3 category representation vectors, A, B, and C, the target semantic representation vector is calculated to have a vector similarity of 0.1 with A, 0.2 with B, and 0.95 with C. Then, the category represented by the C vector can be obtained as the target vector category.
[0081] In some embodiments, when applied to an intelligent reply scenario based on artificial intelligence, if the vector similarity between the target semantic representation vector and each category representation vector is less than a preset similarity threshold, such as 0.5, it can be determined that the target question does not belong to any existing knowledge point. At this time, the step of sending the target question to the terminal corresponding to the manual customer service can be automatically triggered, and the answer sent by the terminal corresponding to the manual customer service is received and forwarded to the terminal that sent the target question. This makes it possible to manually reply to knowledge points that have not been learned. The server can also use the semantic representation vector of the target question as the vector corresponding to the new vector category. When a new question is received subsequently, if the vector similarity between the new question and the target question is higher than the preset similarity threshold, the answer to the manual reply corresponding to the target question is obtained, thereby realizing the update of the knowledge point.
[0082] In some embodiments, Figure 4 As shown in Figure 1, the training steps of the question recognition model include:
[0083] Step S402: obtaining conversation questions in the conversation and multiple answer sentences corresponding to the conversation questions.
[0084] Specifically, the conversation may be a multi-round conversation, where a multi-round conversation refers to a conversation in which multiple questions and multiple answers appear. The server may obtain multiple rounds of conversations in the conversation log between the manual customer service and the user. When obtaining the conversation statements of the conversation, the conversation questions of each round of conversation may be obtained separately, as well as multiple answer statements corresponding to the conversation questions of that round. For example, assuming a conversation is "U: I want to apply for a card, a credit card, which can be paid in installments. A: Is the card platinum or black gold, and what is the type of the card? U: What is a platinum credit card", where U represents the user and A represents the manual customer service, then "U: I want to apply for a card, a credit card, which can be paid in installments. A: Platinum or black gold, and what is the type of the card?" is a round of conversation. One question corresponds to multiple answer statements, for example, "Is the card platinum or black gold" is one answer statement, and "What is the type of card?" is another answer statement.
[0085] Step S404, performing intent recognition based on the answer sentence set composed of the answer sentences, and obtaining the standard intent corresponding to the answer sentence set.
[0086] Specifically, when identifying the intent, the intent is identified based on the answer sentence set, so that the intent identification can be more accurate. The server can identify the answer sentence as a whole answer and use the identified intent as the standard intent.
[0087] In some embodiments, the server may perform intent recognition on the answer sentence set based on other trained intent recognition models, or may perform word segmentation on the answer sentence set to obtain a word segmentation set, and select the intent corresponding to the entity word with the highest appearance as the standard intent based on the frequency of occurrence of each word segmentation in the word segmentation set. The word segmentation is the word obtained by word segmentation of the text.
[0088] In some embodiments, intent recognition is performed based on an answer sentence set composed of answer sentences to obtain the standard intent corresponding to the answer sentence set, including: performing word segmentation processing on each answer sentence in the answer sentence set based on the answer sentence as a unit to obtain a word segmentation set corresponding to each answer sentence, wherein the word segmentation sets corresponding to each answer sentence constitute an answer word segmentation set; and obtaining the standard intent corresponding to the answer sentence set based on the answer word segmentation set.
[0089] Specifically, during word segmentation, each answer sentence is segmented separately instead of being spliced together for word segmentation, that is, the answer sentence is segmented as a unit. After obtaining the answer word segmentation set, the standard intent can be determined based on each word segmentation set. For example, keywords can be obtained based on word frequency-inverse document frequency, and the standard intent can be obtained based on the correspondence between preset keywords and intents. It is also possible to input each answer word segmentation of the answer word segmentation set into an intent recognition model for recognition to obtain the standard intent corresponding to the answer sentence set. The intent recognition model is a non-time series model, that is, a model that does not consider the order of words in the sentence during recognition. For example, it can be a bag of words model (BOW). Based on the non-time series model, the intent corresponding to the answer can be determined based on the meaning of the words in the sentence while ignoring the order of the words.
[0090] Step S406, based on the conversation question and the question recognition model to be trained, obtain the predicted intent corresponding to the conversation question.
[0091] Specifically, the conversation question can be input into a trained question recognition model, and the question recognition model outputs the predicted intention of the conversation question.
[0092] Step S408, obtaining a model loss value based on the difference between the standard intent and the predicted intent, and adjusting the model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
[0093] Specifically, the standard intent is the label of the training sample during model training. The model loss value is obtained based on the difference between the standard intent and the predicted intent, for example, it can be calculated using a cross entropy algorithm, where the model loss value is positively correlated with the difference, that is, the greater the difference, the greater the loss value. After obtaining the loss value, the gradient descent method can be used to adjust the model parameters in the direction of reducing the loss value until the model converges. Model convergence can be at least one of the model loss value being less than a preset threshold or the number of training times reaching a preset number of times.
[0094] In the embodiment of the present application, questions in the conversation are used as sentences for model training, and the intentions obtained based on the answers to the questions are used as labels for model training, so that a model that accurately recognizes questions can be obtained. The conversation log records can be sorted out through the trained model to obtain a sorted question and answer knowledge base.
[0095] In some embodiments, a round of conversation contains multiple conversation questions, such as Figure 5 As shown, based on the conversation questions and the question recognition model to be trained, the predicted intent corresponding to the conversation questions includes:
[0096] Step S502, concatenating the conversation questions in the conversation order to obtain concatenated questions.
[0097] Specifically, if multiple conversation questions are obtained, the conversation questions can be spliced together according to the time sequence of the conversation to obtain a spliced question.
[0098] Step S504, performing word segmentation processing on the concatenated question sentence, arranging the segmented words according to the order of the segmented words in the concatenated question sentence, and obtaining a segmentation sequence.
[0099] Specifically, the word segmentation can be performed based on a dictionary method. After the word segmentation is obtained, the word segmentation is arranged in sequence according to the order of the word segmentation in the spliced question sentence to obtain a word segmentation sequence. For example, after the word segmentation of "ABCDEFG", the obtained word segmentation sequence may be "AB, C, DE, F, G".
[0100] Step S506: Use the time series-based question recognition model to recognize the word segmentation sequence to obtain the predicted intent corresponding to the conversation question.
[0101] Specifically, a time series-based model refers to a model that takes the order of words in a text into consideration during recognition, such as an LSTM model. By performing intent recognition based on a time series model, it is possible to obtain accurate intent by considering contextual semantics.
[0102] In some embodiments, the training steps of the question recognition model include: obtaining multi-round question sequences and multi-round answer sets in multi-round conversations; performing intent recognition based on the multi-round answer sets to obtain multi-round conversation intentions corresponding to the multi-round answer sets; obtaining multi-round predicted intentions corresponding to the multi-round question sequences based on the multi-round question sequences and the question recognition model to be trained; obtaining a model loss value based on the difference between the multi-round predicted intentions and the multi-round conversation intentions, and adjusting the model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
[0103] The conversation questions of each round in the multi-round dialogue can be spliced together to obtain a multi-round question sequence as a whole question, for example, "I want to apply for a card, a credit card, can be paid in installments" and "What is a platinum credit card" can be spliced together. The answer sentences of each round in the multi-round dialogue can also be spliced together to obtain a multi-round answer set as a whole answer. Based on the overall answer, the corresponding intention is determined as the multi-round conversation intention. By simplifying the multi-round dialogue into a single-round dialogue, the standard intention of the entire conversation can be determined by integrating the answers of the entire conversation, that is, the multi-round conversation intention, and the predicted intention of the entire conversation can be determined by integrating the questions of the entire conversation, that is, the multi-round predicted intention. Among them, the questions in the multi-round dialogue can be integrated into a question sequence with a word order, so that when identifying the questions, the order of the questions is comprehensively considered, that is, the question recognition model is a model based on a time series. The corresponding multiple answers are integrated into an answer set without the order of words, so that when determining the multi-round conversation intention, the order of words is not considered, that is, the model for identifying the intention of the answer set is a non-time series model. Thus, questions and answers can be processed in batches to obtain knowledge points, which improves efficiency. For example, in a multi-round conversation, there are two rounds. The answer corresponding to the question Q1 in the first round is A1 (Q1##A1), and the answer corresponding to the question Q2 in the second round is A2 (Q2##A2). Then it can be converted into Q##A, where Q=Q1Q2 and A=A1A2, which is equivalent to making the question unique, but the arrangement of the answers is not necessarily unique, that is, it is assumed that the questions in Q are ordered, and the answers in A are unordered.
[0104] The multi-round conversation intention is the label of the training sample during model training. The model loss value is obtained based on the difference between the multi-round conversation intention and the multi-round prediction intention. For example, it can be calculated using the cross entropy algorithm, where the model loss value is positively correlated with the difference, that is, the greater the difference, the greater the loss value. After obtaining the loss value, the gradient descent method can be used to adjust the model parameters in the direction of reducing the loss value until the model converges. Model convergence can be at least one of the model loss value being less than a preset threshold or the number of training times reaching a preset number of times.
[0105] It should be understood that, although the various steps in the above flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowchart may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0106] In some embodiments, Figure 6 As shown, a question-answering device is provided, comprising:
[0107] A target question acquisition module 602 is used to acquire a target question to be answered;
[0108] A target semantic representation vector obtaining module 604 is used to input the target sentence into the question recognition model for feature extraction to obtain the target semantic representation vector;
[0109] The target vector category acquisition module 606 is used to acquire the target vector category corresponding to the target semantic representation vector. The target vector category corresponds to a plurality of standard semantic representation vectors. The standard semantic representation vector is obtained by inputting a standard question into a question recognition model for feature extraction.
[0110] The answer obtaining module 608 is used to obtain the target knowledge point corresponding to the target vector category, and use the standard answer corresponding to the target knowledge point as the answer corresponding to the target question sentence, and the standard answer corresponding to the target knowledge point is the answer corresponding to the standard question sentence.
[0111] In some embodiments, Figure 7 As shown, the target vector category is obtained by screening from a set of candidate vector categories, and the device further includes:
[0112] A standard question set acquisition module 702 is used to acquire a standard question set;
[0113] A semantic representation vector set obtaining module 704 is used to input each standard question in the standard question set into the question recognition model for feature extraction to obtain a semantic representation vector set, wherein the semantic representation vector set includes a standard semantic representation vector corresponding to each standard question;
[0114] A clustering module 706 is used to cluster the semantic representation vector set to obtain a candidate vector category set;
[0115] The correspondence determination module 708 is used to establish a knowledge correspondence between the knowledge points corresponding to each candidate vector category in the candidate vector category set and the standard answers to the standard questions corresponding to the candidate vector categories, so as to obtain the answer corresponding to the target question based on the knowledge correspondence.
[0116] In some embodiments, the target vector category acquisition module is used to: obtain the category representation vector corresponding to each candidate vector category, the category representation vector is obtained based on the standard semantic representation vector corresponding to the candidate vector category; obtain the vector similarity between the target semantic representation vector and each category representation vector; and take the candidate vector category corresponding to the category representation vector with the largest vector similarity as the target vector category corresponding to the target semantic representation vector.
[0117] In some embodiments, the training module of the question recognition model is used to: obtain conversational questions in a conversation and multiple answer statements corresponding to the conversational questions; perform intent recognition based on an answer statement set composed of the answer statements to obtain the standard intent corresponding to the answer statement set; obtain the predicted intent corresponding to the conversational questions based on the conversational questions and the question recognition model to be trained; obtain a model loss value based on the difference between the standard intent and the predicted intent, and adjust the model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
[0118] In some embodiments, the training module is used to: perform word segmentation processing on each answer sentence in the answer statement set based on the answer sentence as a unit to obtain a word segmentation set corresponding to each answer sentence, and the word segmentation sets corresponding to each answer sentence constitute an answer word segmentation set; and obtain the standard intent corresponding to the answer sentence set based on the answer word segmentation set.
[0119] In some embodiments, the training module is used to: identify the answer word set based on the intent recognition model to obtain the standard intent corresponding to the answer sentence set, and the intent recognition model is a non-time series model.
[0120] In some embodiments, there are multiple conversational questions, and the training module is used to: splice the conversational questions in the order of the conversation to obtain spliced questions; perform word segmentation on the spliced questions, and arrange the segmented words in the order of the segmented words in the spliced questions to obtain a segmentation sequence; use a time series-based question recognition model to be trained to identify the segmentation sequence to obtain the predicted intent corresponding to the conversational questions.
[0121] In some embodiments, the training module of the question recognition model is used to: obtain multi-round question sequences and multi-round answer sets in multi-round conversations; perform intent recognition based on the multi-round answer sets to obtain multi-round conversation intentions corresponding to the multi-round answer sets; obtain multi-round predicted intentions corresponding to the multi-round question sequences based on the multi-round question sequences and the question recognition model to be trained; obtain a model loss value based on the difference between the multi-round predicted intentions and the multi-round conversation intentions, and adjust the model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
[0122] For the specific definition of the question-answering device, please refer to the definition of the question-answering method above, which will not be repeated here. Each module in the above-mentioned question-answering device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0123] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store a question and answer library. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a question and answer method is implemented.
[0124] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0125] In some embodiments, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned question-and-answer method when executing the computer program.
[0126] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned question-and-answer method are implemented.
[0127] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0128] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0129] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A question-answering method, characterized in that: The method comprises: Obtain the target question to be answered; Inputting the target question into a question recognition model to extract features and obtain a target semantic representation vector; Obtaining a target vector category corresponding to the target semantic representation vector, wherein the target vector category corresponds to a plurality of standard semantic representation vectors, and the standard semantic representation vectors are obtained by inputting a standard question into the question recognition model for feature extraction; Obtaining a target knowledge point corresponding to the target vector category, taking the standard answer corresponding to the target knowledge point as the answer corresponding to the target question, the standard answer corresponding to the target knowledge point being the answer corresponding to the standard question; the target knowledge point is determined according to the question corresponding to the vector of the target vector category; The training steps of the question recognition model include: Acquire a conversation question in a conversation and a plurality of answer statements corresponding to the conversation question; Performing intent recognition based on the answer sentence set composed of the answer sentences to obtain the standard intent corresponding to the answer sentence set; Based on the conversation question and the question recognition model to be trained, obtaining the predicted intent corresponding to the conversation question; A model loss value is obtained based on the difference between the standard intent and the predicted intent, and model parameters of the question recognition model to be trained are adjusted based on the model loss value to obtain a trained question recognition model.
2. The method according to claim 1, characterized in that The target vector category is obtained by screening from a set of candidate vector categories, and the method further includes: Get a set of standard questions; Inputting each standard question in the standard question set into the question recognition model for feature extraction to obtain a semantic representation vector set, wherein the semantic representation vector set includes a standard semantic representation vector corresponding to each standard question; Clustering the semantic representation vector set to obtain a candidate vector category set; A knowledge correspondence between the knowledge point corresponding to each candidate vector category in the candidate vector category set and the standard answer to the standard question corresponding to the candidate vector category is established, so as to obtain the answer corresponding to the target question based on the knowledge correspondence.
3. The method according to claim 2, characterized in that The step of obtaining the target vector category corresponding to the target semantic representation vector includes: Obtaining a category representation vector corresponding to each candidate vector category, wherein the category representation vector is obtained based on a standard semantic representation vector corresponding to the candidate vector category; Obtaining vector similarity between the target semantic representation vector and each of the category representation vectors; The candidate vector category corresponding to the category representation vector with the greatest vector similarity is used as the target vector category corresponding to the target semantic representation vector.
4. The method according to claim 1, characterized in that The intention recognition is performed based on the answer sentence set composed of the answer sentences to obtain the standard intention corresponding to the answer sentence set, including: Taking answer sentences as units, each answer sentence in the answer sentence set is subjected to word segmentation processing to obtain a word segmentation set corresponding to each answer sentence, wherein the word segmentation sets corresponding to each answer sentence constitute an answer word segmentation set; The standard intent corresponding to the answer sentence set is obtained based on the answer word segmentation set.
5. The method according to claim 4, characterized in that The standard intent corresponding to the answer sentence set obtained based on the answer word set includes: The answer word set is identified based on an intention recognition model to obtain the standard intention corresponding to the answer sentence set, and the intention recognition model is a non-time series model.
6. The method according to claim 1, characterized in that There are multiple conversation questions, and obtaining the predicted intent corresponding to the conversation questions based on the conversation questions and the question recognition model to be trained includes: splicing the conversation questions according to the conversation order to obtain spliced questions; Performing word segmentation processing on the concatenated question sentence, arranging the segmented words according to the order of the segmented words in the concatenated question sentence, and obtaining a segmentation sequence; The word segmentation sequence is identified using a question recognition model to be trained based on a time series to obtain a predicted intent corresponding to the conversation question.
7. The method according to claim 1, characterized in that The training step of the question recognition model also includes: Acquire a multi-round question sequence in a multi-round conversation and a multi-round answer set in the multi-round conversation; Performing intent recognition based on the multiple answer sets to obtain multiple conversation intents corresponding to the multiple answer sets; Based on the multiple question sequences and the question recognition model to be trained, obtaining multiple predicted intentions corresponding to the multiple question sequences; A model loss value is obtained based on the difference between the multi-round conversation intentions and the multi-round predicted intentions, and a model parameter of the question recognition model to be trained is adjusted based on the model loss value to obtain a trained question recognition model.
8. A question-answering device, characterized in that: The device comprises: A target question acquisition module is used to acquire the target question to be answered; A target semantic representation vector obtaining module is used to input the target question into a question recognition model for feature extraction to obtain a target semantic representation vector; A target vector category acquisition module is used to acquire a target vector category corresponding to the target semantic representation vector, wherein the target vector category corresponds to a plurality of standard semantic representation vectors, and the standard semantic representation vector is obtained by inputting a standard question into the question recognition model for feature extraction; The answer obtaining module is used to obtain the target knowledge point corresponding to the target vector category, and use the standard answer corresponding to the target knowledge point as the answer corresponding to the target question sentence, and the standard answer corresponding to the target knowledge point is the answer corresponding to the standard question sentence; the target knowledge point is determined according to the question sentence corresponding to the vector of the target vector category; A training module is used to obtain conversational questions in a conversation and multiple answer sentences corresponding to the conversational questions; perform intent recognition based on an answer sentence set composed of the answer sentences to obtain a standard intent corresponding to the answer sentence set; obtain a predicted intent corresponding to the conversational questions based on the conversational questions and a question recognition model to be trained; obtain a model loss value based on the difference between the standard intent and the predicted intent, and adjust model parameters of the question recognition model to be trained based on the model loss value to obtain a trained question recognition model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
