A retrieval-based question answering method and device

By performing similarity calculations and character length analysis in a question-answering database, combined with a deep learning model, the contradiction between accuracy, timeliness, and comprehensiveness in existing question-answering methods is resolved, achieving efficient question answering for different types of text data.

CN115952269BActive Publication Date: 2025-12-16GREAT WALL MOTOR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310011719.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-05
Publication Date
2025-12-16
Estimated Expiration
2043-01-05

AI Technical Summary

Technical Problem

While existing AI question-answering methods can ensure accuracy, they struggle to improve timeliness and comprehensiveness, especially when dealing with different types of text data, where matching errors are common.

Method used

By calculating the similarity between the question and similar questions in the question-answering database, when a target similar question exists, the answer is output based on the standard question corresponding to the similar question; when no target similar question exists, the answer is determined based on the character length of the question, including the use of deep learning models for intent recognition.

Benefits of technology

It improves the timeliness and comprehensiveness of question and answer, ensuring accurate output of answers for different types of text data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115952269B_ABST
    Figure CN115952269B_ABST
Patent Text Reader

Abstract

The application discloses a retrieval formula-based question and answer method and device, which can be applied to the field of artificial intelligence technology. The method comprises the following steps: calculating the similarity between a question and similar questions in a question and answer database; the question and answer database comprises standard questions, answers to the standard questions and similar questions corresponding to the standard questions; when a target similar question exists in the question and answer database, outputting the answer to the question according to the answer to the standard question corresponding to the target similar question in the question and answer database; the target similar question is a similar question with a similarity to the question reaching a first preset threshold; when the target similar question does not exist in the question and answer database, determining the answer to the question through an answer determination mode corresponding to the character length of the question, and outputting the answer to the question. In this way, by giving different answer determination modes for different types of text data, the timeliness and comprehensiveness of the question and answer are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a question and answer method and device based on a retrieval formula. BACKGROUND

[0002] Artificial intelligence includes a very wide range of science, which is composed of different fields such as machine learning, computer vision, etc. In general, a major goal of artificial intelligence research is to enable machines to perform complex work that usually requires human intelligence, in order to reduce the workload of humans, artificial intelligence has been increasingly valued.

[0003] Retrieval formula question and answer refers to a robot selecting a best answer from a knowledge base for a user through retrieval, thereby realizing question and answer. The existing artificial intelligence question and answer method has certain limitations and is prone to matching errors.

[0004] Therefore, how to ensure the accuracy of question and answer while improving the timeliness and comprehensiveness of question and answer is a problem that those skilled in the art urgently need to solve. SUMMARY

[0005] Based on the above problems, the present application provides a question and answer method and device based on a retrieval formula, which gives different answer determination methods for different types of text data, thereby ensuring the accuracy of question and answer while improving the timeliness and comprehensiveness of question and answer.

[0006] In a first aspect, the embodiments of the present application provide a question and answer method based on a retrieval formula, comprising:

[0007] Calculating the similarity of the question and similar questions in a question and answer database; the question and answer database includes: a standard question, an answer to the standard question, and similar questions corresponding to the standard question;

[0008] When the target similar question exists in the question and answer database, outputting the answer to the question according to the answer to the standard question corresponding to the target similar question in the question and answer database; the target similar question is a similar question with a similarity to the question reaching a first preset threshold;

[0009] When the target similar question does not exist in the question and answer database, determining the answer to the question by an answer determination method corresponding to the character length of the question, and outputting the answer to the question.

[0010] Optionally, when the target similar question exists in the question and answer database, outputting the answer to the question according to the answer to the standard question corresponding to the target similar question in the question and answer database, comprising:

[0011] When all target-similar questions correspond to a single standard question, the answer to the standard question is output as the answer to the question.

[0012] When all target similar questions correspond to multiple different standard questions, a reference similar question is determined from all target similar questions based on the relative magnitude of the similarity between the target similar question and the question and a second preset threshold, and the answer to the question is output based on the answer to the standard question corresponding to the reference similar question; the second preset threshold is greater than the first preset threshold.

[0013] Optionally, when all target similar questions correspond to multiple different standard questions, determining a reference similar question from all target similar questions based on the relative magnitude of the similarity between the target similar question and the question and a second preset threshold, and outputting the answer to the question based on the answer to the standard question corresponding to the reference similar question, includes:

[0014] When there is a target similar question with a similarity that reaches the second preset threshold, the answer to the standard question corresponding to the target similar question with the highest similarity is output as the answer to the question;

[0015] When there are no target similar questions whose similarity reaches the second preset threshold, and the target similar question corresponds to at least two standard questions, the type of the target similar question that corresponds to the same standard question and has the highest number of occurrences is further determined;

