Question and answer method and device, electronic equipment and storage medium
Through multiple rounds of question-and-answer operations and large language model input methods, the problem of complex multi-hop problems with low search efficiency and accuracy in the existing technology is solved, and more efficient and accurate question-and-answer search results are achieved.
Patent Information
- Application Number
- CN202411366430.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-02-18
AI Technical Summary
When existing search-enhanced question-and-answer questions, it is difficult to retrieve complete knowledge from the knowledge base when dealing with complex multi-hop problems, resulting in low retrieval efficiency and accuracy.
By receiving the target question, determine the initial clue question and Q&A results. If it does not match, perform multiple rounds of Q&A operations until the Q&A results combination match the target question, and input all Q&A pairs into the large language model to generate answers.
The accuracy and efficiency of question-and-answer questions for complex multi-hop questions are improved. Through multiple disassembly and clue extraction, the difficulty of each search is reduced, and the accuracy and result quality of the answers are improved.
Smart Images

Figure CN119474296A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a question-answering method, device, electronic device, and storage medium. Background Art
[0002] At present, retrieval-enhanced question-answering solutions usually perform knowledge base retrieval based on user questions, input the retrieved knowledge and user questions into a large model, and generate specific answers. However, when dealing with complex multi-hop questions, retrieval-enhanced question-answering solutions are difficult to directly retrieve the corresponding complete knowledge from the knowledge base, and the knowledge required to answer complex multi-hop questions is distributed in different document fragments. Conventional solutions cannot determine which document fragments enter the answer generation stage, resulting in the above solutions being unable to cope with complex multi-hop problems, and low retrieval efficiency and accuracy. Summary of the invention
[0003] The present disclosure provides a question-answering method, device, electronic device and storage medium to at least solve the above technical problems existing in the prior art.
[0004] According to a first aspect of the present disclosure, a question-answering method is provided, the method comprising:
[0005] Receive the first target question;
[0006] Determine a first clue question according to the first target question, and determine a first question-and-answer result corresponding to the first clue question;
[0007] Determining whether the first question-and-answer result matches the first target question;
[0008] If the first question-and-answer result does not match the first target question, perform at least one round of question-and-answer operations, and obtain a set of second question-and-answer pairs in each round of question-and-answer operations, until the combination of the first question-and-answer result and each second question-and-answer result can match the first target question; input the first question-and-answer pair, each second question-and-answer pair, and the first target question into a large language model to obtain a target answer to the first target question;
[0009] Among them, the first question and answer pair includes: a first clue question and a first question and answer result; and each second question and answer pair includes: a second clue question used in each round of question and answer operation and a second question and answer result corresponding to the second clue question.
[0010] According to a second aspect of the present disclosure, a question-answering device is provided, the device comprising:
[0011] A receiving module, used for receiving a first target question;
[0012] A first processing module, configured to determine a first clue question according to the first target question, and determine a first question-and-answer result corresponding to the first clue question;
[0013] A second processing module is used to determine whether the first question-and-answer result matches the first target question;
[0014] If the first question-and-answer result does not match the first target question, perform at least one round of question-and-answer operations, and obtain a set of second question-and-answer pairs in each round of question-and-answer operations, until the combination of the first question-and-answer result and each second question-and-answer result can match the first target question; input the first question-and-answer pair, each second question-and-answer pair, and the first target question into a large language model to obtain a target answer to the first target question;
[0015] Among them, the first question and answer pair includes: a first clue question and a first question and answer result; and each second question and answer pair includes: a second clue question used in each round of question and answer operation and a second question and answer result corresponding to the second clue question.
[0016] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0017] at least one processor; and
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the present disclosure.
[0020] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method described in the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:
[0022] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0023] Figure 1 A schematic diagram of a process flow of a question-answering method provided by an embodiment of the present disclosure is shown;
[0024] Figure 2 A schematic diagram of a process flow of a question-answering method provided by an application embodiment of the present disclosure is shown;
[0025] Figure 3 A schematic diagram showing a flow chart of another question-answering method provided by an application embodiment of the present disclosure;
[0026] Figure 4 A schematic diagram of the structure of a question-answering device provided by an embodiment of the present disclosure is shown;
[0027] Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0028] In order to make the purpose, features, and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0029] Figure 1 A flowchart of a question-answering method provided by an embodiment of the present disclosure is shown; Figure 1 As shown, the question-answering method includes:
[0030] Step 101: receiving a first target question;
[0031] Step 102: determining a first clue question according to the first target question, and determining a first question-and-answer result corresponding to the first clue question;
[0032] Step 103: Determine whether the first question-and-answer result matches the first target question;
[0033] Step 104: If the first question-and-answer result does not match the first target question, perform at least one round of question-and-answer operations, and obtain a set of second question-and-answer pairs in each round of question-and-answer operations, until the combination of the first question-and-answer result and each second question-and-answer result can match the first target question; input the first question-and-answer pair, each second question-and-answer pair, and the first target question into a large language model to obtain a target answer to the first target question;
[0034] Among them, the first question and answer pair includes: a first clue question and a first question and answer result; and each second question and answer pair includes: a second clue question used in each round of question and answer operation and a second question and answer result corresponding to the second clue question.
[0035] In some embodiments, the question-answering method is applied to any smart device, the smart device is connected to a device having a large language model, or the smart device has the large language model.
[0036] For example, the smart device may be a computer, a server, a cloud server, etc.
[0037] In some embodiments, the large language model is used to generate an answer corresponding to the target question based on the target question, at least one clue question extracted from the target question, and the question and answer results corresponding to each clue question (such as a first question and answer pair and a second question and answer pair).
[0038] The large language model can be an existing model or pre-trained. The large language model can be any one, for example, BERT (Bidirectional Encoder Representations from Transformers) model, GPT (Generative Pre-trained Transformer) model, T5 (Text-To-Text Transfer Transformer) model, RoBERTa (Robustly optimized BERT approach) model, XLNet (eXtreme Language Network) model, ALBERT (A Lite BERT) model, Claude model, etc., without limitation here.
[0039] In some embodiments, determining the first clue question according to the first target question includes:
[0040] A first clue question is extracted from the first target question by using a first model; a first question-and-answer result corresponding to the first clue question can partially match the first target question.
[0041] Here, the first model can be any model used to extract clue questions, and the first model can use a heuristic method to extract clue questions.
[0042] Here, the first model can adopt a BERT model, a GPT model, a T5 model, etc.
[0043] The first model can be an existing model or pre-trained. For example, a first data set is prepared. The first data set can be obtained by manual annotation, generating simulated data, or using an existing data set. Each training data in the first data set includes a question and a clue question corresponding to the question. The first data set is used to train a preset language model to obtain a trained model as the first model.
[0044] Here, the first model is used to decompose complex problems, such as the first target problem, layer by layer. For example, the first clue question is first extracted, and the first question and answer result corresponding to the first clue question can match part of the first target question.
[0045] Here, the first question and answer result corresponding to the first clue question can match part of the first target question, indicating that the first question and answer result can partially support or be related to the content of the first target question.
[0046] Provide an example, such as Figure 2 As shown, the first target question is "Who is the CEO of the largest company in A's hometown?", and the first clue question can be "Where is A's hometown?". In this way, the question and answer result of the first clue question at least partially solves the unknown part of "A's hometown" in the first target question.
[0047] In some embodiments, the at least one round of question-answering operation includes:
[0048] Determine a second clue question for this round of question-answering operation based on the first target question and the question-answering result obtained in the previous round of question-answering operation; and determine a second question-answering result corresponding to the second clue question;
[0049] Determine whether the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation matches the first target question; if the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation does not match the first target question, execute the next round of question and answer operation.
[0050] In some embodiments, the method further comprises:
[0051] If the first question-and-answer result matches the first target question, the first question-and-answer pair and the first target question are input into a large language model to obtain a target answer to the first target question.
[0052] Here, by judging whether the first question and answer result matches the first target question, it is determined whether the current first question and answer pair can completely obtain the answer to the first target question. If the first question and answer result does not match the first target question, it means that the clue questions currently extracted are insufficient and cannot completely match the first target question. The first target question needs to be further decomposed to obtain more clue questions, that is, to perform at least one round of question and answer operation.
[0053] In this way, by decomposing the first target question layer by layer and using each clue question obtained from the decomposition to perform question and answer retrieval, the difficulty of each question and answer retrieval is reduced, thereby improving the accuracy of the question and answer retrieval; finally, all clue questions and corresponding question and answer results (i.e., the first question and answer pair and each second question and answer pair) are summarized to obtain the target answer corresponding to the first target question, thereby improving the accuracy of the target answer and the quality of the result.
[0054] In some embodiments, determining the second clue question used in the current round of question-and-answer operation according to the first target question and the question-and-answer result obtained in the previous round of question-and-answer operation includes:
[0055] Determine a second target question using the second model according to the first target question and the question-answering result obtained in the previous round of question-answering operation;
[0056] Using the first model, extracting a second clue question from the second target question;
[0057] The second model is used to rewrite the question according to the target question and the question-and-answer result related to the target question to obtain the rewritten target question; for example, rewrite the question according to the first target question and the first question-and-answer result related to the first target question to obtain the rewritten second target question;
[0058] The second question and answer result corresponding to the second clue question can match part of the first target question.
[0059] Here, the second model can be any model used for question rewriting, for example, a BERT model, a GPT model, a T5 model, etc.
[0060] The second model can be an existing model or pre-trained. For example, prepare a second data set, which can be obtained by manual annotation, generating simulated data, etc. Each training data in the second data set includes: a data combination of the target question and the question-answering result obtained in the previous round of question-answering operation, and a rewritten question corresponding to the data combination; use the second data set to train a preset language model to obtain a trained model as the second model.
[0061] Here, the second model is used to rewrite complex problems, such as the first target problem. The second target problem obtained by each rewriting is a simplification of the first target problem, from which the next clue problem can be further extracted.
[0062] Combination Figure 2 For example, the first target question is "Who is the CEO of the largest company in A's hometown?" The first clue question can be "Where is A's hometown?" Assume that the answer to the first clue question is "Region B";
[0063] The first round of question-answering operations may include: rewriting the first target question to obtain the second target question 1, which may be "Who is the CEO of the largest company in region B?" In this way, based on the part of the content in the first target question "where is A's hometown?", the first target question is simplified after the question is rewritten. Then, the first model is used to extract clue questions for the second target question 1 "Who is the CEO of the largest company in region B?", and a second clue question 1 is extracted, which may be "Which company is the largest company in region B?", assuming that the question-answering result is "Company C."
[0064] The second round of question-and-answer operations may include: determining the second target question 2, which may be "Who is the CEO of Company C in Region B", based on the first target question and the question-and-answer result "Company C" obtained from the previous round of question-and-answer operations; then, using the first model to extract clue questions for the second target question 2 "Who is the CEO of Company C in Region B", and the extracted second clue question 2 may be "Who is the CEO of Company C in Region B", assuming that the question-and-answer result is "Mr. D".
[0065] Of course, after each round of question-and-answer operations, it can be determined whether the combination of the first question-and-answer result and the second question-and-answer results obtained by the executed question-and-answer operations matches the first target question. If they do not match, the next round of question-and-answer operations is entered. If they match, the target answer can be determined.
[0066] It should be noted that since each second target question is obtained by rewriting the original first target question, the judgment of whether the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation matches the first target question can also be the judgment of whether the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation matches the latest obtained second target question. The meaning is the same and is not limited here.
[0067] In some embodiments, determining whether the first question-and-answer result matches the first target question includes:
[0068] The first target question and the first question-and-answer result are identified by using a third model to obtain an identification result, wherein the identification result is used to characterize whether the first question-and-answer result matches the first target question.
[0069] Here, the third model can be any model used to identify whether the question and answer results match, for example, a BERT model, a GPT model, a T5 model, etc.
[0070] The second model can be an existing model or pre-trained. For example, a third data set is prepared, and the third data set can be obtained by manual annotation, generating simulated data, etc. Each training data in the third data set includes: a data combination, and a matching result corresponding to the data combination, wherein the data combination includes: a target question and at least one question-and-answer result; the third data set is used to train a preset language model to obtain a trained model as the third model.
[0071] In one example, using the third model to identify the first target question and the first question-and-answer result to obtain the identification result may include:
[0072] The first target question and the first question-and-answer result are input into a third model to obtain a recognition result.
[0073] In another example, using the third model to identify the first target question and the first question-and-answer result to obtain the identification result may include:
[0074] The first target question and the first clue question corresponding to the first question-and-answer result are input into the third model to obtain a recognition result.
[0075] It should be understood that the first question-answer result corresponding to the first clue question can match part of the first target question, which actually means that the first clue question can match part of the first target question. Therefore, recognition can also be performed based on the first clue question. Of course, if the third model is trained, it only needs to adjust the data used for its training and train it, which will not be elaborated here.
[0076] In yet another example, using the third model to identify the first target question and the first question-and-answer result to obtain the identification result may include:
[0077] The first target question and the first question-answer pair are input into the third model to obtain a recognition result.
[0078] It should be understood that the first question-and-answer result corresponding to the first clue question can match part of the first target question, which actually also means that the first question-and-answer pair consisting of the first clue question and the first question-and-answer result can match part of the first target question. Therefore, recognition can also be performed based on the first question-and-answer pair. Of course, if the third model is obtained through training, it only needs to be trained by adjusting the data used for its training, which will not be elaborated here.
[0079] In some embodiments, determining whether a combination of the first question-and-answer result and each second question-and-answer result obtained by the executed question-and-answer operation matches the first target question includes:
[0080] Using the third model, the first target question and the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation are identified to obtain a recognition result, wherein the recognition result is used to characterize whether the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation matches the first target question.
[0081] In one example, using the third model to identify the first target question and a combination of the first question-and-answer result and each second question-and-answer result obtained by the executed question-and-answer operation may include:
[0082] The first target question, the first question-and-answer result, and the combination of each second question-and-answer result obtained by the executed question-and-answer operation are input into the third model to obtain a recognition result.
[0083] In another example, using the third model to identify the first target question and a combination of the first question-and-answer result and each second question-and-answer result obtained by the executed question-and-answer operation may include:
[0084] The first target question and the combination of the first clue question and each second clue question obtained by the executed question-and-answer operation are input into the third model to obtain a recognition result.
[0085] In yet another example, using the third model to identify the first target question and a combination of the first question-and-answer result and each second question-and-answer result obtained by the executed question-and-answer operation may include:
[0086] The first target question and a combination of the first question-answer pair and each second question-answer pair obtained by the executed question-answer operation are input into a third model to obtain a recognition result.
[0087] It should be understood that, similar to the first question-and-answer result, the second question-and-answer result corresponding to the second clue question can match part of the first target question, and actually represents each second clue question, or each second question-and-answer pair consisting of each second clue question and its corresponding second question-and-answer result can match part of the first target question. Therefore, recognition can also be performed based on each second clue question or each second question-and-answer pair. Of course, if the third model is obtained by training, it only needs to adjust the data used for its training and train it, and no further details will be given here.
[0088] In some embodiments, determining a first question-and-answer result corresponding to the first clue question includes:
[0089] Using the first clue question to query the target knowledge base, obtain clue content corresponding to the first clue question;
[0090] According to the first clue question and the clue content corresponding to the first clue question, a first question-and-answer result corresponding to the first clue question is generated.
[0091] In each round of question-and-answer operation, determining the second question-and-answer result corresponding to the second clue question may include:
[0092] Using the second clue question to query the target knowledge base, obtain clue content corresponding to the second clue question;
[0093] Based on the second clue question and the clue content corresponding to the second clue question, a second question and answer result corresponding to the second clue question is generated.
[0094] Here, the target knowledge base may be a pre-built knowledge base, which has various clue questions and corresponding question-and-answer results for the problems to be solved. When applied, the target knowledge base is queried using clue questions (such as the first clue question) to obtain clue content corresponding to the first clue question; based on the first clue question and the clue content corresponding to the first clue question, a first question-and-answer result corresponding to the first clue question is generated.
[0095] The method provided by the embodiment of the present disclosure reduces the difficulty of each retrieval by multiple decompositions of the first target question and extraction of clue questions, thereby improving the accuracy of knowledge fragment retrieval. After the clue questions are extracted, the corresponding question and answer results are obtained for each clue question, and then the question and answer pairs are obtained. When the target answer is finally generated, the combination of the first target question, the first question and answer pair, and each second question and answer pair is used as the input of the large language model. Since each clue question and question and answer result are extracted by a heuristic method, the target answer finally generated by the summary must be related to or partially matched with the initial question (i.e., the first target question), thereby reducing the context length and irrelevant information input to the large language model, improving the quality and accuracy of the generated results, and better interpretability.
[0096] Figure 3 FIG. 2 shows a flow chart of another question-answering method provided by an application embodiment of the present disclosure; Figure 3 As shown, the question-answering method includes:
[0097] Step 301: determine the original question q input by the user;
[0098] Step 302: extract clue question q1 from original question q using a heuristic method, use clue question q1 to search the knowledge base, and obtain question-answer result a1 corresponding to clue question q1;
[0099] Step 303: determine whether the question-answer result a1 corresponding to the clue question q1 can support the answer to the original question; if it can, proceed to step 304; if not, proceed to step 305;
[0100] Step 304: input the original question, clue question q1, and question-answer result a1 into the large language model to obtain the answer to the original question;
[0101] Step 305: determine the current question, extract clue questions from the current question, use the clue questions to search the knowledge base, and obtain the question and answer results corresponding to the clue questions;
[0102] Step 306: determine whether the obtained clue questions and the question-answer results corresponding to the clue questions can support answering the current question; if so, proceed to step 307; if not, return to step 305;
[0103] Here, each execution of step 305 and step 306 is equivalent to executing a question-answering operation, obtaining a second question-answer pair, and thus obtaining [(q1, a1), (q2, a2) ... (qk, ak)].
[0104] Wherein, 1 represents the clue question extracted for the first time and the question-answer result of the clue question extracted this time, and correspondingly, (q1, a1) is the first question-answer pair consisting of the clue question and the question-answer result obtained in step 302;
[0105] k represents the kth extracted clue question and the question and answer result of the clue question extracted this time. Correspondingly, (q2, a2) is the second question and answer pair consisting of the clue question and the question and answer result obtained by the first execution of step 305, and (qk, ak) is the second question and answer consisting of the clue question and the question and answer result obtained by the k-1th execution of step 305.
[0106] Here, the current question can be determined in step 305 by using a question rewriting method. For example, when step 305 is executed for the first time, the current question used in this round of question-answering operation is determined based on the original question q and the question-answering result a1 obtained in the previous round of question-answering operation (equivalent to determining the second target question once); when step 305 is executed for the second time, the current question used in this round of question-answering operation is determined based on the original question q and the question-answering result a2 obtained in the previous round of question-answering operation (or the current question in the previous round of question-answering operation and the question-answering result a2 obtained in the previous round of question-answering operation) (equivalent to determining a second target question again); and so on.
[0107] Here, since the current question is obtained by extracting and retrieving some clue questions based on the original question and then rewriting the question, it is necessary to judge whether the clue questions obtained and the question and answer results corresponding to each clue question can support answering the current question. It can also be judged whether the clue questions obtained and the question and answer results corresponding to each clue question can support answering the original question.
[0108] Step 307: Input (q, [(q1, a1) ... (qk, ak)]) into the large language model to obtain the answer to the original question q.
[0109] Here, q represents the original question. Through the above method, a complex question q can be decomposed layer by layer to obtain a series of question-answer pairs [(q1,a1)...(qk,ak)] consisting of clue questions and question-answer results as the input of the large language model. In this way, through multiple decompositions and extraction of clue questions, the difficulty of each retrieval is reduced, thereby improving the accuracy of knowledge fragment retrieval. Since the clue questions and their question-answer results are extracted through heuristic methods, the target answer generated by the final summary must be related to the original question q, thereby reducing the context length and irrelevant information input to the large language model, improving the quality and accuracy of the generated results, and making them more interpretable.
[0110] Figure 4 FIG. 4 shows a schematic diagram of the structure of a question-answering device provided by an embodiment of the present disclosure; Figure 4 As shown, the question-answering device comprises:
[0111] A receiving module, used for receiving a first target question;
[0112] A first processing module, configured to determine a first clue question according to the first target question, and determine a first question-and-answer result corresponding to the first clue question;
[0113] A second processing module is used to determine whether the first question-and-answer result matches the first target question;
[0114] If the first question-and-answer result does not match the first target question, perform at least one round of question-and-answer operations, and obtain a set of second question-and-answer pairs in each round of question-and-answer operations, until the combination of the first question-and-answer result and each second question-and-answer result can match the first target question; input the first question-and-answer pair, each second question-and-answer pair, and the first target question into a large language model to obtain a target answer to the first target question;
[0115] Among them, the first question and answer pair includes: a first clue question and a first question and answer result; and each second question and answer pair includes: a second clue question used in each round of question and answer operation and a second question and answer result corresponding to the second clue question.
[0116] In some embodiments, the second processing module is used to perform at least one round of question-answering operation;
[0117] Question and answer operations include:
[0118] Determine a second clue question for this round of question-answering operation based on the first target question and the question-answering result obtained in the previous round of question-answering operation; and determine a second question-answering result corresponding to the second clue question;
[0119] Determine whether the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation matches the first target question; if the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation does not match the first target question, execute the next round of question and answer operation.
[0120] In some embodiments, the first processing module is used to extract a first clue question from the first target question using a first model; the first question and answer result corresponding to the first clue question can match part of the first target question.
[0121] In some embodiments, the second processing module is used to determine the second target question using the second model according to the first target question and the question-answering result obtained in the previous round of question-answering operation;
[0122] Using the first model, extracting a second clue question from the second target question;
[0123] The second model is used to rewrite the question according to the target question and the question-answering results related to the target question to obtain the rewritten target question;
[0124] The second question and answer result corresponding to the second clue question can match part of the first target question.
[0125] In some embodiments, the second processing module is used to use a third model to identify the first target question and the first question and answer result to obtain a recognition result, and the recognition result is used to characterize whether the first question and answer result matches the first target question.
[0126] In some embodiments, the second processing module is used to use a third model to identify the first target question and the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation, and obtain a recognition result, wherein the recognition result is used to characterize whether the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation matches the first target question.
[0127] In some embodiments, the first processing module is used to query the target knowledge base using the first clue question to obtain clue content corresponding to the first clue question;
[0128] According to the first clue question and the clue content corresponding to the first clue question, a first question-and-answer result corresponding to the first clue question is generated.
[0129] It is understandable that when the question-answering device provided in the above embodiment implements the corresponding question-answering method, the above processing can be assigned to different program modules as needed to complete all or part of the processing described above. In addition, the device provided in the above embodiment and the embodiment of the corresponding method belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0130] An embodiment of the present disclosure provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will be triggered to execute the question-and-answer method provided by the embodiment of the present disclosure.
[0131] In some embodiments, the computer-readable storage medium may be a ferroelectric random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disk, or a CD-ROM; it may also be various devices including one or any combination of the above memories.
[0132] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, model, subroutine or other unit suitable for use in a computing environment.
[0133] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0134] An embodiment of the present disclosure provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the question-answering method described in the present disclosure is implemented.
[0135] Figure 5 The structure diagram of an electronic device provided by the embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the electronic device 50 includes: a processor 501 and a memory 502 for storing a computer program that can be run on the processor; when the processor 501 is used to run the computer program, it executes the question-answering method provided by the embodiment of the present disclosure.
[0136] In actual application, the electronic device 50 may further include: at least one network interface 503. The various components in the electronic device 50 are coupled together via a bus system 504. It is understood that the bus system 504 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 504 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 5 In the figure, various buses are all labeled as bus system 504. There may be at least one processor 501. The network interface 503 is used for wired or wireless communication between the electronic device 50 and other devices.
[0137] The memory 502 in the embodiment of the present disclosure is used to store various types of data to support the operation of the electronic device 50 .
[0138] The method disclosed in the above embodiment of the present disclosure can be applied to the processor 501, or implemented by the processor 501. The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 501 or the instruction in the form of software. The above processor 501 can be a general processor, a digital signal processor (DSP, DiGital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 501 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiment of the present disclosure. The general processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present disclosure can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be combined to execute. The software module can be located in a storage medium, which is located in the memory 502. The processor 501 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware.
[0139] In some embodiments, the electronic device 50 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.
[0140] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0141] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0142] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A question-answering method, characterized in that: The method comprises: Receive the first target question; Determine a first clue question according to the first target question, and determine a first question-and-answer result corresponding to the first clue question; Determining whether the first question-and-answer result matches the first target question; If the first question-and-answer result does not match the first target question, perform at least one round of question-and-answer operations, and obtain a set of second question-and-answer pairs in each round of question-and-answer operations, until the combination of the first question-and-answer result and each second question-and-answer result can match the first target question; input the first question-and-answer pair, each second question-and-answer pair, and the first target question into a large language model to obtain a target answer to the first target question; Among them, the first question and answer pair includes: a first clue question and a first question and answer result; and each second question and answer pair includes: a second clue question used in each round of question and answer operation and a second question and answer result corresponding to the second clue question.
2. The method according to claim 1, characterized in that: The at least one round of question-answering operation includes: Determine a second clue question for this round of question-and-answer operation based on the first target question and the question-and-answer result obtained in the previous round of question-and-answer operation; and determine a second question-and-answer result corresponding to the second clue question; Determine whether the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation matches the first target question; if the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation does not match the first target question, execute the next round of question and answer operation.
3. The method according to claim 1, characterized in that Determining the first clue question according to the first target question includes: A first clue question is extracted from the first target question by using a first model; a first question-and-answer result corresponding to the first clue question can partially match the first target question.
4. The method according to claim 2, characterized in that: According to the first target question and the question-answering result obtained in the previous round of question-answering operation, the second clue question used in the current round of question-answering operation is determined, including: Determine a second target question using the second model according to the first target question and the question-answering result obtained in the previous round of question-answering operation; Using the first model, extracting a second clue question from the second target question; The second model is used to rewrite the question according to the target question and the question-answering results related to the target question to obtain the rewritten target question; The second question and answer result corresponding to the second clue question can match part of the first target question.
5. The method according to claim 1, characterized in that Determining whether the first question-and-answer result matches the first target question includes: The first target question and the first question-and-answer result are identified by using a third model to obtain an identification result, wherein the identification result is used to characterize whether the first question-and-answer result matches the first target question.
6. The method according to claim 2, characterized in that Determining whether a combination of the first question-and-answer result and each second question-and-answer result obtained by the executed question-and-answer operation matches the first target question includes: Using the third model, the first target question and the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation are identified to obtain a recognition result, wherein the recognition result is used to characterize whether the combination of the first question and answer result and the second question and answer results obtained by the executed question and answer operation matches the first target question.
7. The method according to claim 1, characterized in that Determining a first question-and-answer result corresponding to the first clue question includes: Using the first clue question to query the target knowledge base, obtain clue content corresponding to the first clue question; According to the first clue question and the clue content corresponding to the first clue question, a first question-and-answer result corresponding to the first clue question is generated.
8. A question-answering device, characterized in that: The device comprises: A receiving module, used for receiving a first target question; A first processing module, configured to determine a first clue question according to the first target question, and determine a first question-and-answer result corresponding to the first clue question; A second processing module is used to determine whether the first question-and-answer result matches the first target question; If the first question-and-answer result does not match the first target question, perform at least one round of question-and-answer operations, and obtain a set of second question-and-answer pairs in each round of question-and-answer operations, until the combination of the first question-and-answer result and each second question-and-answer result can match the first target question; input the first question-and-answer pair, each second question-and-answer pair, and the first target question into a large language model to obtain a target answer to the first target question; Among them, the first question and answer pair includes: a first clue question and a first question and answer result; and each second question and answer pair includes: a second clue question used in each round of question and answer operation and a second question and answer result corresponding to the second clue question.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute: Receive the first target question; Determine a first clue question according to the first target question, and determine a first question-and-answer result corresponding to the first clue question; Determining whether the first question-and-answer result matches the first target question; If the first question-and-answer result does not match the first target question, perform at least one round of question-and-answer operations, and obtain a set of second question-and-answer pairs in each round of question-and-answer operations, until the combination of the first question-and-answer result and each second question-and-answer result can match the first target question; input the first question-and-answer pair, each second question-and-answer pair, and the first target question into a large language model to obtain a target answer to the first target question; Among them, the first question and answer pair includes: a first clue question and a first question and answer result; and each second question and answer pair includes: a second clue question used in each round of question and answer operation and a second question and answer result corresponding to the second clue question.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute: Receive the first target question; Determine a first clue question according to the first target question, and determine a first question-and-answer result corresponding to the first clue question; Determining whether the first question-and-answer result matches the first target question; If the first question-and-answer result does not match the first target question, perform at least one round of question-and-answer operations, each round of question-and-answer operations obtaining a set of second question-and-answer pairs, until the combination of the first question-and-answer result and each second question-and-answer result can match the first target question; Inputting the first question-answer pair, the second question-answer pairs, and the first target question into a large language model to obtain a target answer to the first target question; Among them, the first question and answer pair includes: a first clue question and a first question and answer result; and each second question and answer pair includes: a second clue question used in each round of question and answer operation and a second question and answer result corresponding to the second clue question.