Knowledge question-answering method and device based on large model and intelligent agent

The use of a large model to automatically determine knowledge question and answer pairs addresses the high costs and long update cycles of manual FAQ-based methods, enhancing accuracy and efficiency in knowledge question answering.

CN119150991APending Publication Date: 2024-12-17BAIDU INT TECH (SHENZHEN) CO LTD

Patent Information

Application Number
CN202411274557.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

Current knowledge question answering methods based on Frequently Asked Questions (FAQ) require manual generation of knowledge bases, leading to high generation costs and long update cycles.

Method used

A method and device utilizing a large model to automatically determine knowledge question and answer pairs by extracting candidate questions and answers, with scoring and threshold-based validation, enabling efficient and timely updates to the knowledge base.

Benefits of technology

The method improves the accuracy and efficiency of knowledge question answering by reducing costs and shortening update cycles while ensuring consistency with the knowledge base content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150991A_ABST
    Figure CN119150991A_ABST
Patent Text Reader

Abstract

The invention provides a knowledge question-answering method and device based on a large model and an intelligent agent, and relates to the technical field of artificial intelligence, in particular to the technical fields of deep learning, cloud computing, natural language processing, large models and the like. According to the specific implementation scheme, a knowledge base and candidate questions in knowledge texts in the knowledge base are obtained; obtaining a first candidate answer corresponding to the candidate question and a first score value of the first candidate answer according to the knowledge text and the large model; when the first score value is greater than or equal to a score threshold value, obtaining a first knowledge question-answer pair according to the candidate question and the first candidate answer; determining a knowledge question-answer library according to the first knowledge question-answer pair; the knowledge question and answer pairs can be quickly and accurately determined in combination with the knowledge text in the knowledge base, then the knowledge question and answer library is determined, the cost of determining the knowledge question and answer library is low, the knowledge question and answer library can be updated in time, and the updating period is short.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to technical fields such as deep learning, cloud computing, natural language processing, and large models, and in particular to a knowledge question-answering method, device, and intelligent agent based on a large model. Background Art

[0002] The current knowledge question answering method is mainly a question answering scheme based on Frequently Asked Questions (FAQ), that is, based on the question and the FAQ, the answer to the question in the FAQ that matches the question is determined.

[0003] In the above solution, FAQ needs to be manually generated by combining knowledge texts in the knowledge base, which has high generation costs and a long update cycle. Summary of the invention

[0004] The present invention provides a knowledge question answering method, device and intelligent agent based on a large model.

[0005] According to one aspect of the present disclosure, a method for determining a knowledge question and answer base based on a large model is provided, the method comprising: obtaining a knowledge base and candidate questions in a knowledge text in the knowledge base; obtaining a first candidate answer corresponding to the candidate question and a first scoring value of the first candidate answer based on the knowledge text and the large model; when the first scoring value is greater than or equal to a scoring threshold, obtaining a first knowledge question and answer pair based on the candidate question and the first candidate answer; and determining the knowledge question and answer base based on the first knowledge question and answer pair.

[0006] According to another aspect of the present disclosure, a knowledge question and answer method based on a large model is provided, the method comprising: obtaining a knowledge question and answer base; the knowledge question and answer base is determined based on the method for determining a knowledge question and answer base based on a large model as described above; obtaining a target question to be processed; and determining a target answer corresponding to the target question based on the knowledge question and answer base and the target question.

[0007] According to another aspect of the present disclosure, an intelligent agent system is provided, including: an input module for receiving input information to be processed of an object; a processing module for determining a knowledge question and answer task based on the input information, and determining a first intelligent agent and a second intelligent agent based on the knowledge question and answer task; calling the second intelligent agent to determine a knowledge question and answer base required in the knowledge question and answer task; calling the first intelligent agent to perform the knowledge question and answer task to obtain a target answer; the second intelligent agent calls the method for determining the knowledge question and answer base based on the large model as described above to determine the knowledge question and answer base; the first intelligent agent calls the knowledge question and answer method based on the large model as described above to perform the knowledge question and answer task; and an output module for outputting the target answer.

[0008] According to another aspect of the present disclosure, a device for determining a knowledge question and answer base based on a large model is provided, the device comprising: a first acquisition module, used to acquire candidate questions in the knowledge base and the knowledge text in the knowledge base; a second acquisition module, used to acquire a first candidate answer corresponding to the candidate question and a first scoring value of the first candidate answer based on the knowledge text and the large model; a third acquisition module, used to acquire a first knowledge question and answer pair based on the candidate question and the first candidate answer when the first scoring value is greater than or equal to a scoring threshold; and a first determination module, used to determine the knowledge question and answer base based on the first knowledge question and answer pair.

[0009] According to another aspect of the present disclosure, a knowledge question and answer device based on a large model is provided, the device comprising: a first acquisition module, used to acquire a knowledge question and answer base; the knowledge question and answer base is determined based on the method for determining the knowledge question and answer base based on the large model as described above; a second acquisition module, used to acquire a target question to be processed; and a first determination module, used to determine a target answer corresponding to the target question based on the knowledge question and answer base and the target question.

[0010] According to another aspect of the present disclosure, an intelligent agent is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for determining a knowledge question and answer base based on a large model proposed above in the present disclosure; or, execute the knowledge question and answer method based on a large model proposed above in the present disclosure.

[0011] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method for determining a knowledge question and answer base based on a large model proposed above in the present disclosure; or, to execute the knowledge question and answer method based on a large model proposed above in the present disclosure.

[0012] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps of the method for determining a knowledge question and answer base based on a large model proposed above in the present disclosure; or, implements the steps of the knowledge question and answer method based on a large model proposed above in the present disclosure.

[0013] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0015] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;

[0016] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;

[0017] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;

[0018] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure;

[0019] Figure 5 This is a schematic diagram of the framework of knowledge question answering based on a large model;

[0020] Figure 6 is a schematic diagram according to a fifth embodiment of the present disclosure;

[0021] Figure 7 is a schematic diagram according to a sixth embodiment of the present disclosure;

[0022] Figure 8 is a schematic diagram according to a seventh embodiment of the present disclosure;

[0023] Fig. 9 It is a block diagram of an electronic device used to implement the method for determining the knowledge question and answer base or the knowledge question and answer method based on a large model in the embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0025] The current knowledge question answering method is mainly a question answering scheme based on Frequently Asked Questions (FAQ), that is, based on the question and the FAQ, the answer to the question in the FAQ that matches the question is determined.

[0026] In the above solution, FAQ needs to be manually generated by combining knowledge texts in the knowledge base, which has high generation costs and a long update cycle.

[0027] In response to the above problems, the present invention proposes a knowledge question answering method, device and intelligent agent based on a large model.

[0028] Figure 1 It is a schematic diagram according to the first embodiment of the present disclosure. It should be noted that the method for determining the knowledge question and answer base based on a large model in the embodiment of the present disclosure can be applied to a device for determining the knowledge question and answer base based on a large model. The device can be configured in an electronic device so that the electronic device can perform the function of determining the knowledge question and answer base based on the large model.