[0016] If there is only one type of target similar question that corresponds to the same standard question and has the highest number of similar questions, the answer of the standard question corresponding to the target similar question that has the highest number of similar questions will be output as the answer to the question.

[0017] If there are at least two types of target similar questions that correspond to the same standard question and have the highest number of similar questions, the average similarity of the target similar questions in different types is calculated by summing and averaging. The answer of the standard question corresponding to the target similar question with the highest average similarity is output as the answer to the question.

[0018] Optionally, when no similar question to the target exists in the question-and-answer database, determining the answer to the question using an answer determination method corresponding to the character length of the question, and outputting the answer to the question, includes:

[0019] When no similar question to the target exists in the question-and-answer database, the character length of the question is determined.

[0020] If the character length of the question does not reach the third preset threshold, similar questions are provided to the user for selection based on the question.

[0021] The answer to the question is determined based on the similar questions selected by the user, and the answer to the question is output.

[0022] If the character length of the question reaches a third preset threshold, an intent recognition calculation is performed on the question using a deep learning model;

[0023] The answer to the question is determined based on the calculation results, and the answer to the question is output.

[0024] Optionally, if the character length of the question does not reach a third preset threshold, the step of providing similar questions for the user to select from based on the question includes:

[0025] If the character length of the question does not reach the third preset threshold, determine whether there is a similar question in the question-and-answer database that completely contains the question.

[0026] Based on the judgment result, similar questions corresponding to the question are selected as feedback for the user to choose from.

[0027] Optionally, the step of selecting similar questions corresponding to the question based on the judgment result and providing feedback for the user to choose from includes:

[0028] When the judgment result is yes, the user is given feedback on the similar questions corresponding to the different standard questions.

[0029] When the judgment result is negative, the question is segmented to generate keywords with different weights;

[0030] Feedback will be provided to users by selecting similar questions that correspond to different standard questions and contain high-weight keywords.

[0031] Optionally, if the character length of the question reaches a third preset threshold, the intent recognition calculation of the question is performed using a deep learning model, including:

[0032] If the character length of the question reaches the third preset threshold, the intent value is obtained by weighting and scoring using the classification model and keywords according to the rule intent calculation formula.

[0033] Optionally, determining the answer to the question based on the calculation result and outputting the answer to the question includes:

[0034] When the intent value is greater than or equal to a preset value, the answer to the question is determined based on the intent label, and the answer to the question is output.

[0035] Optionally, before calculating the similarity between the question and similar questions in the question-answering database, the method further includes:

[0036] Get the question;

[0037] The questions are subjected to sensitive word detection, and questions containing sensitive words are filtered out;

[0038] Questions that do not contain sensitive words will be forwarded to human judges for further review. Questions that require human judgment will be filtered out to obtain the questions that meet the question-and-answer criteria.

[0039] Secondly, embodiments of this application provide a retrieval-based question-answering device, including:

[0040] The first acquisition module is used to calculate the similarity between the question and similar questions in the question-and-answer database;

[0041] The question-and-answer database includes: standard questions, answers to the standard questions, and similar questions corresponding to the standard questions;

[0042] The first determining module is used to output the answer to the question based on the answer to the standard question corresponding to the target similar question in the question-answering database when a target similar question exists in the question-answering database.

[0043] The target similarity question is a similarity question that reaches a first preset threshold with the question.

[0044] The second determining module is used to determine the answer to the question by means of an answer determination method corresponding to the character length of the question when there is no similar question to the target in the question-answering database, and output the answer to the question.

[0045] As can be seen from the above technical solutions, compared with the prior art, this application has the following advantages:

[0046] In summary, this application calculates the similarity between a question and similar questions in a question-and-answer database. The database includes standard questions, answers to the standard questions, and similar questions corresponding to the standard questions. When a target similar question exists in the database, the answer to the question is output based on the answer to the standard question corresponding to the target similar question. The target similar question is defined as a question whose similarity to the question reaches a first preset threshold. When no target similar question exists in the database, the answer to the question is determined using an answer determination method corresponding to the character length of the question, and the answer is then output. Thus, by providing different answer determination methods for different types of text data, the timeliness and comprehensiveness of question-and-answer processing are improved. Attached Figure Description

[0047] Figure 1 A flowchart illustrating a retrieval-based question-answering method provided in this application embodiment;

[0048] Figure 2 This is a schematic diagram of a retrieval-based question-answering device provided in an embodiment of this application. Detailed Implementation

[0049] As mentioned earlier, existing AI question-answering methods cannot guarantee both accuracy and timeliness / comprehensiveness. Specifically, current AI question-answering methods generally only target a limited type of text data, using similarity matching to determine the answer. Therefore, they have certain limitations, and the matching method often needs to be reset for different types of text data, which can easily lead to matching errors. Consequently, they cannot guarantee both accuracy and timeliness / comprehensiveness in their answers.

