Question and Answer Processing Method, Related Devices, and Readable Storage Media

By adding filter conditions to the Q&A library of the FAQ Q&A system, combining similarity and filter conditions to determine the target problem, the problem of inaccurate matching of user questions in the existing technology is solved, and a more accurate answer return is achieved.

CN114281942BActive Publication Date: 2025-05-27IFLYTEK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111553527.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2025-05-27
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

The existing FAQ Q&A system calculates the similarity between user questions and questions in the Q&A library and it is difficult to accurately find matching questions, resulting in the return of incorrect answers.

Method used

Filter conditions are added to each record in the Q&A library, and the target questions matching the user's questions are determined from the Q&A library through the similarity and filter conditions of the user's questions, and the answers corresponding to the user's questions are generated based on the answers to the target questions.

Benefits of technology

Improve the accuracy of finding questions that match the user's questions from the question-and-answer library, reduce matching errors caused by similar sentences, and improve the accuracy of returning answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114281942B_ABST
    Figure CN114281942B_ABST
Patent Text Reader

Abstract

The present application discloses a question-and-answer processing method, related devices and readable storage media. In this solution, a question-and-answer library is preset. The question-and-answer library includes multiple records, and each record includes a question, an answer corresponding to the question, and a screening condition corresponding to the question. The screening condition is used to indicate the conditions that a user question matching the question needs to meet; when determining a target question matching the user question, not only the similarity between the user question and each question in the question-and-answer library is considered, but also whether the user question meets the conditions that the user questions set for each question in the question-and-answer library to match. Therefore, the accuracy of finding a question matching the user question from the question-and-answer library can be improved, and further the accuracy of returning an answer to the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of natural language processing. More specifically, it relates to a question and answer processing method, related devices, and readable storage media. Background Art

[0002] The FAQ (Frequently Asked Question) question and answer system is a question and answer retrieval system that searches for questions matching the user's question in a pre-constructed question and answer library (including pre-constructed "question - answer" pairs) and returns the corresponding answer to the user. When searching for a question matching the user's question in the question library, it is mostly done by calculating the similarity between the user's question and the questions in the "question - answer" pairs in the question and answer library. The question with the highest similarity is the question matching the user's question.

[0003] However, by calculating the similarity between the user's question and the questions in the "question - answer" pairs in the question and answer library, the question matching the user's question cannot be accurately found, which may lead to returning the wrong answer to the user. For example, there may be a question in the question and answer library with a very similar sentence pattern to the user's question, and the similarity between this question and the user's question is the highest. Therefore, based on the similarity between the user's question and the questions in the "question - answer" pairs in the question and answer library, this question will be found from the question and answer library as the question matching the user's question, but in fact, this question does not match the user's question. In this case, the wrong answer will be returned to the user. For ease of understanding, assume the user's question is "What is the power consumption of the TV in standby mode?" There are two "question - answer" pairs in the question and answer library: "Q1: What is the standby power of the TV? A1: 0.5w" and "Q2: What is the power consumption of the TV when it is turned on? A2: 40w". Since the sentence pattern of Q2 is closer to the user's question, the similarity between the user's question and Q2 is higher than the similarity between the user's question and Q1. Then, Q2 will be determined as the question matching the user's question, resulting in the wrong answer of 40W being output.

[0004] Therefore, how to accurately find the question matching the user's question from the question and answer library has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention

[0005] In view of the above problems, this application proposes a question and answer processing method, related devices, and readable storage media. The specific solutions are as follows:

[0006] A question and answer processing method, the method includes:

[0007] Obtain the user's question and the Q&A library corresponding to the user's question. The Q&A library includes multiple records, and each record includes a question, the answer corresponding to the question, and the screening condition corresponding to the question; the screening condition is used to indicate the conditions that the user's question matching the question needs to meet;

[0008] Based on the similarity between the user's question and each question in the Q&A library, and the screening conditions corresponding to each question, determine the target question in the Q&A library that matches the user's question;

[0009] Based on the answer corresponding to the target question, determine the answer corresponding to the user's question.

[0010] Optionally, the determining the target question in the Q&A library that matches the user's question based on the similarity between the user's question and each question in the Q&A library, and the screening conditions corresponding to each question includes:

[0011] Find a preset number of questions in the Q&A library whose similarity to the user's question meets the preset conditions as candidate questions;

[0012] Based on the screening conditions corresponding to each candidate question, screen out the questions in the candidate questions that are initially matched with the user's question;

[0013] Determine the target question in the questions that are initially matched with the user's question. The target question is the question with the highest similarity to the user's question among the questions that are initially matched with the user's question.