[0029] Among them, the electronic device can be any device with computing capabilities, such as a personal computer (PC), a mobile terminal, a server, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, a smart speaker, a server, a server cluster, an intelligent body, and other hardware devices with various operating systems, touch screens and / or display screens.

[0030] The device for determining the knowledge question and answer base based on the large model may also be software in an electronic device, such as software for determining the knowledge question and answer base based on the large model, etc. In the following embodiments, the execution subject is an intelligent agent as an example for description.

[0031] like Figure 1 As shown, the method for determining the knowledge question and answer base based on the large model may include the following steps:

[0032] Step 101, obtaining a knowledge base and candidate questions in knowledge texts in the knowledge base.

[0033] In an embodiment of the present disclosure, in one example, the process of the agent executing step 101 may be, for example, to obtain a knowledge base; input the knowledge text in the knowledge base into a question extraction model in a large model to obtain output candidate questions.

[0034] The knowledge base may include at least one knowledge text, such as rules and regulations text, operation specification text, enterprise knowledge text, enterprise culture text, etc., which may be set according to actual needs.

[0035] Among them, the question extraction model can be a large language model, such as a GPT-4 model, a GPT-4o model, and other models with question extraction functions.

[0036] Among them, the question extraction model is combined to extract candidate questions from the knowledge text in the knowledge base. Since the question extraction model has large computational complexity and high accuracy, it can improve the accuracy and comprehensiveness of the extracted candidate questions.

[0037] It should be noted that the intelligent agent can fine-tune the question extraction model based on the sample knowledge text and the sample candidate questions therein, so that the question extraction model can understand the questions to be extracted, thereby further improving the accuracy of the extracted candidate questions.

[0038] In another example of the embodiment of the present disclosure, the process of the intelligent agent executing step 101 may be, for example, to obtain a knowledge base; obtain a question extraction example; the question extraction example includes a sample text and a sample question in the sample text; input the knowledge text and the question extraction example into the question extraction model in the large model to obtain output candidate questions.

[0039] It should be noted that there may be more than one knowledge text in the knowledge base, and there may be more than one question extracted from each knowledge text.

[0040] Among them, based on the question extraction examples, the question extraction model can understand which aspects of the questions need to be extracted from the knowledge text. Combined with the large computational amount of the question extraction model, it can further improve the accuracy of the candidate questions extracted by the question extraction model.

[0041] Step 102: Obtain a first candidate answer corresponding to the candidate question and a first rating value of the first candidate answer based on the knowledge text and the large model.

[0042] In the disclosed embodiment, the process of the intelligent agent executing step 102 may, for example, be as follows: based on the candidate question, select a text segment related to the candidate question from the knowledge text to which the candidate question belongs; extract keywords from the related text segments and combine them to obtain a first candidate answer corresponding to the candidate question; determine the degree of match between the first candidate answer and the candidate question, as well as the degree of match between the first candidate answer and the knowledge text to which the candidate question belongs; and determine a first score value for the first candidate answer by combining the two degrees of match.

[0043] The matching degree between the first candidate answer and the candidate question may be the vector similarity between the answer vector of the first candidate answer and the question vector of the candidate question, etc. It should be noted that the matching degree is positively correlated with the score value. The higher the matching degree, the higher the score value.

[0044] Step 103, when the first scoring value is greater than or equal to the scoring threshold, obtain a first knowledge question and answer pair according to the candidate question and the first candidate answer.

[0045] In the disclosed embodiment, the intelligent agent may also perform the following process: when the first scoring value is less than the scoring threshold, re-combine the knowledge text and the large model to which the candidate question belongs, obtain the second candidate answer corresponding to the candidate question and the third scoring value of the second candidate answer; until a knowledge question and answer pair is obtained; or, the number of re-executions is greater than or equal to a preset number threshold.

[0046] In which, when the number of re-executions is greater than or equal to a preset threshold, the agent can discard the candidate question, reselect the next candidate question, and execute steps 102 and 103 based on the next candidate question.

[0047] Among them, determining the scoring value and constructing the knowledge question and answer pairs based on the scoring value can improve the accuracy of the determined knowledge question and answer pairs and further ensure the consistency between the knowledge question and answer pairs in the knowledge question and answer base and the content in the knowledge base.

[0048] Step 104: Determine a knowledge question and answer database based on the first knowledge question and answer pair.

[0049] In the disclosed embodiment, after step 104, the agent may also perform the following process: determining a candidate question vector corresponding to the candidate question; and determining a question vector library corresponding to the knowledge question and answer library based on the candidate question and the candidate question vector.

[0050] Among them, the intelligent agent can combine the determined question vector library and the knowledge question and answer library to perform knowledge question and answer processing. Among them, the setting of the question vector library makes it convenient for the intelligent agent to determine the matching questions in combination with the vector similarity, and then determine the answers, thereby improving the efficiency of knowledge question and answer.

[0051] In the disclosed embodiment, after step 104, the agent may also perform the following process: obtain updated knowledge text in the knowledge base and updated candidate questions in the updated knowledge text; determine a third knowledge question and answer pair based on the updated knowledge text and the updated candidate questions; and update the knowledge question and answer base based on the third knowledge question and answer pair.

[0052] The updated knowledge text includes at least one of the following: newly added knowledge text in the knowledge base, and newly added text fragments in the existing knowledge text in the knowledge base.

[0053] Among them, the process of determining the update candidate questions in the updated knowledge text and the process of determining the knowledge question and answer pairs based on the updated knowledge text and the update candidate questions can refer to the processing process for the knowledge base in steps 101 to 103, and will not be described in detail here.

[0054] Among them, the knowledge question and answer pairs are determined in combination with the updated knowledge text in the knowledge base, and then the knowledge question and answer base is updated. The knowledge question and answer base can be updated in time in combination with the updated knowledge text to ensure that the knowledge question and answer pairs in the knowledge question and answer base can meet the needs of the objects and improve the comprehensiveness of the knowledge question and answer pairs in the knowledge question and answer base.

[0055] The method for determining a knowledge question and answer base based on a large model in an embodiment of the present disclosure obtains candidate questions in a knowledge base and knowledge texts in the knowledge base; obtains a first candidate answer corresponding to the candidate question and a first score value of the first candidate answer based on the knowledge text and the large model; obtains a first knowledge question and answer pair based on the candidate question and the first candidate answer when the first score value is greater than or equal to a score threshold; determines the knowledge question and answer base based on the first knowledge question and answer pair; wherein the knowledge question and answer pairs can be quickly and accurately determined in combination with the knowledge texts in the knowledge base, and then the knowledge question and answer base is determined, the cost of determining the knowledge question and answer base is low, and the knowledge question and answer base can be updated in a timely manner, and the update cycle is short.

[0056] In order to improve the accuracy of determining the first candidate answer corresponding to the candidate question and the first score of the first candidate answer, and to ensure the consistency between the knowledge question and answer pairs in the knowledge question and answer base and the knowledge text in the knowledge base, the intelligent agent can combine the answer generation model to generate candidate answers and combine the score model to determine the score. Figure 2 As shown, Figure 2 is a schematic diagram according to a second embodiment of the present disclosure, Figure 2 The illustrated embodiment may include the following steps:

[0057] Step 201: Obtain a knowledge base and candidate questions in knowledge texts in the knowledge base.

[0058] Step 202: Input the candidate question and the knowledge text into the answer generation model in the large model to obtain the output first candidate answer.

[0059] In an embodiment of the present disclosure, in one example, the answer generation model and the question extraction model used for extracting candidate questions can use the same model. In this example, different functions of the model can be distinguished by prompt content or different input content. For example, when the model input is knowledge text in the knowledge base, the question extraction function of the model can be used for processing; when the model input is knowledge text in the knowledge base and candidate questions, the answer generation function of the model can be used for processing.

[0060] In another example, the answer generation model and the question extraction model may use different models. It should be noted that, in one case, different models may refer to different model structures of the answer generation model and the question extraction model. In another case, different models may refer to the same model structure of the answer generation model and the question extraction model, but different model parameters.

[0061] Step 203: Input the candidate question, the knowledge text and the first candidate answer into the scoring model in the large model to obtain the output second scoring value.

[0062] In an embodiment of the present disclosure, in one example, the number of scoring models may be at least one. At least one scoring model may include a question extraction model and / or an answer generation model. The included question extraction model and / or answer generation model may implement a scoring function. In another example, at least one scoring model may not include a question extraction model and an answer generation model.

[0063] Step 204: When there are at least two second score values, average the second score values ​​to obtain a first score value.

[0064] In the disclosed embodiment, as an alternative to step 204, the intelligent agent may use the maximum score value among at least one second score value as the first score value of the first candidate answer; or, the intelligent agent may use the minimum score value among at least one second score value as the first score value of the first candidate answer; or, the intelligent agent may sort at least one second score value to obtain a sorting result, and use the second score value located in the middle position of the sorting result as the first score value of the first candidate answer.

[0065] Step 205: When the second score value is one, determine the first score value as the second score value.

[0066] In the disclosed embodiment, the question extraction model, the answer generation model and the scoring model can be obtained through joint training, or through separate training. Taking joint training as an example, the joint training process of the question extraction model, the answer generation model and the scoring model can be, for example, obtaining a sample knowledge base and a sample knowledge question and answer base corresponding to the sample knowledge base; inputting the sample knowledge text in the sample knowledge base into the question extraction model to obtain a predicted question; inputting the predicted question and the sample knowledge text to which the predicted question belongs into the answer generation model to obtain a predicted answer; inputting the predicted question, the sample knowledge text to which the predicted question belongs and the predicted answer into the scoring model to obtain a score value of the predicted answer; obtaining multiple candidate predicted answers whose corresponding score values ​​are greater than or equal to the score threshold; and then determining to obtain a predicted knowledge question and answer base; combining the differences between the sample knowledge question and answer base and the predicted knowledge question and answer base, adjusting the parameters of the question extraction model, the answer generation model and the scoring model to achieve training.

[0067] Step 206, when the first scoring value is greater than or equal to the scoring threshold, obtain a first knowledge question and answer pair according to the candidate question and the first candidate answer.

[0068] Step 207: Determine a knowledge question and answer database based on the first knowledge question and answer pair.

[0069] It should be noted that the details of step 201, step 206 to step 207 can be found in Figure 1 Step 101, step 103 to step 104 in the illustrated embodiment will not be described in detail here.

[0070] The method for determining a knowledge question and answer base based on a large model in an embodiment of the present disclosure comprises the following steps: obtaining candidate questions from a knowledge base and a knowledge text in the knowledge base; inputting the candidate questions and the knowledge text into an answer generation model in the large model to obtain an output first candidate answer; inputting the candidate questions, the knowledge text and the first candidate answer into a scoring model in the large model to obtain an output second scoring value; when there are at least two second scoring values, performing mean processing on the second scoring values ​​to obtain the first scoring value; when the second scoring value is one, determining the first scoring value as the second scoring value; when the first scoring value is greater than or equal to a scoring threshold, obtaining a first knowledge question and answer pair according to the candidate question and the first candidate answer; and determining the knowledge question and answer base according to the first knowledge question and answer pair; wherein, combining the answer generation model to perform candidate answer generation processing and combining the scoring model to perform scoring value determination processing can improve the accuracy of the determined first candidate answer and the first scoring value, and then combining the first scoring value to select a knowledge question and answer pair with higher accuracy, thereby further improving the consistency between the knowledge question and answer pair in the knowledge question and answer base and the knowledge text in the knowledge base.

[0071] In order to further improve the accuracy of the generated candidate answers and thus the accuracy of the constructed knowledge question and answer pairs, when the first score value of the first candidate answer is less than the score threshold, the candidate answer generation process can be re-performed in combination with the first candidate answer and the first score reference information of the first candidate answer, thereby improving the accuracy of the generated candidate answers. Figure 3 As shown, Figure 3 is a schematic diagram according to a third embodiment of the present disclosure, Figure 3 The illustrated embodiment may include the following steps:

[0072] Step 301: Obtain a knowledge base and candidate questions in the knowledge text in the knowledge base.

[0073] Step 302: Obtain a first candidate answer corresponding to the candidate question and a first rating value of the first candidate answer based on the knowledge text and the large model.

[0074] Step 303, when the first scoring value is greater than or equal to the scoring threshold, obtain a first knowledge question and answer pair according to the candidate question and the first candidate answer.

[0075] Step 304: when the first scoring value is less than the scoring threshold, obtain first scoring reference information of the first candidate answer.

[0076] In the disclosed embodiment, the first scoring reference information of the first candidate answer may include at least one of the following: the first candidate answer is incomplete, the first candidate answer is not fluent, the first candidate answer is not the correct answer to the candidate question, and the first candidate answer is inconsistent with the content of the knowledge text in the knowledge base. It should be noted that the first scoring reference information is not limited here and can be added according to actual needs.

[0077] The first scoring reference information of the first candidate answer can be obtained from the output of the scoring model. That is, the agent can input the candidate question, the knowledge text to which the candidate question belongs, and the first candidate answer into at least one scoring model, and obtain the second scoring value output by at least one scoring model and the second scoring reference information of the second scoring value. Correspondingly, the agent can select scoring reference information from the second scoring reference information of at least one second scoring value as the scoring reference information of the first candidate answer.

[0078] In an embodiment of the present disclosure, when the first score value of the first candidate answer is determined by combining at least two second score values ​​belonging to the first candidate answer, in one example, the process of the intelligent agent obtaining the first score reference information of the first candidate answer may, for example, be to obtain the second score reference information corresponding to multiple second score values; and determine the second score reference information corresponding to at least one second score value that is less than the score threshold as the first score reference information of the first candidate answer.

[0079] Among them, when the first score value of the first candidate answer is determined by combining a second score value belonging to the first candidate answer, the intelligent agent can directly determine the second score reference information corresponding to the second score value as the first score reference information of the first candidate answer.