[0050] To address the aforementioned issues, this application provides a retrieval-based question-answering method. The method includes: calculating the similarity between a question and similar questions in a question-answering database; the question-answering database includes: standard questions, answers to standard questions, and similar questions corresponding to the standard questions; when a target similar question exists in the question-answering database, outputting the answer to the question based on the answer to the standard question corresponding to the target similar question in the question-answering database, wherein the target similar question is a similar question whose similarity to the question reaches a first preset threshold; when no target similar question exists in the question-answering database, determining the answer to the question through an answer determination method corresponding to the character length of the question, and outputting the answer to the question.

[0051] In this way, by providing different answer determination methods for different types of text data, the timeliness and comprehensiveness of question and answer are improved while ensuring the accuracy of the question and answer.

[0052] It should be noted that the retrieval-based question-answering method and apparatus provided by this invention can be applied to the field of artificial intelligence technology. The above are merely examples and do not limit the application areas of the retrieval-based question-answering method and apparatus provided by this invention.

[0053] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0054] Figure 1A flowchart illustrating a retrieval-based question-answering method provided in this application embodiment. (Combined with...) Figure 1 As shown in the embodiments of this application, a retrieval-based question-answering method may include:

[0055] S101: Calculate the similarity between the question and similar questions in the question-and-answer database; the question-and-answer database includes: standard questions, answers to the standard questions, and similar questions corresponding to the standard questions.

[0056] In practical applications, users ask questions to the question-answering device, which can be in the form of voice input or text input. The device then calculates the similarity between the received question and similar questions in its question-answering database to determine the answer and provide it back to the user. The question-answering database can be an existing, commonly used database, and should include standard questions, answers to standard questions, and similar questions corresponding to the standard questions. The similarity calculation in this application can use character matching similarity calculation, where identical characters in the question appearing in the same position in similar questions are counted as "similar" once, and different characters are counted as "dissimilar" once. The proportion of "similar" occurrences across all similar questions is then calculated to obtain the similarity result.

[0057] In addition, since the question-answering device needs to screen the questions before performing similarity calculation, this application can describe the possible screening methods.

[0058] In one scenario, the focus is on how to filter questions. Specifically, before calculating the similarity between the question and similar questions in the question-and-answer database, the process also includes:

[0059] Get the question;

[0060] The questions are subjected to sensitive word detection, and questions containing sensitive words are filtered out;

[0061] Questions that do not contain sensitive words will be forwarded to human judges for further review. Questions that require human judgment will be filtered out to obtain the questions that meet the question-and-answer criteria.

[0062] In practical applications, since user-inputted questions may not meet the activation criteria of the question-and-answer device, it is necessary to filter the corresponding question sentences. In this application, the question-and-answer device first obtains the question sentences corresponding to the question, and then judges whether the question sentences meet the question-and-answer conditions. Generally, it is necessary to perform sensitive word detection and referral to human review on the obtained question sentences. Specifically, a sensitive word database table is set up and sensitive words are added to the database table according to requirements. After obtaining the question sentences, the database table is used for comparison. When a sensitive word is triggered, the user is given a sensitive word-related prompt and the question sentences are returned to the user, thus achieving the purpose of filtering out question sentences containing sensitive words. Then, a binary classification model is used to refer the question sentences that pass the sensitive word detection to human review. If the question sentence contains a request to refer to human review, the relevant personnel card is directly pushed to the user, thus achieving the purpose of filtering out question sentences with a request to refer to human review, and retaining question sentences without a request to refer to human review, thereby obtaining question sentences that meet the question-and-answer conditions.

[0063] S102: When a target similar question exists in the question-and-answer database, the answer to the question is output according to the answer to the standard question corresponding to the target similar question in the question-and-answer database; the target similar question is a similar question whose similarity to the question reaches a first preset threshold.

[0064] In practical applications, similarity is calculated between the question and similar questions in the question-and-answer database. If a similar question with a similarity score reaching a first preset threshold exists in the database (i.e., a target similar question exists), the corresponding standard question can be determined based on the correspondence between the target similar question and the standard question. The answer to the standard question is then output to the user as the answer to the question. The first preset threshold can be set according to the actual situation, but is generally set to 90%. That is, when the similarity between the question and a similar question is greater than or equal to 90%, it indicates that the similar question has reached the first preset threshold.

[0065] Furthermore, since the correspondence between similar problems and standard problems may differ, the output answers may vary. Therefore, this application may describe the possible output methods.

[0066] In one scenario, the question addresses how to determine the answer to a question based on the correspondence between similar questions and standard questions. Accordingly, when a target similar question exists in the question-and-answer database, outputting the answer to the question based on the answer to the standard question corresponding to the target similar question in the question-and-answer database includes:

[0067] When all target-similar questions correspond to a single standard question, the answer to the standard question is output as the answer to the question.