[0014] Optionally, the screening out the questions in the candidate questions that are initially matched with the user's question based on the screening conditions corresponding to each candidate question includes:

[0015] For each candidate question, determine whether the user's question meets the screening condition corresponding to the candidate question; if the user's question meets the screening condition corresponding to the candidate question, determine the candidate question as the question that is initially matched with the user's question.

[0016] Optionally, the screening condition includes a matching condition, and / or, an exclusion condition.

[0017] Optionally, when the screening condition includes a matching condition, the determining whether the user's question meets the screening condition corresponding to the candidate question includes:

[0018] Determine whether the user's question meets at least one matching condition corresponding to the candidate question;

[0019] If the user's question meets at least one matching condition corresponding to the candidate question, it is determined that the user's question meets the screening condition corresponding to the candidate question.

[0020] Optionally, when the screening condition includes an exclusion condition, determining whether the user's question meets the screening condition corresponding to the candidate question includes:

[0021] Determining whether the user's question meets the exclusion condition corresponding to the candidate question;

[0022] If the user's question does not meet all the exclusion conditions corresponding to the candidate question, it is determined that the user's question meets the screening condition corresponding to the candidate question.

[0023] Optionally, determining the answer corresponding to the user's question based on the answer corresponding to the target question includes:

[0024] Determining the category of the user's question;

[0025] When it is determined that the category of the user's question is a judgment type, the answer corresponding to the target question is adjusted to generate the answer corresponding to the user's question.

[0026] Optionally, determining the category of the user's question includes:

[0027] Inputting the user's question into a trained classification model, and the classification model outputs the category of the user's question. The classification model is trained with training user questions as training samples and the categories labeled by the training user questions as sample labels. The categories labeled by the training user questions include non-judgment types and judgment types.

[0028] Optionally, each record in the Q&A library further includes a judgment rule corresponding to the question. Then, when it is determined that the category of the user's question is a judgment type, adjusting the answer corresponding to the target question to generate the answer corresponding to the user's question includes:

[0029] Judging whether the user's question meets the judgment rule corresponding to the target question to generate a judgment result;

[0030] Based on the judgment result, adjusting the answer corresponding to the target question to generate the answer corresponding to the user's question.

[0031] Optionally, the judgment rule includes a text type judgment rule or a numerical type judgment rule.

[0032] A Q&A processing device, the device includes:

[0033] An acquisition unit for acquiring a user's question and a Q&A library corresponding to the user's question. The Q&A library includes multiple records, and each record includes a question, an answer corresponding to the question, and a screening condition corresponding to the question. The screening condition is used to indicate the conditions that a user's question matching the question needs to meet.

[0034] A target question determination unit for determining a target question matching the user's question from the Q&A library based on the similarity between the user's question and each question in the Q&A library, and the screening conditions corresponding to each question.

[0035] An answer determination unit for determining an answer corresponding to the user's question based on the answer corresponding to the target question.

[0036] Optionally, the target question determination unit includes:

[0037] A search unit for searching in the Q&A library for a preset number of questions whose similarity to the user's question meets a preset condition as candidate questions.

[0038] A screening unit for screening out questions that are initially matched with the user's question from the candidate questions based on the screening conditions corresponding to each candidate question.

[0039] A determination unit for determining a target question matching the user's question from the questions that are initially matched with the user's question. The target question is the question with the highest similarity to the user's question among the questions that are initially matched with the user's question.

[0040] Optionally, the screening unit includes:

[0041] A screening condition determination unit for determining whether the user's question meets the screening condition corresponding to each candidate question.

[0042] A screening processing unit for determining that the candidate question is a question that is initially matched with the user's question if the user's question meets the screening condition corresponding to the candidate question.

[0043] Optionally, the screening condition includes a matching condition, and / or, an exclusion condition.

[0044] Optionally, when the screening condition includes a matching condition, the screening condition determination unit is specifically used for:

[0045] Determining whether the user's question meets at least one matching condition corresponding to the candidate question.

[0046] If the user's question meets at least one matching condition corresponding to the candidate question, it is determined that the user's question meets the screening condition corresponding to the candidate question.

[0047] Optionally, when the screening condition includes an exclusion condition, the screening condition determination unit is specifically configured to:

[0048] Determine whether the user's question meets the exclusion condition corresponding to the candidate question;

[0049] If the user's question does not meet all the exclusion conditions corresponding to the candidate question, it is determined that the user's question meets the screening condition corresponding to the candidate question.

[0050] Optionally, the answer determination unit includes:

[0051] A category determination unit, configured to determine the category of the user's question;

[0052] An adjustment unit, configured to adjust the answer corresponding to the target question to generate an answer corresponding to the user's question when it is determined that the category of the user's question is a judgment type.

[0053] Optionally, the category determination unit includes:

[0054] A classification model application unit, configured to input the user's question into a trained classification model, and the classification model outputs the category of the user's question. The classification model is trained with training user questions as training samples and the categories labeled by the training user questions as sample labels. The categories labeled by the training user questions include non-judgment types and judgment types.

[0055] Optionally, each record in the Q&A library further includes a judgment rule corresponding to the question. Then, the adjustment unit includes:

[0056] A judgment result generation unit, configured to judge whether the user's question meets the judgment rule corresponding to the target question and generate a judgment result;

[0057] An answer adjustment unit, configured to adjust the answer corresponding to the target question based on the judgment result to generate an answer corresponding to the user's question.

[0058] Optionally, the judgment rule includes a text type judgment rule or a numerical type judgment rule.

[0059] A Q&A processing device, including a memory and a processor;

[0060] The memory is used to store programs;

[0061] The processor is configured to execute the program to implement the steps of the above-mentioned question-answering processing method.

[0062] A readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned question-answering processing method.

[0063] By means of the above technical solution, the present application discloses a question-answering processing method, related devices and a readable storage medium. In this solution, a question-answering library is preset, and the question-answering library includes multiple records. Each record includes a question, an answer corresponding to the question, and a screening condition corresponding to the question. The screening condition is used to indicate the conditions that a user question matching the question needs to meet. After obtaining a user question, based on the similarity between the user question and each question in the question-answering library, and the screening conditions corresponding to each question in the question-answering library, a target question matching the user question is determined from the question-answering library. Then, based on the answer corresponding to the target question, an answer corresponding to the user question is determined. In the above solution, when determining the target question matching the user question, not only the similarity between the user question and each question in the question-answering library is considered, but also whether the user question meets the conditions that the user questions set for matching each question in the question-answering library. Therefore, the accuracy of finding a question matching the user question from the question-answering library can be improved, and further the accuracy of returning an answer to the user is improved. Description of the Drawings

[0064] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present application. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0065] Figure 1 is a schematic flowchart of the question-answering processing method disclosed in the embodiment of the present application;

[0066] Figure 2 is a schematic flowchart of the method for determining a target question matching a user question from a question-answering library based on the similarity between the user question and each question in the question-answering library, and the screening conditions corresponding to each question;

[0067] Figure 3 is a schematic flowchart of the method for determining an answer corresponding to a user question based on the answer corresponding to the target question;

[0068] Figure 4 is a schematic structural diagram of a question-answering processing device disclosed in the embodiment of the present application;

[0069] Figure 5The hardware structure block diagram of a question-and-answer processing device disclosed in an embodiment of the present application. Detailed implementation manners

[0070] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0071] The FAQ (Frequently Asked Question) question-and-answer system is a question-and-answer retrieval system that searches for questions matching the user's question in a pre-constructed question-and-answer library (including pre-constructed "question-answer" pairs) and returns the corresponding answer to the user. When searching for a question matching the user's question in the question library, it is mostly done by calculating the similarity between the user's question and the questions in the "question-answer" pairs in the question-and-answer library. The question with the highest similarity is the question matching the user's question.

[0072] However, by calculating the similarity between the user's question and the questions in the "question-answer" pairs in the question-and-answer library, the question matching the user's question cannot be accurately found, which may lead to returning the wrong answer to the user. For example, there may be a question in the question-and-answer library with a very similar sentence pattern to the user's question, and the similarity between this question and the user's question is the highest. Therefore, based on the similarity between the user's question and the questions in the "question-answer" pairs in the question-and-answer library, it will be determined that this question matches the user's question, but in fact this question does not match the user's question. In this case, the wrong answer will be returned to the user.

[0073] For ease of understanding, assume that the user's question is "What is the power consumption of the TV in standby mode?" There are two "question-answer" pairs in the question-and-answer library: "Q1: What is the standby power of the TV? A1: 0.5w" and "Q2: What is the power consumption of the TV when it is turned on? A2: 40w". Since the sentence pattern of Q2 is closer to the user's question, the similarity between the user's question and Q2 is higher than the similarity between the user's question and Q1. Then, it will be determined that Q2 is the question matching the user's question, resulting in the output of the wrong answer of 40W.