[0080] Among them, the intelligent agent uses the second scoring reference information corresponding to at least one second scoring value that is less than the scoring threshold as the first scoring reference information of the first candidate answer, so that when re-determining the candidate answer, the scoring model can refer to more first scoring reference information to regenerate the candidate answer, thereby avoiding the problems described by the first scoring reference information in the regenerated candidate answer, thereby further improving the accuracy of the generated candidate answer and further reducing the number of times the candidate answer needs to be regenerated.

[0081] In another example, where the first rating value of the first candidate answer is determined by combining multiple second rating values ​​of the first candidate answer, the intelligent agent can determine a second rating value among the multiple second rating values ​​that is the same as or has a smaller difference from the first rating value of the first candidate answer; and determine the second rating reference information of the second rating value as the first rating reference information of the first candidate answer.

[0082] Step 305 , obtaining a second candidate answer corresponding to the candidate question and a third scoring value of the second candidate answer according to the candidate question, the knowledge text, the first candidate answer and the first scoring reference information.

[0083] In the disclosed embodiment, the process of the intelligent agent executing step 305 may, for example, be to input the candidate question, knowledge text and answer generation prompt content into the answer generation model in the large model, and obtain the output second candidate answer; wherein the answer generation prompt content includes: the first candidate answer and the first scoring reference information; and determine the third scoring value based on the candidate question, knowledge text and the second candidate answer.

[0084] Among them, the first candidate answer and the first scoring reference information are input into the answer generation model as answer generation prompt content, so that the answer generation model can avoid generating candidate answers to the questions described by the first scoring reference information in the process of generating the second candidate answer, thereby further improving the accuracy of the generated candidate answers and further improving the matching degree between the generated candidate answers and the candidate questions and the knowledge text.

[0085] Step 306: When the third scoring value is greater than or equal to the scoring threshold, a second knowledge question and answer pair is obtained according to the candidate question and the second candidate answer.

[0086] Step 307: determine a knowledge question and answer database according to the first knowledge question and answer pair and / or the second knowledge question and answer pair.

[0087] It should be noted that the details of steps 301 to 303 and step 307 can be found in Figure 1 Steps 101 to 104 in the illustrated embodiment will not be described in detail herein.

[0088] The method for determining a knowledge question and answer base based on a large model in an embodiment of the present disclosure comprises the following steps: obtaining candidate questions from a knowledge base and a knowledge text in the knowledge base; obtaining a first candidate answer corresponding to the candidate question and a first scoring value of the first candidate answer based on the knowledge text and the large model; obtaining a first knowledge question and answer pair based on the candidate question and the first candidate answer when the first scoring value is greater than or equal to a scoring threshold; obtaining first scoring reference information of the first candidate answer when the first scoring value is less than the scoring threshold; obtaining a second candidate answer corresponding to the candidate question and a third scoring value of the second candidate answer based on the candidate question, the knowledge text, the first candidate answer and the first scoring reference information; obtaining a second knowledge question and answer pair based on the candidate question and the second candidate answer when the third scoring value is greater than or equal to the scoring threshold; determining a knowledge question and answer base based on the first knowledge question and answer pair and / or the second knowledge question and answer pair; wherein, when the first scoring value is less than the scoring threshold, regenerating the candidate answer by combining the candidate question, the knowledge text, the first candidate answer and the first scoring reference information of the first candidate answer, so that the answer generation model can generate candidate answers for questions described by the non-existent scoring reference information, thereby further improving the accuracy of the generated candidate answers.

[0089] Figure 4 It is a schematic diagram according to the fourth embodiment of the present disclosure. It should be noted that the knowledge question and answer method based on a big model in the embodiment of the present disclosure can be applied to a knowledge question and answer device based on a big model. The device can be configured in an electronic device so that the electronic device can perform a knowledge question and answer function based on a big model.

[0090] Among them, the electronic device can be any device with computing capabilities, such as a personal computer (PC), a mobile terminal, a server, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, a smart speaker, a server, a server cluster, an intelligent body, and other hardware devices with various operating systems, touch screens and / or display screens.

[0091] The knowledge question answering device based on a large model may also be software in an electronic device, such as knowledge question answering software based on a large model, etc. In the following embodiments, the execution subject is an intelligent agent as an example for description.

[0092] like Figure 4 As shown, the knowledge question answering method based on the large model may include the following steps:

[0093] Step 401, obtain a knowledge question and answer database; the knowledge question and answer database is based on Figures 1 to 3 The method for determining the knowledge question and answer base based on the large model in any embodiment is determined.

[0094] In the disclosed embodiment, it is assumed that the agent that executes the method for determining the knowledge question and answer base based on the large model is the second agent, and the agent that executes the knowledge question and answer method based on the large model is the first agent. In one example, the first agent and the second agent can be the same agent. That is to say, after the knowledge question and answer base is determined by the same agent, knowledge question and answer processing is performed based on the knowledge question and answer base. The process of determining the knowledge question and answer base and the process of knowledge question and answer processing can be performed separately. For example, the agent can determine the knowledge question and answer base offline, and then perform online processing, and use the determined knowledge question and answer base to perform knowledge question and answer processing.

[0095] In another example, the first agent and the second agent may be different agents. That is, after the second agent determines the knowledge question and answer base, it may provide the determined knowledge question and answer base to the first agent; the first agent may perform knowledge question and answer processing based on the knowledge question and answer base. In the process of the first agent performing knowledge question and answer processing based on the knowledge question and answer base, the second agent may update the knowledge question and answer base in combination with the updated knowledge question and answer in the knowledge base, and synchronize the updated knowledge question and answer base to the first agent.

[0096] Step 402, obtaining the target problem to be processed.

[0097] Step 403: Determine a target answer corresponding to the target question based on the knowledge question and answer database and the target question.

[0098] In an embodiment of the present disclosure, in one example, the process of the intelligent agent executing step 403 may be, for example, querying the knowledge question and answer base according to the target question to obtain the first candidate question in the knowledge question and answer base that matches the target question; and determining the first candidate answer corresponding to the first candidate question in the knowledge question and answer base as the target answer corresponding to the target question.

[0099] Among them, the score value of the first candidate answer corresponding to the first candidate question in the knowledge question and answer base is greater than the score threshold, ensuring that the first candidate answer is the correct answer to the first candidate question, and ensuring the consistency between the first candidate answer and the content of the knowledge text in the knowledge base, thereby ensuring the consistency between the target answer corresponding to the target question and the content of the knowledge text in the knowledge base.

[0100] In another example of the disclosed embodiment, after step 401, the agent may perform the following process: determine the candidate question vector corresponding to the candidate question in the knowledge question and answer library; determine the question vector library corresponding to the knowledge question and answer library according to the candidate question and the candidate question vector. Correspondingly, the process of the agent performing step 403 may be, for example, determining the target question vector corresponding to the target question; querying the question vector library according to the target question vector, obtaining the candidate question vector matching the target question vector in the question vector library; querying the knowledge question and answer library according to the second candidate question corresponding to the candidate question vector, obtaining the second candidate answer corresponding to the second candidate question in the knowledge question and answer library; and determining the second candidate answer as the target answer corresponding to the target question.

[0101] The target question vector matches the candidate question vector, which may mean that the vector similarity between the target question vector and the candidate question vector is greater than or equal to a vector similarity threshold.