[0068] When all target similar questions correspond to multiple different standard questions, a reference similar question is determined from all target similar questions based on the relative magnitude of the similarity between the target similar question and the question and a second preset threshold, and the answer to the question is output based on the answer to the standard question corresponding to the reference similar question; the second preset threshold is greater than the first preset threshold.

[0069] In practical applications, after calculating the similarity between the question and similar questions in the question-and-answer database, the top ten similar questions that meet the first preset threshold, ranked from highest to lowest similarity, are generally selected as target similar questions. If there are fewer than ten similar questions that meet the first preset threshold, then all similar questions that meet the first preset threshold are selected as target similar questions. It is important to note that multiple target similar questions may correspond to a single standard question. Specifically, if all target similar questions correspond to a single standard question, the answer to that standard question is directly output as the answer to the question. If all target similar questions correspond to multiple different standard questions, a reference similar question is determined from all target similar questions based on the relative magnitude of the similarity between the target similar question and the question and the second preset threshold, and the answer to the question is output based on the answer to the standard question corresponding to the reference similar question. In this application, the second preset threshold is greater than the first preset threshold. Generally, the second preset threshold is set to 95%, meaning that when the similarity between the question and a similar question is greater than or equal to 95%, the similar question has reached the second preset threshold.

[0070] Furthermore, since the similarity between all target similarity questions corresponds to multiple different standard questions, the relative magnitude of the similarity between the similarity question and the question and the second preset threshold also determines the difference in the output answer, this application can describe the possible output methods.

[0071] In one scenario, regarding how to output the answer, when all target similar questions correspond to multiple different standard questions, a reference similar question is determined from all target similar questions based on the relative magnitude of the similarity between the target similar question and the question and a second preset threshold, and the answer to the question is output based on the answer to the standard question corresponding to the reference similar question, including:

[0072] When there is a target similar question with a similarity that reaches the second preset threshold, the answer to the standard question corresponding to the target similar question with the highest similarity is output as the answer to the question;

[0073] When there are no target similar questions whose similarity reaches the second preset threshold, and the target similar question corresponds to at least two standard questions, the type of the target similar question that corresponds to the same standard question and has the highest number of occurrences is further determined;

[0074] If there is only one type of target similar question that corresponds to the same standard question and has the highest number of similar questions, the answer of the standard question corresponding to the target similar question that has the highest number of similar questions will be output as the answer to the question.

[0075] If there are at least two types of target similar questions that correspond to the same standard question and have the highest number of similar questions, the average similarity of the target similar questions in different types is calculated by summing and averaging. The answer of the standard question corresponding to the target similar question with the highest average similarity is output as the answer to the question.

[0076] In practical applications, considering the above, when the second preset threshold is set to 95% and all acquired target similarity questions correspond to multiple different standard questions, two different processing methods will emerge. One method is that if there are target similarity questions with a similarity greater than or equal to 95% among all acquired target similarity questions, the target similarity question with the highest similarity is directly selected, and the answer to the standard question corresponding to that target similarity question is output as the answer to the question. The other method is that if there are no target similarity questions with a similarity greater than or equal to 95% among all acquired target similarity questions, the method further determines the type of target similarity question corresponding to the same standard question and having the highest proportion of such types, and outputs the answer to the question based on the number of such types with the highest proportion of similar types. Specifically, if there is only one type of target similarity question corresponding to the same standard question and having the highest proportion of such types, the answer to the standard question corresponding to that type of target similarity question corresponding to the same standard question and having the highest proportion of such types is output as the answer to the question. For example, if ten similar questions are obtained, where the first six questions belong to category one and correspond to the same standard question, and the seventh to tenth questions belong to category two and correspond to the same standard question, then the category with the highest proportion of similar questions corresponding to the same standard question is the first category, consisting of the first six questions. The answer to the standard question corresponding to this category is then output as the question's answer. Alternatively, if there are at least two categories of similar questions corresponding to the same standard question with the highest proportion, the average similarity of the different categories is calculated by summing and averaging. The answer to the standard question corresponding to the category with the highest average similarity is then output as the question's answer. For example, if ten similar questions are obtained, with the first five questions belonging to category one and corresponding to the same standard question, and the sixth to tenth questions belonging to category two and corresponding to the same standard question, then the question-answering device will calculate the average similarity of the five similar questions in each category using a summation and averaging method. The answer to the standard question corresponding to the category with the highest average similarity will be output as the answer to the question. Furthermore, cases where a standard question corresponds to multiple similar questions will be promptly recorded in a special management log for business personnel to review and determine the repetition of questions.

[0077] S103: When there is no similar question to the target in the question-answering database, the answer to the question is determined by the answer determination method corresponding to the character length of the question, and the answer to the question is output.