[0074] In addition, in the prior art, the answer corresponding to the question matching the user's question in the question-and-answer library is returned to the user, and this answer is fixed. If the user's question is a judgment type, the answer in the question-and-answer library is not an appropriate answer for the user's question.

[0075] For ease of understanding, assume that the user's question is "Is the standby power of this TV 0.2W?" and the question in the Q&A library that matches the user's question is "Q1: What is the standby power of the TV?" Then the answer returned to the user is "0.5W". In fact, a more appropriate answer should be "No, 0.5W". However, the current FAQ Q&A system cannot achieve this level.

[0076] In view of the above problems existing in the current FAQ Q&A system, the inventor of this case conducted in-depth research and finally proposed a Q&A processing method.

[0077] Next, the Q&A processing method provided by this application will be introduced through the following embodiments.

[0078] Refer to Figure 1 , Figure 1 which is a schematic flowchart of the Q&A processing method disclosed in the embodiments of this application. The method may include:

[0079] Step S101: Obtain the user's question and the Q&A library corresponding to the user's question. The Q&A library includes multiple records, and each record includes a question, the answer corresponding to the question, and the screening condition corresponding to the question; the screening condition is used to indicate the conditions that the user's question matching the question needs to meet.

[0080] In this application, the user's question can be the text input by the user or the text obtained after recognizing the user's input speech based on speech recognition technology. For example, "What is the power consumption of the TV when it is in standby?"

[0081] In a traditional Q&A library, the composition of a record is (Q, A), where Q represents the question and A represents the answer. In some solutions, Q can include different statements of the same question, and A can include different statements of the same answer. For example, the composition of a record is {(Q1, Q2, Q3...), (A1, A2, A3...)}, where Qi are different statements of the same question, used to increase the matching of different ways of asking questions and improve the response ratio of the model. Ai are different statements of the same answer, used to increase the diversity of answers.

[0082] In this application, when constructing the Q&A library, in addition to including (Q, A) in a record, the screening condition corresponding to Q is also supplemented. If the user's question meets the screening condition corresponding to a question, it means that the user's question matches the question. It should be noted that the screening condition can include some regular expressions or keywords.

[0083] Step S102: Determine the target question that matches the user's question from the Q&A library based on the similarity between the user's question and each question in the Q&A library, and the screening conditions corresponding to each question.

[0084] In this application, the matching between the user's question and the target question means that: the similarity between the user's question and the target question meets the preset conditions, and moreover, the user's question also meets the screening conditions corresponding to the target question.

[0085] Based on the similarity between the user's question and each question in the Q&A library, and the screening conditions corresponding to each question, the specific implementation manner of determining the target question matching the user's question from the Q&A library will be described in detail in the following embodiments.

[0086] Step S103: Determine the answer corresponding to the user's question based on the answer corresponding to the target question.

[0087] In this application, after determining the target question matching the user's question, the answer corresponding to the user's question can be determined based on the answer corresponding to the target question stored in the Q&A library, and the answer corresponding to the user's question can be provided to the user.

[0088] It should be noted that the user's question can have different forms. In this application, when determining the answer corresponding to the user's question based on the answer corresponding to the target question, different processing can be performed according to the form of the user's question, and the specific implementation manner will be described in detail in the following embodiments.

[0089] This embodiment discloses a Q&A processing method. In this method, a Q&A library is preset. The Q&A library includes multiple records, and each record includes a question, the answer corresponding to the question, and the screening conditions corresponding to the question. The screening conditions are used to indicate the conditions that the user's question matching the question needs to meet; after obtaining the user's question, based on the similarity between the user's question and each question in the Q&A library, and the screening conditions corresponding to each question in the Q&A library, determine the target question matching the user's question from the Q&A library; then, determine the answer corresponding to the user's question based on the answer corresponding to the target question. In the above method, when determining the target question matching the user's question, not only the similarity between the user's question and each question in the Q&A library is considered, but also whether the user's question meets the conditions that the user's question matching the question in the Q&A library needs to meet is considered. Therefore, the accuracy of finding the question matching the user's question from the Q&A library can be improved, and further the accuracy of returning the answer to the user can be improved.

[0090] In another embodiment of this application, the specific implementation manner of step S102 of determining the target question matching the user's question from the Q&A library based on the similarity between the user's question and each question in the Q&A library, and the screening conditions corresponding to each question is described.

[0091] Refer to Figure 2 , Figure 2Schematic flowchart of a method for determining a target question matching a user question from a question-and-answer library based on the similarity between the user question and each question in the question-and-answer library, and the screening conditions corresponding to each question. The method may include:

[0092] Step S201: Search the question-and-answer library for a preset number of questions whose similarity to the user question meets a preset condition as candidate questions.