[0102] Among them, a question vector library corresponding to the knowledge question and answer library is determined, and a candidate question vector is selected based on the matching degree between the target question vector and each candidate question vector in the question vector library. A candidate question vector matching the target question vector can be selected, and then a second candidate question matching the target question can be selected, thereby further improving the accuracy of the determined target answer.

[0103] In the disclosed embodiment, in the process of determining the second candidate question by combining the knowledge question and answer base and the question vector base, and then determining the target answer, the intelligent agent may also perform the following process: if the second candidate question is not obtained, obtain the knowledge base corresponding to the knowledge text base; query the knowledge text in the knowledge base according to the target question, and obtain the text fragment in the knowledge text that matches the target question; determine the target answer corresponding to the target question based on the text fragment and the target question.

[0104] Among them, when the second candidate question is not obtained, the target answer is generated by combining the text fragments in the knowledge text that match the target question, which can ensure that the target answer is provided for each target question in the knowledge question and answer process, avoid providing empty answers, and avoid repeated question and answer processing for the same target question, thereby improving the efficiency of knowledge question and answering.

[0105] In the disclosed embodiment, in order to further improve the efficiency of knowledge question answering, the knowledge question answering base can be updated in combination with the evaluation information corresponding to the target answer, so as to increase the probability of determining the target answer in combination with the knowledge question answering base when the target question is obtained. Correspondingly, the intelligent agent can also perform the following process: obtain the evaluation information corresponding to the target answer; when the evaluation information indicates that the target answer is the correct answer to the target question, update the knowledge question answering base according to the target question and the target answer.

[0106] The knowledge question answering method based on a large model in the embodiment of the present disclosure obtains a knowledge question answering database; the knowledge question answering database is based on Figures 1 to 3 The method for determining the knowledge question and answer base based on a large model described in any embodiment is determined; obtaining the target question to be processed; determining the target answer corresponding to the target question based on the knowledge question and answer base and the target question; wherein the score value of the candidate answer corresponding to the candidate question in the knowledge question and answer base is greater than the score threshold, ensuring that the candidate answer is the correct answer to the candidate question, and ensuring the consistency between the candidate answer and the content of the knowledge text in the knowledge base, thereby ensuring that the target answer is the correct answer to the target question, thereby improving the efficiency of knowledge question and answer.

[0107] The following examples are used to illustrate this. Figure 5 The following is a schematic diagram of the knowledge question-answering framework. Figure 5 In the process, the offline part and the online part are included. The offline part is used to determine the knowledge question and answer base and the question vector base. The online part performs knowledge question and answer processing in combination with the knowledge question and answer base and the question vector base. Specifically, the following steps may be included: Step 501, standard question mining (extracting candidate questions) based on knowledge documents (i.e., knowledge base). Step 502, answer generation processing based on the mined standard questions. Step 503, FAQ quality assessment processing (i.e., determining the first score value of the first candidate answer) based on the standard questions and the generated answers (first candidate answers); if the assessment passes (the first score value is greater than or equal to the score threshold), step 504 is executed; if the assessment fails (the first score value is less than the score threshold), step 501 is re-executed. Step 504, based on the evaluation result, the FAQ (knowledge question and answer base) mined offline is determined. Step 505, the FAQ mined offline is switched to obtain multiple standard QA pairs (i.e., multiple knowledge question and answer pairs are read from the knowledge question and answer base). Step 506, vectorize the standard questions in multiple standard QA pairs to obtain a FAQ vector library (i.e., question vector library). Step 507, obtain the user query (target question) and vectorize the user query. Step 508, determine whether there is a similar query in the FAQ vector library (i.e., the first candidate question that matches the target question); if so, execute step 509; if not, execute step 511. Step 509, find the standard query in the FAQ (i.e., the first candidate question that matches the target question). Step 510, output the answer result (target answer) in the FAQ pair. Step 511, request the question and answer agent (intelligent body). The question and answer agent determines the answer (target answer) based on the requested target question.

[0108] The process of the question-answering agent determining the target answer based on the requested target question may include, for example, obtaining a user query (target question); selecting a question-answering retrieval tool, searching and processing knowledge documents in combination with the user query, and obtaining a retrieval fragment; and generating an answer (target answer) based on the retrieval fragment.

[0109] In order to implement the above embodiments, the present disclosure also provides an intelligent agent system. Figure 6 As shown, Figure 6 6 is a schematic diagram of the fifth embodiment of the present disclosure. The agent system 60 may include: an input module 601 , a processing module 602 and an output module 603 .

[0110] Among them, the input module 601 is used to receive the input information to be processed of the object; the processing module 602 is used to determine the knowledge question and answer task based on the input information, and determine the first agent and the second agent based on the knowledge question and answer task; call the second agent to determine the knowledge question and answer base required in the knowledge question and answer task; call the first agent to perform the knowledge question and answer task to obtain the target answer; the second agent calls the method for determining the knowledge question and answer base based on the large model as described above to determine the knowledge question and answer base; the first agent calls the knowledge question and answer method based on the large model as described above to perform the knowledge question and answer task; the output module 603 is used to output the target answer.

[0111] The intelligent agent system of the embodiment of the present disclosure includes: an input module for receiving input information to be processed by an object; a processing module for determining a knowledge question and answer task based on the input information, and determining a first intelligent agent and a second intelligent agent based on the knowledge question and answer task; calling the second intelligent agent to determine a knowledge question and answer base required in the knowledge question and answer task; calling the first intelligent agent to perform the knowledge question and answer task to obtain a target answer; the second intelligent agent calls the method for determining the knowledge question and answer base based on the large model as described above to determine the knowledge question and answer base; the first intelligent agent calls the method for determining the knowledge question and answer base based on the large model as described above to perform the knowledge question and answer task; an output module 603 for outputting a target answer; wherein the functions implemented by each intelligent agent can be combined to implement the knowledge question and answer function, thereby improving the efficiency of knowledge question and answer.

[0112] In order to implement the above embodiment, the present disclosure also provides a determination device of a knowledge question and answer base based on a large model. Figure 7 As shown, Figure 7 70 is a schematic diagram according to the sixth embodiment of the present disclosure. The large model-based knowledge question and answer database determination device 70 may include: a first acquisition module 701 , a second acquisition module 702 , a third acquisition module 703 and a first determination module 704 .

[0113] Among them, the first acquisition module 701 is used to obtain candidate questions from the knowledge base and the knowledge text in the knowledge base; the second acquisition module 702 is used to obtain the first candidate answer corresponding to the candidate question and the first score value of the first candidate answer based on the knowledge text and the large model; the third acquisition module 703 is used to obtain a first knowledge question and answer pair based on the candidate question and the first candidate answer when the first score value is greater than or equal to the score threshold; the first determination module 704 is used to determine the knowledge question and answer base based on the first knowledge question and answer pair.

[0114] As a possible implementation method of the embodiment of the present disclosure, the first acquisition module 701 is specifically used to acquire a knowledge base; acquire a question extraction example; the question extraction example includes a sample text and a sample question in the sample text; input the knowledge text and the question extraction example into the question extraction model in the large model to acquire the output candidate question.