[0078] In practical applications, if the question-answering device's search of the question-answering database shows that there are no similar questions in the database that meet the first preset threshold, that is, if there are no target similar questions in the question-answering database, the question-answering device will determine the character length of the question, select the answer determination method corresponding to the character length of the question, determine the answer to the question, and output it.

[0079] Furthermore, since the answer determination method differs depending on the character length of the question, this application can describe the possible answer determination methods.

[0080] In one scenario, regarding how to determine the answer to a question using an answer determination method corresponding to the character length of the question, S103: When the target similar question does not exist in the question-and-answer database, the answer to the question is determined using an answer determination method corresponding to the character length of the question, and the answer to the question is output, specifically including:

[0081] When no similar question to the target exists in the question-and-answer database, the character length of the question is determined.

[0082] If the character length of the question does not reach the third preset threshold, similar questions are provided to the user for selection based on the question.

[0083] The answer to the question is determined based on the similar questions selected by the user, and the answer to the question is output.

[0084] If the character length of the question reaches a third preset threshold, an intent recognition calculation is performed on the question using a deep learning model;

[0085] The answer to the question is determined based on the calculation results, and the answer to the question is output.

[0086] In practical applications, when no similar questions exist in the question-answering database, the character length of the question is determined. Questions can be categorized into long and short characters based on their length. In this application, a third preset threshold is used to distinguish between long and short questions. Generally, the third preset threshold is set to 5, meaning that if the character length of the question is less than 5, it indicates that the question's character length has not reached the third preset threshold. In this case, similar questions can be provided to the user based on their similarity to other similar questions. Then, based on the user's selected similar question, the answer to the corresponding standard question in the question-answering database is determined, and this answer is output as the question's answer. If the character length of the question is greater than or equal to 5, it indicates that the question's character length has reached the third preset threshold. In this case, a deep learning model is used to perform intent recognition calculations on the question, and the answer to the question is determined based on the calculation results and then output.

[0087] Furthermore, since the ways in which users can select similar questions based on the feedback provided by the question are not entirely the same, this application may describe the possible feedback methods.

[0088] In one scenario, regarding how to provide similar questions for the user to select from based on the question, the step of providing similar questions for the user to select from based on the question's character length if the question's character length does not reach a third preset threshold includes:

[0089] If the character length of the question does not reach the third preset threshold, determine whether there is a similar question in the question-and-answer database that completely contains the question.

[0090] Based on the judgment result, similar questions corresponding to the question are selected as feedback for the user to choose from.

[0091] In practical applications, when the question is determined to be a segment character question, the question-answering device searches the question-answering database to determine whether there are similar questions that completely contain the question. Then, based on the different judgment results, it selects similar questions corresponding to the question and provides feedback for the user to choose from.

[0092] Furthermore, since different judgment results correspond to different feedback results, this application can describe the possible feedback methods.

[0093] In one scenario, feedback is provided on how to select a similar question corresponding to the question based on the judgment result. Accordingly, the step of selecting a similar question corresponding to the question based on the judgment result for the user to choose from specifically includes:

[0094] When the judgment result is yes, the user is given feedback on the similar questions corresponding to the different standard questions.

[0095] When the judgment result is negative, the question is segmented to generate keywords with different weights;

[0096] Feedback will be provided to users by selecting similar questions that correspond to different standard questions and contain high-weight keywords.

[0097] In practical applications, when a question is determined to be a short-character question and similar questions that completely contain the question exist in the question-and-answer database, the similar questions are sorted according to their similarity to the question. The five most similar questions, corresponding to different standard questions, are then presented to the user for selection. For example, if the question is "wheel abnormality," and similar questions such as "What are the causes of wheel abnormality when the wheel shakes?" exist, then similar questions that completely contain the question exist. Then, the similarity of multiple such similar questions is calculated, and the five most similar questions, corresponding to different standard questions, are presented to the user for selection. When a question is determined to be a short-character question but no similar questions that completely contain the question exist in the question-and-answer database, the question is segmented into two keywords: "wheel" and "abnormality." Then, similar questions are presented based on the weight of these two words. Specifically, if the weight of "wheel" is 60% and the weight of "abnormal" is 40%, the question-answering device searches the question-answering database for similar questions that completely contain the high-weight keyword "wheel." If similar questions are found, they are sorted according to the similarity between the similar questions and the question itself. The five most similar questions corresponding to different standard questions are then provided. If there are fewer than five, the system continues searching the question-answering database for similar questions that completely contain the low-weight keyword "abnormal," and supplements them using the same method. It is important to note that cases where a standard question corresponds to multiple similar questions will be promptly recorded in a special management log for business personnel to review and determine the repetition of questions.

[0098] Furthermore, since the processing method for long character questions differs from that for short character questions, this application can provide an explanation of the processing method for long character questions.