[0093] In this application, the similarity between each question in the question-and-answer library and the user question can be calculated, and the top K questions with similarity above a preset threshold can be determined as candidate questions. The value of K can be determined according to specific scenario requirements and is not limited in this embodiment.

[0094] Step S202: Based on the screening conditions corresponding to each candidate question, screen out the questions that are initially matched with the user question from the candidate questions.

[0095] In this application, for each candidate question, it can be determined whether the user question meets the screening conditions corresponding to the candidate question; if the user question meets the screening conditions corresponding to the candidate question, then the candidate question is determined to be a question that is initially matched with the user question; if the user question does not meet the screening conditions corresponding to the candidate question, then the candidate question is determined not to be a question that is initially matched with the user question.

[0096] In this application, the screening conditions may include matching conditions, and / or exclusion conditions. Among them, the matching conditions are used to indicate the conditions that the user question matching the question needs to meet. The exclusion conditions are used to indicate the conditions that the user question matching the question does not need to meet. The matching conditions contain some regular expressions or keywords. The exclusion conditions are also composed of some regular expressions or keywords.

[0097] As an implementable manner, when the screening conditions include matching conditions, determining whether the user question meets the screening conditions corresponding to the candidate question includes: determining whether the user question meets at least one of the matching conditions corresponding to the candidate question; if the user question meets at least one of the matching conditions corresponding to the candidate question, then it is determined that the user question meets the screening conditions corresponding to the candidate question. If the user question does not meet at least one of the matching conditions corresponding to the candidate question, then it is determined that the user question does not meet the screening conditions corresponding to the candidate question.

[0098] As another implementable manner, when the screening condition includes an exclusion condition, determining whether the user's question meets the screening condition corresponding to the candidate question includes: determining whether the user's question meets the exclusion condition corresponding to the candidate question; if the user's question does not meet all the exclusion conditions corresponding to the candidate question, it is determined that the user's question meets the screening condition corresponding to the candidate question. If the user's question meets at least one of the exclusion conditions corresponding to the candidate question, it is determined that the user's question does not meet the screening condition corresponding to the candidate question.

[0099] It should be noted that, generally, the matching condition and the exclusion condition are not related. If the user's question meets the matching condition, it will definitely not meet the exclusion condition. That is to say, if the screening condition includes the matching condition and the exclusion condition, and the user's question meets at least one of the matching conditions corresponding to the candidate question, and the user's question does not meet all the exclusion conditions corresponding to the candidate question, it is determined that the user's question meets the screening condition corresponding to the candidate question. Otherwise, it is determined that the user's question does not meet the screening condition corresponding to the candidate question.

[0100] For ease of understanding, assume that a question stored in the Q&A library is "Q: The second highest mountain in the world", and the corresponding answer is "A: The second highest mountain in the world is K2". The matching condition corresponding to this question can be set to "second", and the exclusion condition can be set to "first, third". If the user's question is "Is K2 the second highest mountain in the world by altitude?", and the user's question contains "second", it means that the user's question meets the matching condition. If the user's question does not contain "first, third", it means that the user's question does not meet the exclusion condition. Therefore, this user's question matches this question.

[0101] Step S203: Determine the target question that matches the user's question from the questions that are initially matched with the user's question.

[0102] In this application, the target question is the question with the highest similarity to the user's question among the questions that are initially matched with the user's question.

[0103] In another embodiment of this application, the specific implementation manner of step S103 for determining the answer corresponding to the user's question based on the answer corresponding to the target question is described.

[0104] Refer to Figure 3 , Figure 3 which is a schematic flowchart of the method for determining the answer corresponding to the user's question based on the answer corresponding to the target question disclosed in the embodiments of this application. This method may include the following steps:

[0105] Step S301: Determine the category of the user's question.

[0106] In this application, the user's question can be input into a trained classification model, and the classification model outputs the category of the user's question. The classification model is trained with training user questions as training samples and the categories labeled for the training user questions as sample labels. The categories labeled for the training user questions include non - judgment types and judgment types.

[0107] In this application, the classification model can be a binary classification model.

[0108] It should be noted that both non - judgment types and judgment types can be divided into sub - categories with finer granularity. For example, non - judgment types can include ordinary types and statistical types, and judgment types can include numerical judgment types and text judgment types. If non - judgment types and judgment types are divided into sub - categories with finer granularity, the classification model can be a multi - branch classification model.

[0109] Step S302: When it is determined that the category of the user's question is a judgment type, adjust the answer corresponding to the target question to generate an answer corresponding to the user's question.