[0115] As a possible implementation method of the embodiment of the present disclosure, the first acquisition module 701 is specifically used to acquire a knowledge base; input the knowledge text into the question extraction model in the large model, and acquire the output candidate question.

[0116] As a possible implementation method of the embodiment of the present disclosure, the second acquisition module 702 is specifically used to input the candidate question and the knowledge text into the answer generation model in the big model to obtain the output first candidate answer; input the candidate question, the knowledge text and the first candidate answer into the scoring model in the big model to obtain the output second scoring value; when the second scoring value is at least two, perform mean processing on the second scoring values ​​to obtain the first scoring value; when the second scoring value is one, determine the first scoring value to be the second scoring value.

[0117] As a possible implementation method of the embodiment of the present disclosure, the device also includes: a fourth acquisition module, used to obtain first scoring reference information of the first candidate answer when the first scoring value is less than the scoring threshold; a fifth acquisition module, used to obtain the second candidate answer corresponding to the candidate question and the third scoring value of the second candidate answer based on the candidate question, the knowledge text, the first candidate answer and the first scoring reference information; a sixth acquisition module, used to obtain a second knowledge question and answer pair based on the candidate question and the second candidate answer when the third scoring value is greater than or equal to the scoring threshold.

[0118] As a possible implementation method of the embodiment of the present disclosure, the fifth acquisition module is specifically used to input the candidate question, the knowledge text and the answer generation prompt content into the answer generation model in the large model, and obtain the output second candidate answer; wherein the answer generation prompt content includes: the first candidate answer and the first scoring reference information; determine the third scoring value based on the candidate question, the knowledge text and the second candidate answer.

[0119] As a possible implementation method of an embodiment of the present disclosure, the fourth acquisition module is specifically used to, when the first score value of the first candidate answer is determined based on at least two second score values ​​belonging to the first candidate answer, obtain the second score reference information corresponding to the second score value; and determine the second score reference information corresponding to the second score value less than the score threshold as the first score reference information.

[0120] As a possible implementation method of the embodiment of the present disclosure, the device also includes: a seventh acquisition module, a second determination module and an update module; the seventh acquisition module is used to acquire the updated knowledge text in the knowledge base and the updated candidate questions in the updated knowledge text; the second determination module is used to determine a third knowledge question and answer pair based on the updated knowledge text and the updated candidate questions; the update module is used to update the knowledge question and answer base based on the third knowledge question and answer pair.

[0121] As a possible implementation manner of the embodiment of the present disclosure, the updated knowledge text includes at least one of the following: a newly added knowledge text in the knowledge base, and a newly added text segment in the existing knowledge text in the knowledge base.

[0122] As a possible implementation method of the embodiment of the present disclosure, the device also includes: a third determination module and a fourth determination module; the third determination module is used to determine the candidate question vector corresponding to the candidate question; the fourth determination module is used to determine the question vector library corresponding to the knowledge question and answer library based on the candidate question and the candidate question vector.

[0123] The apparatus for determining a knowledge question and answer base based on a large model in an embodiment of the present disclosure obtains candidate questions from a knowledge base and knowledge texts in the knowledge base; obtains a first candidate answer corresponding to the candidate question and a first score value of the first candidate answer based on the knowledge text and the large model; obtains a first knowledge question and answer pair based on the candidate question and the first candidate answer when the first score value is greater than or equal to a score threshold; determines a knowledge question and answer base based on the first knowledge question and answer pair; wherein the knowledge question and answer pairs can be quickly and accurately determined in combination with the knowledge texts in the knowledge base, and then the knowledge question and answer base is determined, the cost of determining the knowledge question and answer base is low, and the knowledge question and answer base can be updated in a timely manner, and the update cycle is short.

[0124] In order to implement the above embodiment, the present disclosure also provides a knowledge question answering device based on a large model. Figure 8 As shown, Figure 8 80 is a schematic diagram according to the seventh embodiment of the present disclosure. The knowledge question answering device 80 based on a large model may include: a first acquisition module 801 , a second acquisition module 802 and a first determination module 803 .

[0125] The first acquisition module 801 is used to acquire a knowledge question and answer database; the knowledge question and answer database is based on Figures 1 to 3 The method for determining the knowledge question and answer base based on a large model described in any embodiment is determined; the second acquisition module 802 is used to obtain the target question to be processed; the first determination module 803 is used to determine the target answer corresponding to the target question based on the knowledge question and answer base and the target question.

[0126] As a possible implementation method of the embodiment of the present disclosure, the first determination module 803 is specifically used to query the knowledge question and answer base according to the target question, obtain a first candidate question in the knowledge question and answer base that matches the target question; and determine the first candidate answer corresponding to the first candidate question in the knowledge question and answer base as the target answer corresponding to the target question.

[0127] As a possible implementation method of the embodiment of the present disclosure, the device also includes: a second determination module and a third determination module; the second determination module is used to determine the candidate question vector corresponding to the candidate question in the knowledge question and answer base; the third determination module is used to determine the question vector library corresponding to the knowledge question and answer base based on the candidate question and the candidate question vector; correspondingly, the first determination module 803 is specifically used to determine the target answer corresponding to the target question based on the knowledge question and answer base, the question vector library and the target question.

[0128] As a possible implementation method of an embodiment of the present disclosure, the first determination module 803 is specifically used to determine a target question vector corresponding to the target question; query the question vector library according to the target question vector to obtain a candidate question vector in the question vector library that matches the target question vector; query the knowledge question and answer library according to the second candidate question corresponding to the candidate question vector to obtain a second candidate answer corresponding to the second candidate question in the knowledge question and answer library; and determine the second candidate answer as the target answer corresponding to the target question.

[0129] As a possible implementation method of the embodiment of the present disclosure, the device also includes: a third acquisition module, a fourth acquisition module and a fourth determination module; the third acquisition module is used to acquire the knowledge base corresponding to the knowledge text base when the second candidate question is not acquired; the fourth acquisition module is used to query the knowledge text in the knowledge base according to the target question, and acquire the text fragment in the knowledge text that matches the target question; the fourth determination module is used to determine the target answer corresponding to the target question based on the text fragment and the target question.

[0130] As a possible implementation method of the embodiment of the present disclosure, the device also includes: a fifth acquisition module and an update module; the fifth acquisition module is used to obtain evaluation information corresponding to the target answer; the update module is used to update the knowledge question and answer base according to the target question and the target answer when the evaluation information indicates that the target answer is the correct answer to the target question.

[0131] The knowledge question and answer device based on a large model in the embodiment of the present disclosure obtains a knowledge question and answer database; the knowledge question and answer database is based on Figures 1 to 3 The method for determining the knowledge question and answer base based on a large model described in any embodiment is determined; obtaining the target question to be processed; determining the target answer corresponding to the target question based on the knowledge question and answer base and the target question; wherein the score value of the candidate answer corresponding to the candidate question in the knowledge question and answer base is greater than the score threshold, ensuring that the candidate answer is the correct answer to the candidate question, and ensuring the consistency between the candidate answer and the content of the knowledge text in the knowledge base, thereby ensuring that the target answer is the correct answer to the target question, thereby improving the efficiency of knowledge question and answer.