[0099] In one scenario, regarding how to handle long character questions, if the character length of the question reaches a third preset threshold, an intent recognition calculation is performed on the question using a deep learning model, including:

[0100] If the character length of the question reaches the third preset threshold, the intent value is obtained by weighting and scoring using the classification model and keywords according to the rule intent calculation formula.

[0101] In practical applications, if a question does not find highly similar questions in the question-answering database and is not a short-character question, the question-answering device will understand the user's intent and use a traditional classification model with keywords for weighted scoring. The classification model is understood to handle sentences that need to be categorized. Each word in the sentence is composed of an n-dimensional word vector, meaning the input matrix size is m*n, where m is the sentence length. CNNs perform convolution operations on the input samples. For text data, the filters no longer slide horizontally but only move downwards, applying different filters to different word windows, ultimately resulting in six convolutional vectors. Then, maximum pooling is performed on each vector, and the pooling values ​​are concatenated to obtain the feature representation of the sentence. This sentence vector is then fed into a classifier for classification, completing the entire process. The intent calculation formula can be: intent value equals classification percentage multiplied by classification weight percentage plus keyword weight multiplied by keyword weight percentage. Thus, when there are no similar questions with similarity reaching the first preset threshold, and the character length of the question reaches the third preset threshold, the intent value is obtained by comprehensively scoring the classification model and keywords according to the rule intent calculation formula, thereby obtaining the intent recognition calculation result.

[0102] Furthermore, since the intent recognition calculation result directly affects the output of the question answer, this application can describe the possible output methods.

[0103] In one scenario, the question's answer is determined based on the calculation results. Accordingly, determining the answer to the question based on the calculation results and outputting the answer specifically includes:

[0104] When the intent value is greater than or equal to a preset value, the answer to the question is determined based on the intent label, and the answer to the question is output.

[0105] In practical applications, when the calculated result exceeds the set intent value, it indicates that the rapid question-and-answer device can determine the user's true intent and find the corresponding answer in the database based on the intent tag. The default value is generally set to 60%, meaning that when the intent value is greater than or equal to 60%, the question-and-answer device can determine that the interpreted intent is the user's true intent, then determine the answer to the question based on the intent tag, and output the answer.

[0106] In summary, this application calculates the similarity between a question and similar questions in a question-and-answer database. The database includes standard questions, answers to the standard questions, and similar questions corresponding to the standard questions. When a target similar question exists in the database, the answer to the question is output based on the answer to the standard question corresponding to the target similar question. The target similar question is defined as a question whose similarity to the question reaches a first preset threshold. When no target similar question exists in the database, the answer to the question is determined using an answer determination method corresponding to the character length of the question, and the answer is then output. Thus, by providing different answer determination methods for different types of text data, the timeliness and comprehensiveness of question-and-answer processing are improved.

[0107] Based on the retrieval-based question-answering method provided in the above embodiments, this application also provides a retrieval-based question-answering device. The retrieval-based question-answering device will now be described in conjunction with the embodiments and accompanying drawings.

[0108] Figure 2 This is a schematic diagram of a retrieval-based question-answering device provided in an embodiment of this application.

[0109] Combination Figure 2 The question-answering device 200 provided in this application embodiment may include:

[0110] The first acquisition module 201 is used to calculate the similarity between the question and similar questions in the question-and-answer database;

[0111] The question-and-answer database includes: standard questions, answers to the standard questions, and similar questions corresponding to the standard questions;

[0112] The first determining module 202 is used to output the answer to the question based on the answer to the standard question corresponding to the target similar question in the question-and-answer database when a target similar question exists in the question-and-answer database.

[0113] The target similarity question is a similarity question that reaches a first preset threshold with the question.

[0114] The second determining module 203 is used to determine the answer to the question by means of an answer determination method corresponding to the character length of the question when there is no similar question to the target in the question-answering database, and output the answer to the question.

[0115] As one implementation method, the first determining module 202 includes a first output module and a second output module, which are used to output the answer to the question based on the answer to the standard question corresponding to the target similar question in the question-answering database.

[0116] The first output module is used to output the answer to the standard question as the answer to the question when all target similar questions correspond to one standard question;

[0117] The second output module is used to determine a reference similar question from all target similar questions when all target similar questions correspond to multiple different standard questions, based on the relative magnitude of the similarity between the target similar question and the question and a second preset threshold, and output the answer to the question based on the answer to the standard question corresponding to the reference similar question; the second preset threshold is greater than the first preset threshold.

[0118] As one implementation method, the second output module is specifically used to output the answer to the question based on the answer to the standard question corresponding to a similar question.

[0119] When there is a target similar question with a similarity that reaches the second preset threshold, the answer to the standard question corresponding to the target similar question with the highest similarity is output as the answer to the question;