[0110] In this application, each record in the Q&A library further includes a judgment rule corresponding to the question. Then, when it is determined that the category of the user's question is a judgment type, adjusting the answer corresponding to the target question to generate an answer corresponding to the user's question includes: judging whether the user's question meets the judgment rule corresponding to the target question to generate a judgment result; and based on the judgment result, adjusting the answer corresponding to the target question to generate an answer corresponding to the user's question.

[0111] In reality, common judgment - type questions are numerical judgment types (such as: Is the height of Mount Everest more than 8800 meters?) and text judgment types (such as: Is the second - highest peak in the world K2?). As an implementable manner, the judgment rule includes a text - type judgment rule or a numerical - type judgment rule.

[0112] As an implementable manner, the definition of the judgment rule can include 4 fields, as shown in the following table:

[0113]

[0114] As shown in the above table, "Type" indicates the type of rule, including two types: numeric and string. "Condition" is the judgment condition. For numeric types, there are 7 types: greater than or equal to (>=), greater than (>), equal to (==), less than (<), less than or equal to (<=), not equal to (!=), and value range (between). For string types, there are 3 types: contain, not contain, and "match". There is no "extractor" field for string types.

[0115] Based on the above-defined way of judgment rules, for the numeric judgment: Is the height of Mount Qomolangma more than 8,800 meters?, its judgment rule can be:

[0116]

[0117]

[0118] For the text judgment: Is the second-highest mountain in the world K2?, its judgment rule can be:

[0119]

[0120] As an implementable way, if the user's question meets the judgment rule corresponding to the target question, a judgment result for expressing correct judgment is generated, such as "Yes", "Right", etc. If the user's question does not meet the judgment rule corresponding to the target question, a judgment result for expressing wrong judgment is generated, such as "No", "False", etc.

[0121] As an implementable way, based on the judgment result, the answer corresponding to the target question is adjusted to generate an answer corresponding to the user's question. Specifically, the judgment result can be added before the answer corresponding to the target question.

[0122] For easy understanding, the following Example 1 and Example 2 are given in this application.

[0123] Example 1:

[0124] The user's question query is "Is the second-highest mountain in the world K2?". Two records with similarity meeting the preset conditions are searched in the Q&A library:

[0125]

[0126]

[0127] For Answer 1, although its sentence pattern is closer to the query and has a higher score, it does not meet any matching conditions, so it can be excluded; for Answer 2, it meets the matching and exclusion conditions, and according to the judgment rule, the query contains "K2", so it is judged as correct, and the output answer is "Yes, the second highest peak in the world is K2".

[0128] Example 2:

[0129] The user's question query is "When driving a motor vehicle to turn around or turn, the speed shall not exceed 40 km / h. Is this correct?" The ones with similarity meeting the preset conditions found in the Q&A library are:

[0130]

[0131] Then, through query classification, it is known that it is a judgment type. 40 is extracted by the extractor, and then the condition for extracting 40 from the query (either by using a model or regular matching) is "not exceeding", and the value range in the query is '<=40', which does not correspond to the range '<=30' defined in the judgment rule. Therefore, the output is: "No, the speed shall not exceed 30 km / h".

[0132] Step S303: When it is determined that the category of the user's question is non-judgment type, determine the answer corresponding to the target question as the answer corresponding to the user's question.

[0133] The Q&A processing method disclosed in the above embodiments can reduce the matching errors caused by the similarity between the user's question and the question sentence pattern, and can also give a more appropriate answer to the judgment type questions of the user's question. It improves the user experience.

[0134] Next, a Q&A processing device disclosed in an embodiment of the present application will be described. The Q&A processing device described below can be mutually corresponding and referred to with the Q&A processing method described above.

[0135] Refer to Figure 4 , Figure 4 which is a schematic structural diagram of a Q&A processing device disclosed in an embodiment of the present application. As Figure 4 shown, the Q&A processing device may include:

[0136] An obtaining unit 41, configured to obtain a user's question and a Q&A library corresponding to the user's question. The Q&A library includes multiple records, and each record includes a question, an answer corresponding to the question, and a screening condition corresponding to the question; the screening condition is used to indicate the conditions that the user's question matching the question needs to meet;

[0137] A target question determination unit 42, configured to determine a target question matching the user's question from the Q&A library based on the similarity between the user's question and each question in the Q&A library, and the screening conditions corresponding to each question;

[0138] An answer determination unit 43, configured to determine an answer corresponding to the user's question based on the answer corresponding to the target question.

[0139] As an implementable manner, the target question determination unit includes:

[0140] A search unit, configured to search the Q&A library for a preset number of questions whose similarity to the user's question meets a preset condition as candidate questions;

[0141] A screening unit, configured to screen out questions that are initially matched with the user's question from the candidate questions based on the screening conditions corresponding to each candidate question;

[0142] A determination unit, configured to determine a target question matching the user's question from the questions that are initially matched with the user's question, where the target question is the question with the highest similarity to the user's question among the questions that are initially matched with the user's question.

[0143] As an implementable manner, the screening unit includes:

[0144] A screening condition determination unit, configured to determine whether the user's question meets the screening conditions corresponding to each candidate question;

[0145] A screening processing unit, configured to determine that the candidate question is a question that is initially matched with the user's question if the user's question meets the screening conditions corresponding to the candidate question.

[0146] As an implementable manner, the screening conditions include matching conditions, and / or exclusion conditions.

[0147] As an implementable manner, when the screening conditions include matching conditions, the screening condition determination unit is specifically configured to:

[0148] Determine whether the user's question meets at least one matching condition corresponding to the candidate question;

[0149] If the user's question meets at least one matching condition corresponding to the candidate question, determine that the user's question meets the screening conditions corresponding to the candidate question.

[0150] As an implementable manner, when the screening conditions include exclusion conditions, the screening condition determination unit is specifically configured to:

[0151] Determine whether the user question meets the exclusion conditions corresponding to the candidate question;

[0152] If the user question does not meet all the exclusion conditions corresponding to the candidate question, determine that the user question meets the screening conditions corresponding to the candidate question.

[0153] As an implementable manner, the answer determination unit includes:

[0154] A category determination unit, configured to determine the category of the user question;

[0155] An adjustment unit, configured to adjust the answer corresponding to the target question to generate an answer corresponding to the user question when it is determined that the category of the user question is a judgment category.

[0156] As an implementable manner, the category determination unit includes:

[0157] A classification model application unit, configured to input the user question into a trained classification model, and the classification model outputs the category of the user question. The classification model is trained with training user questions as training samples and the categories labeled by the training user questions as sample labels. The categories labeled by the training user questions include non-judgment categories and judgment categories.

[0158] As an implementable manner, each record in the Q&A library further includes a judgment rule corresponding to the question. Then, the adjustment unit includes:

[0159] A judgment result generation unit, configured to judge whether the user question meets the judgment rule corresponding to the target question and generate a judgment result;

[0160] An answer adjustment unit, configured to adjust the answer corresponding to the target question based on the judgment result to generate an answer corresponding to the user question.

[0161] As an implementable manner, the judgment rule includes a text-based judgment rule or a numerical-based judgment rule.

[0162] Refer to Figure 5 , Figure 5 is the hardware structure block diagram of the Q&A processing device provided in the embodiment of the present application. Refer to Figure 5 , the hardware structure of the Q&A processing device may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;

[0163] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 complete mutual communication through the communication bus 4;

[0164] The processor 1 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;

[0165] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0166] Wherein, the memory stores a program, and the processor can call the program stored in the memory, and the program is used for:

[0167] Obtain a user question and a question-answer library corresponding to the user question. The question-answer library includes multiple records, and each record includes a question, an answer corresponding to the question, and a screening condition corresponding to the question; the screening condition is used to indicate the conditions that the user question matching the question needs to meet;

[0168] Based on the similarity between the user question and each question in the question-answer library, and the screening conditions corresponding to each question, determine a target question matching the user question from the question-answer library;

[0169] Based on the answer corresponding to the target question, determine an answer corresponding to the user question.

[0170] Optionally, the refinement function and expansion function of the program can be referred to the above description.

[0171] The embodiment of the present application also provides a readable storage medium, which can store a program suitable for being executed by a processor, and the program is used for:

[0172] Obtain a user question and a question-answer library corresponding to the user question. The question-answer library includes multiple records, and each record includes a question, an answer corresponding to the question, and a screening condition corresponding to the question; the screening condition is used to indicate the conditions that the user question matching the question needs to meet;

[0173] Based on the similarity between the user question and each question in the question-answer library, and the screening conditions corresponding to each question, determine a target question matching the user question from the question-answer library;

[0174] Based on the answer corresponding to the target question, determine an answer corresponding to the user question.

[0175] Optionally, the refinement function and expansion function of the program can be referred to the above description.

[0176] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.

[0177] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same and similar parts among the various embodiments, reference can be made to each other.