[0132] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are all carried out with the user's consent, comply with the relevant laws and regulations, and do not violate public order and good morals.

[0133] According to an embodiment of the present disclosure, the present disclosure also provides an intelligent agent, a readable storage medium and a computer program product.

[0134] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0135] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0136] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0137] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as a determination method for a knowledge question and answer library based on a large model or a knowledge question and answer method based on a large model. For example, in some embodiments, a determination method for a knowledge question and answer library based on a large model or a knowledge question and answer method based on a large model may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the determination method for the knowledge question and answer library based on the large model or the knowledge question and answer method based on the large model described above may be executed. Alternatively, in other embodiments, the computing unit 901 may be configured in any other appropriate manner (eg, by means of firmware) to execute a method for determining a knowledge question and answer base based on a large model or a knowledge question and answer method based on a large model.

[0138] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0139] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0140] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0141] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0142] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0143] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0144] 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.

[0145] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for determining a knowledge question and answer base based on a large model, the method comprising: Obtaining a knowledge base and candidate questions from knowledge texts in the knowledge base; According to the knowledge text and the large model, obtaining a first candidate answer corresponding to the candidate question and a first scoring value of the first candidate answer; When the first scoring value is greater than or equal to a scoring threshold, obtaining a first knowledge question and answer pair according to the candidate question and the first candidate answer; A knowledge question and answer base is determined according to the first knowledge question and answer pair.

2. The method according to claim 1, wherein: The step of obtaining a knowledge base and candidate questions in the knowledge text in the knowledge base includes: Access to knowledge base; Obtaining a question extraction example; the question extraction example includes a sample text and a sample question in the sample text; The knowledge text and the question extraction example are input into the question extraction model in the large model to obtain the output candidate question.

3. The method according to claim 1, wherein: The step of obtaining a knowledge base and candidate questions in the knowledge text in the knowledge base includes: Access to knowledge base; The knowledge text is input into the question extraction model in the large model to obtain the output candidate questions.

4. The method according to claim 1, wherein: The step of obtaining, according to the knowledge text and the large model, a first candidate answer corresponding to the candidate question and a first scoring value of the first candidate answer includes: Inputting the candidate question and the knowledge text into the answer generation model in the large model to obtain the first candidate answer as output; Inputting the candidate question, the knowledge text and the first candidate answer into a scoring model in the large model to obtain an output second scoring value; When there are at least two second scoring values, performing average processing on the second scoring values ​​to obtain the first scoring value; When the second rating value is one, the first rating value is determined to be the second rating value.

5. The method according to claim 1 or 4, wherein: The method further comprises: When the first scoring value is less than the scoring threshold, obtaining first scoring reference information of the first candidate answer; Acquire a second candidate answer corresponding to the candidate question and a third scoring value of the second candidate answer according to the candidate question, the knowledge text, the first candidate answer and the first scoring reference information; When the third scoring value is greater than or equal to the scoring threshold, a second knowledge question and answer pair is obtained according to the candidate question and the second candidate answer.

6. The method according to claim 5, wherein: The acquiring, according to the candidate question, the knowledge text, the first candidate answer and the first scoring reference information, a second candidate answer corresponding to the candidate question and a third scoring value of the second candidate answer comprises: Input the candidate question, the knowledge text and the answer generation prompt content into the answer generation model in the large model, and obtain the output second candidate answer; wherein the answer generation prompt content includes: the first candidate answer and the first scoring reference information; The third scoring value is determined according to the candidate question, the knowledge text and the second candidate answer.

7. The method according to claim 5, wherein: The acquiring, when the first scoring value is less than the scoring threshold, first scoring reference information of the first candidate answer includes: In a case where the first score value of the first candidate answer is determined based on at least two second score values ​​belonging to the first candidate answer, obtaining second score reference information corresponding to the second score value; The second scoring reference information corresponding to the second scoring value less than the scoring threshold is determined as the first scoring reference information.

8. The method according to claim 1, wherein: The method further comprises: Acquire updated knowledge text in the knowledge base and updated candidate questions in the updated knowledge text; Determining a third knowledge question-answer pair according to the updated knowledge text and the updated candidate question; The knowledge question and answer database is updated according to the third knowledge question and answer pair.

9. The method according to claim 8, wherein: The updated knowledge text includes at least one of the following: a newly added knowledge text in the knowledge base, and a newly added text segment in the existing knowledge text in the knowledge base.

10. The method according to claim 1, wherein: The method further comprises: Determine a candidate question vector corresponding to the candidate question; A question vector library corresponding to the knowledge question and answer library is determined according to the candidate questions and the candidate question vectors.

11. A knowledge question answering method based on a large model, the method comprising: Get the knowledge question and answer database; The knowledge question and answer base is determined based on the method for determining a knowledge question and answer base based on a large model according to any one of claims 1 to 10; Get the target problem to be processed; A target answer corresponding to the target question is determined based on the knowledge question and answer database and the target question.

12. The method according to claim 11, wherein: Determining a target answer corresponding to the target question according to the knowledge question and answer database and the target question includes: Querying the knowledge question and answer database according to the target question to obtain a first candidate question in the knowledge question and answer database that matches the target question; The first candidate answer corresponding to the first candidate question in the knowledge question and answer database is determined as the target answer corresponding to the target question.

13. The method according to claim 11, wherein: The method further comprises: Determine a candidate question vector corresponding to a candidate question in the knowledge question and answer database; Determine a question vector library corresponding to the knowledge question and answer library according to the candidate questions and the candidate question vectors; Correspondingly, determining a target answer corresponding to the target question according to the knowledge question and answer database and the target question includes: A target answer corresponding to the target question is determined according to the knowledge question and answer library, the question vector library and the target question.

14. The method according to claim 13, wherein: The step of determining a target answer corresponding to the target question according to the knowledge question and answer library, the question vector library and the target question includes: Determine a target problem vector corresponding to the target problem; Query the question vector library according to the target question vector to obtain a candidate question vector in the question vector library that matches the target question vector; Querying the knowledge question and answer database according to the second candidate question corresponding to the candidate question vector, and obtaining a second candidate answer corresponding to the second candidate question in the knowledge question and answer database; The second candidate answer is determined as the target answer corresponding to the target question.

15. The method according to claim 14, wherein: The method further comprises: If the second candidate question is not obtained, obtaining a knowledge base corresponding to the knowledge text base; Querying the knowledge text in the knowledge base according to the target question, and obtaining a text segment in the knowledge text that matches the target question; A target answer corresponding to the target question is determined according to the text segment and the target question.

16. The method according to claim 15, wherein: The method further comprises: Obtaining evaluation information corresponding to the target answer; When the evaluation information indicates that the target answer is a correct answer to the target question, the knowledge question and answer database is updated according to the target question and the target answer.