[0120] When there are no target similar questions whose similarity reaches the second preset threshold, and the target similar question corresponds to at least two standard questions, the type of the target similar question that corresponds to the same standard question and has the highest number of occurrences is further determined;

[0121] If there is only one type of target similar question that corresponds to the same standard question and has the highest number of similar questions, the answer of the standard question corresponding to the target similar question that has the highest number of similar questions will be output as the answer to the question.

[0122] If there are at least two types of target similar questions that correspond to the same standard question and have the highest number of similar questions, the average similarity of the target similar questions in different types is calculated by summing and averaging. The answer of the standard question corresponding to the target similar question with the highest average similarity is output as the answer to the question.

[0123] As one implementation method, the second determination module 203 includes: a first judgment module, a first feedback module, a third output module, a recognition module, and a fourth output module, for determining the answer to a question by means of an answer determination method corresponding to the character length of the question.

[0124] The first judgment module is used to determine the character length of the question when there is no similar question to the target in the question-answering database;

[0125] The first feedback module is used to provide similar questions for the user to select if the character length of the question does not reach the third preset threshold.

[0126] The third output module is used to determine the answer to the question based on the similar questions selected by the user, and output the answer to the question;

[0127] The recognition module is used to perform intent recognition calculation on the question using a deep learning model when the character length of the question reaches a third preset threshold.

[0128] The fourth output module is used to determine the answer to the question based on the calculation result and output the answer to the question.

[0129] As one implementation method, the first feedback module includes a judgment submodule and a feedback submodule, which are designed to provide similar questions for the user to select based on the question.

[0130] The judgment submodule is used to determine whether there are similar questions in the question-and-answer database that completely contain the question if the character length of the question does not reach the third preset threshold.

[0131] The feedback submodule is used to select similar questions corresponding to the question based on the judgment result and provide feedback for the user to choose from.

[0132] As one implementation method, regarding how to select similar questions corresponding to the question based on the judgment result and provide feedback, the aforementioned feedback submodule is specifically used for:

[0133] When the judgment result is yes, the user is given feedback on the similar questions corresponding to the different standard questions.

[0134] When the judgment result is negative, the question is segmented to generate keywords with different weights;

[0135] Feedback will be provided to users by selecting similar questions that correspond to different standard questions and contain high-weight keywords.

[0136] As one implementation method, regarding how to use a deep learning model to perform intent recognition calculations on questions, the aforementioned recognition module is specifically used for:

[0137] If the character length of the question reaches the third preset threshold, the intent value is obtained by weighting and scoring using the classification model and keywords according to the rule intent calculation formula.

[0138] As one implementation method, the fourth output module is specifically used to determine the answer to the question based on the calculation results:

[0139] When the intent value is greater than or equal to a preset value, the answer to the question is determined based on the intent label, and the answer to the question is output.

[0140] As one implementation method, the question-and-answer device 200 further includes a filtering module to filter questions;

[0141] The filtering module is used to obtain the question;

[0142] The questions are subjected to sensitive word detection, and questions containing sensitive words are filtered out;

[0143] Questions that do not contain sensitive words will be forwarded to human judges for further review. Questions that require human judgment will be filtered out to obtain the questions that meet the question-and-answer criteria.

[0144] In summary, this application calculates the similarity between a question and similar questions in a question-and-answer database. The database includes standard questions, answers to the standard questions, and similar questions corresponding to the standard questions. When a target similar question exists in the database, the answer to the question is output based on the answer to the standard question corresponding to the target similar question. The target similar question is defined as a question whose similarity to the question reaches a first preset threshold. When no target similar question exists in the database, the answer to the question is determined using an answer determination method corresponding to the character length of the question, and the answer is then output. Thus, by providing different answer determination methods for different types of text data, the timeliness and comprehensiveness of question-and-answer processing are improved.

[0145] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A retrieval-based question-answering method, characterized in that, The method includes: The similarity between the question and similar questions in the question-and-answer database is calculated; the question-and-answer database includes: standard questions, answers to the standard questions, and similar questions corresponding to the standard questions. When a target similar question exists in the question-and-answer database, the answer to the question is output according to the answer to the standard question corresponding to the target similar question in the question-and-answer database; the target similar question is a similar question whose similarity to the question reaches a first preset threshold. When the question-and-answer database does not contain a question similar to the target, the answer to the question is determined by a method corresponding to the character length of the question, and the answer to the question is output. When the question-and-answer database does not contain a question similar to the target question, the answer to the question is determined by a method corresponding to the character length of the question, and the answer to the question is output, including: When no similar question to the target exists in the question-and-answer database, the character length of the question is determined. If the character length of the question does not reach the third preset threshold, similar questions are provided to the user for selection based on the question. The answer to the question is determined based on the similar questions selected by the user, and the answer to the question is output. If the character length of the question reaches a third preset threshold, an intent recognition calculation is performed on the question using a deep learning model; The answer to the question is determined based on the calculation results, and the answer to the question is output.