[0178] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A question and answer processing method, characterized in that, the method includes: obtaining a user's question and a question and answer library corresponding to the user's question, where the question and answer library includes multiple records, each record includes a question, an answer corresponding to the question, and a screening condition corresponding to the question; the screening condition is used to indicate the conditions that a user's question matching the question needs to meet; finding a preset number of questions with a similarity to the user's question meeting a preset condition in the question and answer library as candidate questions; determining whether the user's question meets at least one matching condition corresponding to the candidate question, where the matching condition is used to indicate the conditions that a user's question matching the question needs to meet; determining whether the user's question meets the exclusion condition corresponding to the candidate question, where the exclusion condition is used to indicate the conditions that a user's question matching the question does not need to meet; if the user's question meets at least one matching condition corresponding to the candidate question, then determine that the user's question meets the screening condition corresponding to the candidate question; or; if the user's question does not meet all the exclusion conditions corresponding to the candidate question, then determine that the user's question meets the screening condition corresponding to the candidate question; or; if the user's question meets at least one matching condition corresponding to the candidate question and the user's question does not meet all the exclusion conditions corresponding to the candidate question, then determine that the user's question meets the screening condition corresponding to the candidate question; if the user's question meets the screening condition corresponding to the candidate question, then determine that the candidate question is a question preliminarily matching the user's question; determining a target question matching the user's question from the questions preliminarily matching the user's question, where the target question is the question with the highest similarity to the user's question among the questions preliminarily matching the user's question; determining the category of the user's question; when it is determined that the category of the user's question is a judgment type, adjusting the answer corresponding to the target question to generate an answer corresponding to the user's question.

2. The method according to claim 1, characterized in that, the determining the category of the user's question includes: inputting the user's question into a trained classification model, and the classification model outputs the category of the user's question. The classification model is trained with training user questions as training samples and the categories labeled for the training user questions as sample labels. The categories labeled for the training user questions include non - judgment types and judgment types.

3. The method according to claim 1, characterized in that, each record in the question and answer library further includes a judgment rule corresponding to the question. Then, when it is determined that the category of the user's question is a judgment type, adjusting the answer corresponding to the target question to generate an answer corresponding to the user's question includes: judging whether the user's question meets the judgment rule corresponding to the target question to generate a judgment result; adjusting the answer corresponding to the target question based on the judgment result to generate an answer corresponding to the user's question.

4. The method according to claim 3, characterized in that, The judgment rules include text-based judgment rules or numeric-based judgment rules.

5. A question and answer processing device, characterized in that the device includes: an acquisition unit, configured to acquire a user's question and a question and answer library corresponding to the user's question, where the question and answer library includes multiple records, each record includes a question, an answer corresponding to the question, and a screening condition corresponding to the question; the screening condition is used to indicate the conditions that the user's question matching the question needs to meet; a target question determination unit, configured to find a preset number of questions whose similarity to the user's question meets a preset condition from the question and answer library as candidate questions; determine whether the user's question meets at least one matching condition corresponding to the candidate question, where the matching condition is used to indicate the conditions that the user's question matching the question needs to meet; determine whether the user's question meets the exclusion condition corresponding to the candidate question, where the exclusion condition is used to indicate the conditions that the user's question matching the question does not need to meet; if the user's question meets at least one matching condition corresponding to the candidate question, then determine that the user's question meets the screening condition corresponding to the candidate question; or; if the user's question does not meet all the exclusion conditions corresponding to the candidate question, then determine that the user's question meets the screening condition corresponding to the candidate question; or; if the user's question meets at least one matching condition corresponding to the candidate question and the user's question does not meet all the exclusion conditions corresponding to the candidate question, then determine that the user's question meets the screening condition corresponding to the candidate question; if the user's question meets the screening condition corresponding to the candidate question, then determine that the candidate question is a question preliminarily matching the user's question; from the questions preliminarily matching the user's question, determine a target question matching the user's question, where the target question is the question with the highest similarity to the user's question among the questions preliminarily matching the user's question; an answer determination unit, configured to determine the category of the user's question; when it is determined that the category of the user's question is a judgment category, adjust the answer corresponding to the target question to generate an answer corresponding to the user's question.

6. A question and answer processing device, characterized in that it includes a memory and a processor; the memory is used to store a program; the processor is configured to execute the program to implement each step of the question and answer processing method according to any one of claims 1 to 4.

7. A readable storage medium, on which a computer program is stored, characterized in that when the computer program is executed by a processor, each step of the question and answer processing method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Method and device for automatically generating test questions

    CN110543550A

  • Automatic question answering method and apparatus for man-machine interaction, and intelligent device

    WO2021147421A1