17. An intelligent agent system, comprising: An input module, used for receiving input information to be processed by an object; A processing module, configured to determine a knowledge question answering task based on the input information, and determine a first agent and a second agent based on the knowledge question answering task; Calling a second agent to determine the knowledge question and answer base required in the knowledge question and answer task; calling a first agent to perform the knowledge question and answer task to obtain a target answer; the second agent calls the method for determining a knowledge question and answer base based on a large model as described in claims 1 to 10 to determine the knowledge question and answer base; the first agent calls the knowledge question and answer method based on a large model as described in claims 11 to 16 to perform the knowledge question and answer task; An output module is used to output the target response.

18. A device for determining a knowledge question and answer database based on a large model, the device comprising: A first acquisition module is used to acquire candidate questions from a knowledge base and knowledge texts in the knowledge base; A second acquisition module is used to acquire a first candidate answer corresponding to the candidate question and a first score value of the first candidate answer according to the knowledge text and the large model; A third acquisition module, configured to acquire a first knowledge question and answer pair according to the candidate question and the first candidate answer when the first score value is greater than or equal to a score threshold; The first determining module is used to determine a knowledge question and answer database according to the first knowledge question and answer pair.

19. The device according to claim 18, wherein: The first acquisition module is specifically used to: Access to knowledge base; Obtaining a question extraction example; the question extraction example includes a sample text and a sample question in the sample text; The knowledge text and the question extraction example are input into the question extraction model in the large model to obtain the output candidate question.

20. The device according to claim 18, wherein The first acquisition module is specifically used to: Access to knowledge base; The knowledge text is input into the question extraction model in the large model to obtain the output candidate questions.

21. The device according to claim 18, wherein The second acquisition module is specifically used to: Inputting the candidate question and the knowledge text into the answer generation model in the large model to obtain the first candidate answer as output; Inputting the candidate question, the knowledge text and the first candidate answer into a scoring model in the large model to obtain an output second scoring value; When there are at least two second scoring values, performing average processing on the second scoring values ​​to obtain the first scoring value; When the second rating value is one, the first rating value is determined to be the second rating value.

22. The device according to claim 18 or 21, wherein: The device also includes: A fourth acquisition module, configured to acquire first score reference information of the first candidate answer when the first score value is less than the score threshold; a fifth acquisition module, configured to acquire, according to the candidate question, the knowledge text, the first candidate answer and the first scoring reference information, a second candidate answer corresponding to the candidate question and a third scoring value of the second candidate answer; The sixth acquisition module is used to acquire a second knowledge question and answer pair according to the candidate question and the second candidate answer when the third scoring value is greater than or equal to the scoring threshold.

23. The device according to claim 22, wherein: The fifth acquisition module is specifically used for: Input the candidate question, the knowledge text and the answer generation prompt content into the answer generation model in the large model, and obtain the output second candidate answer; wherein the answer generation prompt content includes: the first candidate answer and the first scoring reference information; The third scoring value is determined according to the candidate question, the knowledge text and the second candidate answer.

24. The device according to claim 22, wherein: The fourth acquisition module is specifically used for: In a case where the first score value of the first candidate answer is determined based on at least two second score values ​​belonging to the first candidate answer, obtaining second score reference information corresponding to the second score value; The second scoring reference information corresponding to the second scoring value less than the scoring threshold is determined as the first scoring reference information.

25. The apparatus of claim 18, wherein: The device further comprises: a seventh acquisition module, a second determination module and an update module; The seventh acquisition module is used to acquire the updated knowledge text in the knowledge base and the updated candidate questions in the updated knowledge text; The second determination module is used to determine a third knowledge question-answer pair according to the updated knowledge text and the updated candidate question; The updating module is used to update the knowledge question and answer database according to the third knowledge question and answer pair.

26. The device according to claim 25, wherein The updated knowledge text includes at least one of the following: a newly added knowledge text in the knowledge base, and a newly added text segment in the existing knowledge text in the knowledge base.

27. The device according to claim 18, wherein: The device further includes: a third determining module and a fourth determining module; The third determination module is used to determine the candidate question vector corresponding to the candidate question; The fourth determination module is used to determine the question vector library corresponding to the knowledge question and answer library according to the candidate questions and the candidate question vectors.

28. A knowledge question-answering device based on a large model, the device comprising: A first acquisition module is used to acquire a knowledge question and answer database; The knowledge question and answer base is determined based on the method for determining a knowledge question and answer base based on a large model according to any one of claims 1 to 10; The second acquisition module is used to acquire the target problem to be processed; The first determination module is used to determine a target answer corresponding to the target question based on the knowledge question and answer database and the target question.

29. The device according to claim 28, wherein The first determination module is specifically configured to: Querying the knowledge question and answer database according to the target question to obtain a first candidate question in the knowledge question and answer database that matches the target question; The first candidate answer corresponding to the first candidate question in the knowledge question and answer database is determined as the target answer corresponding to the target question.

30. The device according to claim 28, wherein The device further includes: a second determining module and a third determining module; The second determination module is used to determine the candidate question vector corresponding to the candidate question in the knowledge question and answer database; The third determination module is used to determine the question vector library corresponding to the knowledge question and answer library according to the candidate questions and the candidate question vectors; Correspondingly, the first determination module is specifically used to determine the target answer corresponding to the target question based on the knowledge question and answer library, the question vector library and the target question.

31. The device according to claim 30, wherein The first determination module is specifically configured to: Determine a target problem vector corresponding to the target problem; Query the question vector library according to the target question vector to obtain a candidate question vector in the question vector library that matches the target question vector; Querying the knowledge question and answer database according to the second candidate question corresponding to the candidate question vector, and obtaining a second candidate answer corresponding to the second candidate question in the knowledge question and answer database; The second candidate answer is determined as the target answer corresponding to the target question.

32. The device according to claim 31, wherein The device further includes: a third acquisition module, a fourth acquisition module and a fourth determination module; The third acquisition module is used to acquire the knowledge base corresponding to the knowledge text base when the second candidate question is not acquired; The fourth acquisition module is used to query the knowledge text in the knowledge base according to the target question, and obtain the text segment in the knowledge text that matches the target question; The fourth determination module is used to determine a target answer corresponding to the target question based on the text segment and the target question.

33. The device according to claim 32, wherein: The device further comprises: a fifth acquisition module and an update module; The fifth acquisition module is used to acquire evaluation information corresponding to the target answer; The updating module is used to update the knowledge question and answer base according to the target question and the target answer when the evaluation information indicates that the target answer is the correct answer to the target question.

34. An intelligent agent, comprising: 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, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any one of claims 1 to 10; or, execute the method of any one of claims 11 to 16.

35. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 10; or to execute the method according to any one of claims 11 to 16.

36. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 10; or implements the method according to any one of claims 11 to 16.

Citation Information

Patent Citations

  • Intelligent question-answering system and method, and related equipment

    CN112579666A

  • Intelligent agent-based medical question and answer method and system and electronic equipment

    CN118152544A

  • Question and answer method, device and equipment based on knowledge base, medium and program product

    CN118627618A

Cited By

  • Intelligent knowledge question-answering system and method based on large language model

    CN120353900A

  • Knowledge question-answering system, knowledge question-answering processing method and device thereof, medium and electronic equipment

    CN120653754A

  • LLM-RAG sample construction method and device, and storage medium

    CN120705581A