2. The method according to claim 1, characterized in that, When a similar question exists in the question-and-answer database, the answer to the question is output based on the answer to the standard question corresponding to the similar question in the question-and-answer database, including: When all target-similar questions correspond to a single standard question, the answer to the standard question is output as the answer to the question. When all target similar questions correspond to multiple different standard questions, a reference similar question is determined from all target similar questions based on the relative magnitude of the similarity between the target similar question and the question and a second preset threshold, and the answer to the question is output based on the answer to the standard question corresponding to the reference similar question; the second preset threshold is greater than the first preset threshold.

3. The method according to claim 2, characterized in that, When all target similar questions correspond to multiple different standard questions, a reference similar question is determined from all target similar questions based on the relative magnitude of the similarity between the target similar question and the question and a second preset threshold, and the answer to the question is output based on the answer to the standard question corresponding to the reference similar question, including: When there is a target similar question with a similarity that reaches the second preset threshold, the answer to the standard question corresponding to the target similar question with the highest similarity is output as the answer to the question; When there are no target similar questions whose similarity reaches the second preset threshold, and the target similar question corresponds to at least two standard questions, the type of the target similar question that corresponds to the same standard question and has the highest number of occurrences is further determined; If there is only one type of target similar question that corresponds to the same standard question and has the highest number of similar questions, the answer of the standard question corresponding to the target similar question that has the highest number of similar questions will be output as the answer to the question. If there are at least two types of target similar questions that correspond to the same standard question and have the highest number of similar questions, the average similarity of the target similar questions in different types is calculated by summing and averaging. The answer of the standard question corresponding to the target similar question with the highest average similarity is output as the answer to the question.

4. The method according to claim 1, characterized in that, If the character length of the question does not reach the third preset threshold, the system provides similar questions for the user to select from, including: If the character length of the question does not reach the third preset threshold, determine whether there is a similar question in the question-and-answer database that completely contains the question. Based on the judgment result, similar questions corresponding to the question are selected as feedback for the user to choose from.

5. The method according to claim 4, characterized in that, The step of selecting similar questions corresponding to the question based on the judgment result and providing feedback to the user for selection includes: When the judgment result is yes, the user is given feedback on the similar questions corresponding to the different standard questions. When the judgment result is negative, the question is segmented to generate keywords with different weights; Feedback will be provided to users by selecting similar questions that correspond to different standard questions and contain high-weight keywords.

6. The method according to claim 1, characterized in that, If the character length of the question reaches a third preset threshold, the intent recognition calculation of the question is performed using a deep learning model, including: If the character length of the question reaches the third preset threshold, the intent value is obtained by weighting and scoring using the classification model and keywords according to the rule intent calculation formula.

7. The method according to claim 6, characterized in that, The step of determining the answer to the question based on the calculation result and outputting the answer to the question includes: When the intent value is greater than or equal to a preset value, the answer to the question is determined based on the intent label, and the answer to the question is output.

8. The method according to claim 1, characterized in that, Before calculating the similarity between the question and similar questions in the question-answering database, the method further includes: Get the question; The questions are subjected to sensitive word detection, and questions containing sensitive words are filtered out; Questions that do not contain sensitive words will be forwarded to human judges for further review. Questions that require human judgment will be filtered out to obtain the questions that meet the question-and-answer criteria.

9. A retrieval-based question-answering device, characterized in that, include: The first acquisition module is used to calculate the similarity between the question and similar questions in the question-and-answer database; The question-and-answer database includes: standard questions, answers to the standard questions, and similar questions corresponding to the standard questions; The first determining module is used to output the answer to the question based on the answer to the standard question corresponding to the target similar question in the question-answering database when a target similar question exists in the question-answering database. The target similarity question is a similarity question that reaches a first preset threshold with the question. The second determining module is used to determine the answer to the question by means of an answer determination method corresponding to the character length of the question when there is no target similar question in the question-answering database, and output the answer to the question; The second determining module includes: a first judging module, a first feedback module, a third output module, an identification module, and a fourth output module; The first judgment module is used to determine the character length of the question when there is no similar question to the target in the question-answering database; The first feedback module is used to provide similar questions for the user to select if the character length of the question does not reach the third preset threshold. The third output module is used to determine the answer to the question based on the similar questions selected by the user, and output the answer to the question; The recognition module is used to perform intent recognition calculation on the question using a deep learning model when the character length of the question reaches a third preset threshold. The fourth output module is used to determine the answer to the question based on the calculation result and output the answer to the question.

Citation Information

Patent Citations

  • Information processing method and device for intelligent question-answering system

    CN105677783A

  • Intelligent question and answer library establishing method, intelligent question and answer method and device, and computer equipment

    CN110941708A