Question answering method, device and equipment, question answering robot, medium and program product

By generating preliminary answer results in the question-answering system and retrieving answer-related information to obtain candidate answer results, and then using a retrieval enhancement model to further generate accurate answers, the problem of unsatisfactory answers in the RAG model is solved, and high accuracy of answers is achieved.

CN121658587APending Publication Date: 2026-03-13XINGIN INFORMATION TECH (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing retrieval augmentation (RAG) models suffer from suboptimal answers in question-answering systems, resulting in low accuracy of generated responses.

Method used

A pre-built retrieval enhancement model is used to generate preliminary answer results. By retrieving answer-related information from the preliminary answer results, multiple candidate answer results are obtained. The retrieval enhancement model is then used to further retrieve and generate accurate answer results from these candidate results.

Benefits of technology

This improves the accuracy of the answers generated by the question-and-answer system, ensuring that the answers are closer to the needs of the questions and enhancing the precision of the answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658587A_ABST
    Figure CN121658587A_ABST
Patent Text Reader

Abstract

The invention relates to a question-answering method, device and equipment, a question-answering robot, a medium and a program product. The method comprises the following steps: generating a preliminary answer result for a target question by adopting a pre-constructed retrieval enhancement model for the target question, then performing answer related information retrieval on the preliminary answer result to obtain a plurality of candidate answer results of the target question, and finally performing retrieval generation on the plurality of candidate answer results by adopting the retrieval enhancement model. And an accurate answer result of the target question is obtained. According to the method, the accuracy of the finally generated answer to the question can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of question-and-answer technology, and in particular to a question-and-answer method, apparatus, device, question-and-answer robot, medium, and program product. Background Technology

[0002] With the development of big data and machine learning technologies, intelligent knowledge reasoning and question-answering systems have been widely applied. For example, question-answering systems can be used in question-answering scenarios including search engines, virtual assistants, and intelligent customer service.

[0003] Among related technologies, the most commonly used question-answering system is Retrieval-augmented Generation (RAG). Typically, the question is input into the RAG model, which then performs internal retrieval, summarization, and outputs the corresponding answer to the question.

[0004] However, existing RAG models often suffer from suboptimal answers to questions, resulting in low accuracy in the answers generated by the RAG models. Summary of the Invention

[0005] Therefore, it is necessary to provide a question-answering method, apparatus, device, question-answering robot, medium, and program product that can greatly improve the accuracy of answers to questions.

[0006] Firstly, this application provides a question-and-answer method, which includes:

[0007] In response to a question-and-answer request for the target question, a pre-built retrieval enhancement model is used to generate preliminary answers to the target question.

[0008] The preliminary answers are used to retrieve relevant information to obtain multiple candidate answers to the target question.

[0009] A retrieval enhancement model is used to retrieve and generate accurate answers to the target question from multiple candidate responses.

[0010] In one embodiment, answer-related information is retrieved from the preliminary answer results to obtain multiple candidate answer results for the target question, including:

[0011] Obtain vector features of the preliminary response results;

[0012] Based on the vector features of the preliminary answer results, relevant information about the answer is retrieved in the vector index library to obtain multiple candidate answer results for the target question.

[0013] In one embodiment, obtaining the vector features of the preliminary answer result includes:

[0014] The text information of the preliminary answer is input into a preset natural language processing model. The natural language processing model encodes the text information and uses the resulting encoding as the vector feature of the preliminary answer.

[0015] In one embodiment, the vector index library includes indexes of multiple question-answer pair vector features; based on the vector features of the preliminary answer results, answer-related information is retrieved from the vector index retrieval library to obtain multiple candidate answer results for the target question, including:

[0016] Similarity calculation is performed on the vector features of the preliminary answer results and the vector features of the question-and-answer pairs in each index;

[0017] Multiple candidate answers to the target question are determined based on the similarity calculation results.

[0018] In one embodiment, the vector index library also includes a mapping relationship between the indexes of multiple question-answer pair vector features and the corresponding question-answer pair text information; multiple candidate answers to the target question are determined based on the similarity calculation results, including:

[0019] Obtain the reference indices of the top N question-answer pair vector features in descending order of feature similarity; N is a positive integer.

[0020] Based on the mapping relationship, the text information of each question-and-answer pair corresponding to each reference index is used as multiple candidate answer results.

[0021] In one embodiment, before retrieving answer-related information from the vector index retrieval library, the method further includes:

[0022] Obtain multiple data sources for the scenario to which the target problem belongs;

[0023] Extract multiple question-and-answer pairs of text information from various data sources;

[0024] A vector index library is built based on text information from multiple question-answer pairs.

[0025] In one embodiment, multiple question-answer pair text information are extracted from various data sources, including:

[0026] The data sources are divided into problem-oriented data sources and non-problem-oriented data sources;

[0027] Extract question-answer pairs from question-based data sources and question-answer pairs from non-question-based data sources to obtain multiple question-answer pair text information.

[0028] In one embodiment, extracting question-answer pairs from a question-based data source includes:

[0029] By associating questions and answers in a question-based data source, you can obtain question-answer pairs corresponding to the question-based data source.

[0030] In one embodiment, extracting question-answer pairs from a non-question-based data source includes:

[0031] Extract the document titles and content of each part of the document from a non-problem data source;

[0032] By treating the document titles of each section as questions and the document content as answers, question-answer pairs corresponding to non-question-based data sources can be obtained.

[0033] In one embodiment, a vector index library is constructed based on multiple question-answer pair text information, including:

[0034] Vector extraction is performed on the text information of each question-and-answer pair to obtain multiple question-and-answer pair vector features;

[0035] Establish an index for the vector features of each question-answer pair; each question-answer pair vector feature corresponds to an index;

[0036] The vector index library is obtained by storing the index of each question-answer pair vector feature and the mapping relationship between the index of each question-answer pair vector feature and the corresponding question-answer pair text information.

[0037] In one embodiment, vector extraction is performed on the text information of each question-answer pair to obtain multiple question-answer pair vector features, including:

[0038] The text information of each question-and-answer pair is input into a preset natural language processing model, and the text information of each question-and-answer pair is encoded by the natural language processing model;

[0039] The encoding obtained from the text information of each question-and-answer pair is determined as the vector feature of the text information of each question-and-answer pair.

[0040] In one embodiment, a retrieval enhancement model is used to process multiple candidate answer results to obtain an accurate answer to the target question, including:

[0041] Multiple candidate answers and the target question are input into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain the accurate answer to the target question.

[0042] In one embodiment, a pre-built retrieval enhancement model is used to generate preliminary answers to the target question, including:

[0043] The target question is input into the intent judgment module of the retrieval enhancement model to judge the user intent of the target question and obtain the intent judgment result.

[0044] The intent judgment result is input into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain preliminary answer results.

[0045] In one embodiment, user intent is determined for the target question to obtain an intent determination result, including:

[0046] Extract semantic feature information from the target problem;

[0047] Based on the extracted semantic feature information, the intent judgment result of the target question is determined.

[0048] In one embodiment, user intent is determined for the target question to obtain an intent determination result, including:

[0049] Keyword identification for the target question;

[0050] Based on the identified keywords, intents that match the target question are selected from the pre-defined correspondence between keywords and intents, and these intents are used as the intent judgment results.

[0051] Secondly, embodiments of this application provide a question-and-answer device, the device comprising:

[0052] The first answer module is used to respond to the question-and-answer request for the target question and generate preliminary answer results for the target question using a pre-built retrieval enhancement model;

[0053] The results retrieval module is used to retrieve answer-related information from the preliminary answer results and obtain multiple candidate answer results for the target question.

[0054] The second answer module is used to retrieve and generate accurate answers to the target question by employing a retrieval enhancement model to retrieve multiple candidate answer results.

[0055] Thirdly, embodiments of this application also provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method provided in any of the embodiments of the first aspect above.

[0056] Fourthly, embodiments of this application also provide a question-answering robot, which includes the computer device provided in the third aspect embodiments above.

[0057] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in any of the embodiments of the first aspect described above.

[0058] Fifthly, embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the method provided in any of the embodiments of the first aspect described above.

[0059] The question-answering method, apparatus, device, question-answering robot, medium, and program product provided in this application first generate a preliminary answer to the target question using a pre-built retrieval enhancement model. Then, the preliminary answer is used to retrieve answer-related information to obtain multiple candidate answer results for the target question. Finally, the retrieval enhancement model is used to retrieve and generate a precise answer to the target question. In this method, the preliminary answer is used as a basis to further retrieve answer-related information to obtain multiple candidate answer results. Since the preliminary answer represents a relevant but not entirely correct answer to the target question, further retrieval of answer-related information based on the preliminary answer can obtain more accurate answer results that better match the target question. Then, the multiple candidate answer results are used as relevant information to retrieve and generate an answer to the target question. This is equivalent to finding an answer by finding an answer, rather than finding an answer by finding a question. In this way, the answer generated by retrieving multiple candidate answer results is closer to the question's requirements, thereby greatly improving the accuracy of the final answer generated for the question. Attached Figure Description

[0060] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0061] Figure 1 This is a diagram illustrating the application environment of the question-answering method provided in one embodiment.

[0062] Figure 2 This is a flowchart illustrating a question-and-answer method provided in one embodiment;

[0063] Figure 3 This is a flowchart illustrating a question-and-answer method provided in another embodiment;

[0064] Figure 4 This is a flowchart illustrating a question-and-answer method provided in another embodiment;

[0065] Figure 5 This is a flowchart illustrating a question-and-answer method provided in another embodiment;

[0066] Figure 6This is a flowchart illustrating a question-and-answer method provided in another embodiment;

[0067] Figure 7 This is a flowchart illustrating a question-and-answer method provided in another embodiment;

[0068] Figure 8 This is a flowchart illustrating a question-and-answer method provided in another embodiment;

[0069] Figure 9 This is a flowchart illustrating a question-and-answer method provided in another embodiment;

[0070] Figure 10 This is a schematic diagram of the structure of a question-and-answer device provided in one embodiment;

[0071] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0072] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0073] First, before introducing the technical solutions of the embodiments of this application in detail, we will first introduce the technical background or technical evolution on which the embodiments of this application are based.

[0074] Question answering is an important area within artificial intelligence, aiming to enable computers to understand questions posed by humans and answer them in natural language. A specific application and implementation of question answering is the question-answering system, which can accurately and concisely answer user questions posed in natural language. Typically, the technical implementation of question-answering systems includes, but is not limited to, information retrieval, information generation, knowledge graphs, and big data, with information retrieval technology being the most commonly used.

[0075] Taking the Retrieval-augmented Generation (RAG) model in information retrieval as an example, in related technologies, when faced with a user's question, the question is usually input into the RAG model, which then performs internal retrieval, summarization, and outputs the corresponding answer. The internal processing logic of the RAG model is as follows: first, it uses a preset retrieval strategy to obtain answers related to the question from a pre-built knowledge base; then, it summarizes these answers and outputs the corresponding answer.

[0076] However, existing RAG models often suffer from semantic misalignment between questions and retrieved answers, leading to suboptimal retrieval results for user inquiries and impacting the accuracy of the generated answers. For instance, consider a scenario where employees inquire about human resources policies. Suppose the employee's question is typically a brief description, such as "social security in region A." These words might be closely related to "housing provident fund in region A," "social security in region B," and "housing provident fund in region C." When retrieving answers for this question, the RAG model might output results related to "housing provident fund in region A" or "social security in region B," resulting in irrelevant answers and negatively affecting the generated results.

[0077] Therefore, addressing the problem of suboptimal answers retrieved by RAG models in related technologies, leading to low accuracy in the generated answers, a technical solution to improve the accuracy of question retrieval answers is urgently needed. To this end, embodiments of this application provide a question-answering method, apparatus, device, question-answering robot, medium, and program product. Typically, a retrieval enhancement model is used to generate a result for the question, obtaining a relevant but not entirely accurate answer. This answer is then used to retrieve related content from a database to obtain better answer retrieval results. Finally, the final answer is generated based on these results, effectively overcoming the technical deficiencies in related technologies. Of course, the technical solution provided in these embodiments is not limited to solving only the above-mentioned problems and also has other technical effects, which can be seen in the following embodiments.

[0078] Before describing the embodiments of this application, the application scenarios involved in the embodiments of this application will be described first.

[0079] The question-and-answer method provided in this application can be implemented within a computer device. Therefore, the question-and-answer method provided in this application can be applied to... Figure 1 The application environment shown includes a computer device. This computer device can be a terminal device, a server, or an integrated system of terminal devices and a server, implemented through interaction between the terminal and the server. The terminal device can be a personal computer, laptop, smartphone, tablet, IoT device, or portable wearable device. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The server can be a standalone server or a server cluster consisting of multiple servers.

[0080] like Figure 1As shown, the computer device includes at least a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities; the memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and a database, while the internal memory provides the environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data related to the question-and-answer method. The network interface is used for communication with external terminals via a network connection. Of course, Figure 1 The internal structure of the computer device shown is only a partial illustration and does not represent all the contents of the computer device. The specific components and structures required can be set according to the actual situation, and the embodiments of this application do not limit this.

[0081] In practical applications, the computer device used in the question-answering method in this application embodiment can be built into various forms of question-answering robots. The appearance of the question-answering robot is not limited. For example, it can be a robot image designed as an animal, a person, or any other object.

[0082] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the foregoing description and the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0083] like Figure 2 As shown, this application embodiment provides a question-and-answer method, which is applied to the above-mentioned... Figure 1 In the computer device shown, this embodiment includes the following steps:

[0084] S101, in response to the question-and-answer request for the target question, uses a pre-built retrieval enhancement model to generate preliminary answer results for the target question.

[0085] The target question refers to any question raised by a user who needs consultation. For example, in a scenario where employees within a company consult about human resources policies, the target question could be "What are the social security policies in region A?" or "What are the salary and benefits offered by the company?"

[0086] For example, the question-and-answer request for the target question may be triggered by the user through voice, or by the user through text in a pre-set human-computer interaction interface, or by the user selecting from preset question options. This application embodiment does not specifically limit the triggering method of the target question.

[0087] After receiving a target question from a user, the computer device first uses a pre-built retrieval enhancement model to generate a preliminary answer to the target question, i.e., a preliminary response result.

[0088] The retrieval enhancement model can be an Artificial General Intelligence (AGI) model, whose underlying implementation includes, but is not limited to, the RAG model, an AI model including a retrieval module, such as the Atlas model, etc.

[0089] In practical applications, this retrieval enhancement model is deployed and runs on computer devices. During the application process, the computer devices call upon it to perform corresponding question-and-answer operations, thereby generating corresponding answers to questions.

[0090] Taking the retrieval enhancement module as an AGI model as an example, the computer device has already pre-deployed the constructed AGI model. When the target question is received from the user, the target question is input into the AGI model. The AGI model is then used to generate an answer to the target question, obtaining a relevant but not completely correct answer as a preliminary answer to the target question.

[0091] S102, retrieve answer-related information from the preliminary answer results to obtain multiple candidate answer results for the target question.

[0092] Based on the preliminary answers to the target question obtained above, and considering their relatively poor accuracy, further retrieval of answer-related information can be performed on the preliminary answers.

[0093] The purpose of this answer-related information retrieval is to find content related to the preliminary answer result, thereby obtaining search results that are more closely matched to the target question. It can be understood that the preliminary answer result provides a general direction for answering the target question. Further searching based on this general direction yields a more refined or precise answer direction, thus avoiding the phenomenon of semantic misalignment between the question and the retrieved answer, which leads to unsatisfactory search results.

[0094] For example, the way to retrieve answer-related information from the preliminary answer results can be by matching answer-related information in a pre-built knowledge database, which refers to a knowledge base related to the domain of the target question.

[0095] For example, another way to retrieve answer-related information from preliminary answer results is to use machine learning models, such as recurrent neural networks or transformers, to directly generate new answer-related information based on the preliminary answer results. In this case, the machine learning model needs to be built in advance with a large amount of training data and computing resources.

[0096] For example, another way to retrieve answer-related information from the preliminary answer result is to use queries and inferences on a knowledge graph to retrieve the answer-related information corresponding to the preliminary answer result. This knowledge graph includes structured knowledge and entity relationships constructed from relationships in the domain to which the target question belongs.

[0097] For example, the method of retrieving answer-related information from preliminary answer results can also be to combine large-scale text data and visual information into modeling. The model can also be combined with dialogues with some pre-set expert users to generate answer-related information corresponding to the preliminary answer results.

[0098] The above is merely an example of how to retrieve answer-related information from preliminary response results, and is not intended to limit the specific retrieval methods in the embodiments of this application. These methods can be set according to actual circumstances.

[0099] It should be noted that the process of retrieving answer-related information from the preliminary answer results by computer devices can be completed using their own built-in algorithms or programs, or by sending the request to an external device to complete the process of retrieving answer-related information from the preliminary answer results and receiving the retrieval results returned by the external device.

[0100] In this embodiment of the application, the preliminary answer results are searched for answer-related information. The obtained content includes multiple answer-related information. These multiple answer-related information can be regarded as multiple candidate answer results for the target question, representing some answer results that are more consistent with the target question than the preliminary answer results.

[0101] S103 uses a retrieval enhancement model to retrieve and generate accurate answers to the target question from multiple candidate responses.

[0102] Based on the multiple candidate answers obtained, the computer device continues to use the retrieval enhancement model to retrieve and generate an answer from these multiple candidate answers, and uses the answer generated in this retrieval as the accurate answer to the target question.

[0103] In this embodiment, multiple candidate answers are used as the retrieval basis to further retrieve and generate answers to the target question. The candidate answers themselves represent some answers that are relatively matched with the target question. It is equivalent to finding answers by finding answers, so that the final answer is closer to the needs of the question, thereby improving the accuracy of the final generated answer.

[0104] For example, when a computer device uses a retrieval enhancement model to generate an answer from the multiple candidate answers, the internal logic may be to use the multiple candidate answers as relevant information for the target question, that is, as guiding and constraining information for retrieving the target question, to summarize and output the final accurate answer.

[0105] Furthermore, it should be noted that the process of generating a preliminary answer and then retrieving a precise answer based on that preliminary answer in the technical solution of this application can be viewed as a process based on Generation-augmented-Retrieval-augmented Generation (GARAG). The use of GRAG in this embodiment to answer questions can significantly improve the accuracy of the final generated answer. For example, continuing with the scenario of employees consulting about human resources policies within a company, assuming the target question is "What are the company's salary and benefits?", if an AGI model is used to generate an answer to this question, the accuracy of the retrieval step is 72%, and the accuracy of the generated answer is 63%. However, using the GRAG method in this embodiment to generate the answer, the accuracy of the retrieval step can be improved to 99%, and correspondingly, the accuracy of the final generated answer can be improved to 94%. The above data is merely an illustrative example for clarity, and this embodiment does not specifically limit the numerical value of the accuracy improvement.

[0106] The question-answering method provided in this application first uses a pre-built retrieval enhancement model to generate a preliminary answer to the target question. Then, it retrieves answer-related information from the preliminary answer to obtain multiple candidate answer results. Finally, it uses the retrieval enhancement model to retrieve and generate a precise answer to the target question. In this method, the preliminary answer is used as a basis to further retrieve answer-related information, resulting in multiple candidate answer results. Since the preliminary answer represents a relevant but not entirely correct answer to the target question, further retrieval of answer-related information based on the preliminary answer yields more accurate answer results that better match the target question. Then, these multiple candidate answer results are used as relevant information to retrieve and generate an answer to the target question. This is equivalent to finding an answer by finding answers, rather than finding an answer by finding a question. Therefore, the answer generated from multiple candidate answer results is closer to the question's requirements, thus greatly improving the accuracy of the final answer.

[0107] The above embodiments illustrate the ways in which each step in the question-answering method can be implemented. In order to make the question-answering method provided by this application embodiment clearer, based on the above embodiments, detailed embodiments are provided below to describe the process of generating a preliminary answer result for the target question using a pre-built retrieval enhancement model, the process of retrieving answer-related information from the preliminary answer result to obtain multiple candidate answer results for the target question, and the process of retrieving and generating a precise answer result for the target question using a retrieval enhancement model from multiple candidate answer results.

[0108] The following section will first introduce the process of generating preliminary answers to the target question using a pre-built retrieval enhancement model.

[0109] like Figure 3 As shown, in one embodiment, the above S101 includes the following steps:

[0110] S201, Input the target question into the intent judgment module of the retrieval enhancement model, perform user intent judgment on the target question, and obtain the intent judgment result.

[0111] In this embodiment of the application, the retrieval enhancement model includes an intent determination module, which is used to determine the user's intent when asking a question. Here, the intent determination module broadly refers to the combination of software and hardware within the retrieval enhancement system that implements the user intent determination function.

[0112] In other words, after the target question enters the retrieval enhancement model, it is first input into the intent judgment module. The intent judgment module can output the intent judgment result corresponding to the target question after the instruction is executed.

[0113] For example, the intent determination result can include three types: casual conversation, retrieval, and inquiry. Casual conversation typically refers to dialogue without a specific purpose. In casual conversation, the focus is not on obtaining specific information or solving technical problems, but rather on establishing interaction and communication between the two parties. Retrieval is more goal-oriented, usually involving using keywords or questions to find specific information or data, focusing more on obtaining specific information or solving problems. Inquiry typically refers to the process of asking a question and waiting for an answer. Inquiry can be very direct, or it can involve repeatedly correcting errors or supplementing information to express the problem. Inquiry requires a response to the question, and compared to retrieval which focuses on obtaining specific information and solving problems, it is more relaxed in terms of content.

[0114] Based on the various types of intent determination results mentioned above, this application provides two methods for determining user intent for a target question.

[0115] In one embodiment, the process of determining user intent for a target question and obtaining the intent determination result includes: extracting semantic feature information from the target question; and determining the intent determination result of the target question based on the extracted semantic feature information.

[0116] In this embodiment, the text information of the target question is often composed of a single sentence. For example, when extracting semantic feature information of the target question, whether it is a short sentence or a long sentence, the sentence structure of the text information of the target question can be parsed to extract the grammatical structure information of the sentence. Then, the local semantic information between individual words or word fragments can be extracted to extract the semantic feature information of the target question. Then, the intention judgment result of the target question can be determined based on the semantic feature information of the target question.

[0117] For example, when extracting semantic feature information from a target question, the text information of the target question can be directly input into a pre-trained semantic feature extraction neural network model, the neural network model can output the semantic feature information of the target question, and the intention judgment result of the target question can be determined based on the semantic feature information of the target question.

[0118] Taking the intention judgment result as including three types: casual conversation, retrieval, and inquiry, after determining the semantic feature information of the target question, the intention judgment result of the target question can be determined by combining the features of each of the three types: casual conversation, retrieval, and inquiry. For example, if the voice feature information matches the characteristics of asking a question in casual conversation, then the intention judgment result of the target question is determined to be casual conversation; if the voice feature information matches the characteristics of asking a question in retrieval, then the intention judgment result of the target question is determined to be retrieval; if the voice feature information matches the characteristics of asking a question in inquiry, then the intention judgment result of the target question is determined to be inquiry.

[0119] In this embodiment, the semantic feature information of the target question is used as the basis for determining the intent judgment result of the target question, so as to more accurately grasp the true intent of the question, avoid misunderstanding or misinterpretation of the question, and thus improve the accuracy of intent judgment.

[0120] In another embodiment, the process of determining user intent for the target question and obtaining the intent determination result includes: identifying keywords for the target question; and selecting intents that match the target question from a preset correspondence between keywords and intents based on the identified keywords, as the intent determination result.

[0121] In this embodiment, keywords refer to words that can represent the semantics of the target question. The method for identifying keywords in the target question can be to clean, segment, and divide the text information of the target question, then perform word segmentation, remove meaningless words based on the part of speech of each segmented word, and finally select important words related to the semantics of the target question as keywords for the target question.

[0122] Of course, a large number of mapping relationships between keywords and intents can be established in advance based on big data and historical data. In this way, after the keywords of the target question are determined, the mapping relationship is used to match and find a set of mapping relationships that match the keywords of the target question. The intent in the set of mapping relationships is used as the intent judgment result of the target question.

[0123] Taking the intention judgment result as including three types: casual conversation, retrieval, and inquiry, when establishing the mapping relationship between keywords and intentions, the intentions can be divided into three categories: casual conversation, retrieval, and inquiry. Then, for each of these three categories of intentions, all possible keywords are associated. During matching, the intention corresponding to which the keyword of the target question falls, or the keyword of the target question and the keyword associated with which intention have the highest similarity, is determined as the intention judgment result of the target question.

[0124] In this embodiment, since the mapping relationship is pre-established, it can accurately represent the keywords involved in each intent. Therefore, matching the keywords of the target question in the mapping relationship allows for accurate determination of the intent judgment result of the target question based on the pre-established mapping relationship. On the other hand, directly calling the mapping relationship allows for simple and quick determination of the intent judgment result of the target question.

[0125] S202, input the intent judgment result into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain preliminary answer results.

[0126] In this embodiment, the retrieval enhancement model also includes an answer retrieval module. After the intent of the target question is determined, the intent judgment result is input into the answer retrieval module. The answer retrieval module further retrieves and generates an answer to the question based on the intent of the target question; that is, this answer is a preliminary response to the target question. Here, the answer retrieval module broadly refers to the combination of software and hardware that implements the function of retrieving and generating question answers within the retrieval enhancement model.

[0127] For example, the way to generate answers to questions within the answer retrieval module is to first construct search terms based on the target question and the intent judgment results of the target question. These search terms include, but are not limited to, a single word or a combination of multiple words. Based on the constructed search terms, information is retrieved from a pre-established knowledge base or an external knowledge base. Finally, the retrieved information is summarized and the answer to the question is output.

[0128] In this embodiment, the retrieval enhancement model for generating question-answer retrieval functions is structured into two main modules: an intent judgment module and an answer retrieval module. Upon receiving a user's target question, the retrieval enhancement module first uses the intent judgment module to determine the user's intent, and then uses the answer retrieval module to retrieve and answer the question, generating an answer as a preliminary response to the target question. The entire process is based on the user's intent in asking the question, ensuring a strong correlation between the generated preliminary response and the target question, thus guaranteeing the correctness of the preliminary response in terms of direction.

[0129] Based on any of the above embodiments, the process of retrieving answer-related information from preliminary answer results to obtain multiple candidate answer results for the target question will be described below.

[0130] like Figure 4 As shown, in one embodiment, the above S102 includes the following steps:

[0131] S301, Obtain the vector features of the preliminary answer results.

[0132] The preliminary answers to the target questions obtained in the above embodiments are presented in text information.

[0133] To simplify the information retrieval process and reduce the resource consumption required, vector features can be used. Therefore, it is necessary to obtain the vector features of the preliminary response results.

[0134] In this context, obtaining the vector features of the preliminary response results is essentially representing the textual information of the preliminary response results as a vector.

[0135] In one embodiment, the process of obtaining the vector features of the preliminary answer result includes: inputting the text information of the preliminary answer result into a preset natural language processing model, encoding the text information through the natural language processing model, and using the obtained encoding as the vector features of the preliminary answer result.

[0136] Among them, the natural language processing model can be SentenceTransformers. This natural language processing model converts the text information of the received preliminary response into a fixed-length numerical value for encoding, such as word embedding. The resulting encoding can be used as a vector representation of the text information of the preliminary response, that is, the vector feature of the preliminary response.

[0137] The natural language processing model is independent of the retrieval enhancement model; the two can be deployed on the same computer device or on different computer devices.

[0138] Alternatively, the text information of the preliminary answer can be directly input into a word vector model, which then outputs a vector representation of the preliminary answer, thereby obtaining the vector features of the preliminary answer. This word vector model can be based on a neural network language model, which generates word vectors by learning words in a corpus and their contextual relationships.

[0139] In this embodiment, the vector representation of the preliminary answer result is generated by encoding the text information of the preliminary answer result, making the vector features of the preliminary answer result more accurate.

[0140] S302, based on the vector features of the preliminary answer results, retrieve answer-related information from the vector index library to obtain multiple candidate answer results for the target question.

[0141] After obtaining the vector features of the preliminary answer results, answer-related information can be retrieved in the vector index library to obtain multiple candidate answer results for the target question.

[0142] The vector index library is pre-built and can include indexes of multiple question-answer pair vector features, as well as the mapping relationship between the indexes of multiple question-answer pair vector features and the corresponding question-answer pair text information.

[0143] In this context, a question-answer pair refers to a pair of questions and their corresponding answers. The question-answer pair itself is represented by textual information, hence the term "question-answer pair textual information." Extracting vector features from the question-answer pair textual information yields the question-answer pair vector features. Each question-answer pair possesses both one question-answer pair textual information and one question-answer pair vector feature.

[0144] Correspondingly, the index of the question-answer pair vector feature refers to the index corresponding to each question-answer pair vector feature, which is used to represent different question-answer pair vector features.

[0145] The vector index library can be built in a retrieval system independent of the retrieval enhancement model, and correspondingly, the built vector index library can also be deployed in that retrieval system. This retrieval system can be deployed on the same computer device as the retrieval enhancement model, or they can be deployed on separate computer devices.

[0146] It should be noted that the vector index library can be constructed separately for relevant knowledge and data sources in different fields. In this embodiment of the application, retrieving answer-related information in the vector index library means retrieving it in the vector index library of the field to which the target question belongs. For example, if the target question is "What are the salary and benefits of Company S?", then the corresponding vector index library is constructed based on relevant knowledge and data sources of salary and benefits. More specifically, it can be constructed based on some documents related to salary and benefits within Company S.

[0147] In this embodiment, based on the vector features of the preliminary answer results, answer-related information is retrieved in a vector index library to obtain multiple candidate answer results for the target question. This constructs a vector index library for the question's domain. Then, the preliminary answer results are vectorized. Since vector features have a much smaller data volume than text information, retrieval using vector features can significantly save retrieval resources and improve retrieval efficiency. Furthermore, because the vector index library stores a large number of indexes of question-answer pair vector features and their mapping relationships with the question-answer pair text information, it ensures that question-answer pairs related to the preliminary answer results can be retrieved from the vector index library. This improves the accuracy of compressing answer-related information from the preliminary answer results, thereby obtaining more accurate candidate answer results.

[0148] Please see Figure 5 As shown, in one embodiment, the process of retrieving answer-related information from a vector index retrieval library based on the vector features of the preliminary answer results to obtain multiple candidate answer results for the target question includes the following steps:

[0149] S401, calculate the similarity between the vector features of the preliminary answer results and the vector features of the question-answer pairs in each index.

[0150] The vector index library contains indexes of multiple question-and-answer pair vector features, each index corresponding to a question-and-answer pair vector feature. Therefore, similarity calculations can be performed between the vector features of the preliminary answer and the question-and-answer pair vector features in each index of the vector index library. Essentially, this involves comparing the vector features of the preliminary answer with which question-and-answer pair vector feature in the vector index library matches.

[0151] For example, similarity calculation can be performed by mapping the vector features of the initial response and the question-answer pair vector features in each index to the same vector space. Then, the Euclidean distance between the vector features of the initial response and the vector features of each question-answer pair is calculated in this vector space. This Euclidean distance represents the degree of similarity; a larger Euclidean distance indicates a lower degree of similarity, and vice versa. Of course, Euclidean distance is just one example. In practical engineering, Manhattan distance, Chebyshev distance, Minkowski distance, etc., can also be calculated between two feature vectors to measure the similarity between them.

[0152] For example, in addition to determining similarity by calculating the distance between vector features, some coefficients that characterize vector similarity can also be calculated, including but not limited to the maximum value of the absolute difference between the two vectors in each dimension, Jaccard similarity coefficient, Pearson correlation coefficient, Spearman correlation coefficient, and relative entropy, etc.

[0153] S402, determine multiple candidate answers to the target question based on the similarity calculation results.

[0154] Based on the similarity calculation results of the vector features of the preliminary answer results and the vector features of the question-answer pairs in each index, multiple candidate answer results are selected.

[0155] For example, a similarity threshold can be set. When filtering multiple candidate answers, first filter out the similarity calculation results that are greater than the similarity threshold, then determine the index of the question-answer pair vector feature corresponding to these similarity calculation results that are greater than the similarity threshold, and then determine the required multiple candidate answers based on the determined index of these question-answer pair vector feature.

[0156] Each candidate answer result is the same as the preliminary answer result, and is in the form of text information.

[0157] Therefore, determining the required multiple candidate answers based on the indexes of these precisely derived question-answer pair vector features can be further achieved by combining the mapping relationship between the indexes of multiple question-answer pair vector features included in the vector index library and the corresponding question-answer pair text information. The question-answer pair text information mapped by the indexes of these precisely derived question-answer pair vector features is then determined as the required multiple candidate answers.

[0158] In this case, the question-and-answer text information itself can be stored in the memory of the computer device, and the vector index only needs to store the mapping relationship, so as to reduce the amount of data in the vector index and improve the retrieval efficiency.

[0159] For example, in another embodiment, the process of determining multiple candidate answers to a target question based on similarity calculation results may include: obtaining reference indices of the top N question-answer pair vector features ranked by feature similarity from high to low; and using the text information of each question-answer pair corresponding to each reference index as multiple candidate answers according to the mapping relationship; where N is a positive integer.

[0160] The similarity calculation results of the vector features of the preliminary answer results and the vector features of the question-answer pairs in each index are sorted from high to low similarity. Then, the indices of the top N question-answer pairs vector features in the sorted results are selected as reference indices. N is a pre-set value that can be set based on empirical data. For example, N can be equal to 3, 5, etc.

[0161] For example, the vector features of the preliminary response results extracted above can be retrieved in the established vector index library to obtain the Top N of the retrieval results, for example, N=3.

[0162] After selecting the top N reference indices, the same process as described above can be used to combine the mapping relationship between the indexes of multiple question-answer pair vector features included in the vector index library and the question-answer pair text information corresponding to each question-answer pair vector feature, and determine the question-answer pair text information mapped by these reference indices as the multiple candidate answer results required.

[0163] Whether filtering the index of question-answer pair vector features by similarity threshold or by sorting, the ultimate goal is to select question-answer pair vector features with high similarity to the vector features of the preliminary answer results, thereby obtaining question-answer pair text information with high similarity and improving the accuracy of the candidate answer results of the retrieved target question.

[0164] In this embodiment, similarity calculations are performed on the vector features of the preliminary answer results and the question-answer pair vector features in each index. Based on the similarity calculation results, multiple candidate answer results for the target question are determined. The similarity between vector features represents the consistency between vector features. Thus, using the similarity between vector features to filter search results allows for the selection of question-answer pair vector features that are more relevant to the preliminary answer results. This identifies question-answer pair text information that is semantically highly aligned with the target question, thereby improving the accuracy of the final determined candidate answer results.

[0165] The above examples illustrate the application process of the vector index library. In actual use, the construction of the vector index library also needs to be completed in advance. The construction process of the vector index library is described below.

[0166] In one embodiment, the question-answering method provided in this application further includes a process for constructing a vector index library, such as... Figure 6 As shown, the construction process includes the following steps:

[0167] S501: Obtain multiple data sources for the scenario to which the target problem belongs.

[0168] The target problem itself is a general term referring to a problem in any domain and any scenario. Therefore, when building a vector index library, you only need to obtain the required data source to determine which domain and scenario you want to build the vector index library for.

[0169] For example, multiple data sources can be obtained from the context of the target problem. These could be relevant documents downloaded from the network or received from user input, or historical data stored in a database. The data content in these data sources can include image data, tabular data, text information, numerical information, and even video or audio, as well as links, etc.

[0170] For example, if the target problem pertains to the "compensation and benefits" scenario, the data source could be all internal data related to compensation and benefits within the company.

[0171] S502 extracts multiple question-and-answer text information from various data sources.

[0172] Based on the acquired multiple data sources, multiple question-and-answer pairs of text information can be extracted from each data source.

[0173] For example, by analyzing various data sources, extracting and summarizing multiple questions, compiling the answers to each question, and associating each question with its corresponding answer to form a text information pair, multiple question-answer pair text information can be obtained.

[0174] S503 constructs a vector index library based on multiple question-answer pair text information.

[0175] Based on the extracted text information of multiple question-answer pairs, a vector index library is constructed, which is the vector index library of the scenario to which the target question belongs.

[0176] The constructed vector index library can be stored on a computer device and directly accessed when needed. Of course, to ensure the comprehensiveness and accuracy of the question-answer pairs stored in the vector index library, it can be updated periodically. For example, in a corporate compensation and benefits scenario, since corporate compensation and benefits policies change due to various factors, timely reconstruction of the vector index library based on the latest compensation and benefits data source ensures that the question-answer pairs in the vector index library are also updated with the latest compensation and benefits data source.

[0177] In this embodiment, question-and-answer pair text information is extracted from the data source of the scenario to which the target question belongs, and then a vector index library is constructed based on the extracted question-and-answer pair text information. This allows the vector index library to better match the knowledge information in the scenario to which the target question belongs, thus ensuring the accuracy of the answers retrieved for the target question.

[0178] like Figure 7 As shown, in one embodiment, extracting multiple question-answer pair text information from various data sources in the above embodiments includes the following steps:

[0179] S601 categorizes data sources into problem-oriented data sources and non-problem-oriented data sources.

[0180] The data source format and content type are not uniform in any given scenario, so we can simply divide the data source in the scenario to which the target problem belongs into problem-oriented data sources and non-problem-oriented data sources.

[0181] Question-based data sources, as the name suggests, are data sources that contain questions and corresponding answers. These data sources are often organized in a question-and-answer format during collection, aiming to directly answer questions, provide concise and clear answers, and facilitate quick access to the required information.

[0182] Non-question-based data sources are primarily presented as descriptive documents, without questions or required answers. These data sources employ more flexible and diverse organizational structures, potentially including narratives, discussions, charts, images, and other formats, aiming to provide more comprehensive information and analysis.

[0183] For example, the process of classifying data sources into question-based data sources and non-question-based data sources can be based on the form or structural characteristics of the content organization in the data source. Those that conform to the question-answer format are classified as question-based data sources, while those that do not conform to the question-answer format are classified as non-question-based data sources.

[0184] S602, extract question-answer pairs from question-based data sources and extract question-answer pairs from non-question-based data sources to obtain multiple question-answer pair text information.

[0185] Both the question-based data sources and the non-question-based data sources obtained from the classification can be used to extract question-answer pairs, and the extracted question-answer pairs can be used as multiple question-answer pair text information as needed.

[0186] In one embodiment, the extraction of question-answer pairs from a question-based data source includes associating questions and answers from the question-based data source to obtain the question-answer pairs corresponding to the question-based data source.

[0187] In this embodiment, the question-based data source itself is organized in the form of questions and answers, so each question-answer pair can be directly associated as a question-answer pair, thereby improving the accuracy and convenience of question-answer pair extraction.

[0188] In one embodiment, the extraction of question-answer pairs from non-question-based data sources includes: extracting the document titles and document content of each part of the documents in the non-question-based data source; taking the document titles of each part of the documents as questions and the document content as answers to obtain the question-answer pairs corresponding to the non-question-based data source.

[0189] In this embodiment, non-problem data sources are not as straightforward as problem data sources, so they need to be extracted according to a certain strategy.

[0190] For example, the strategy could be to divide the non-question data source into multiple documents based on the semantics expressed by the content in the non-question data source. For each document, a document title could be extracted. Then, the extracted document title of each document could be used as the question, and the content of the document itself could be used as the answer to the question. The two could be associated to form a question-answer pair, thereby extracting all question-answer pairs from the non-question data source.

[0191] For example, assuming a data source is used in the "corporate compensation and benefits" scenario, the data source can be roughly divided into two categories. The first category is question-based data source, which is organized in the form of QA (question and answer pairs). The other category is non-question-based data source, which contains a large number of segmented documents. In this case, the document title of each segmented document is used as the question, and the content of each segmented document is used as the corresponding answer.

[0192] It should be noted that when extracting question-and-answer pairs, formatted data such as images and tables in the data source need to be converted to a recognizable format. If links need to be provided in the answers of each question-and-answer pair, data link information needs to be added when constructing the question-and-answer pairs. This ensures the accuracy, recognizability, and comprehensiveness of the final extracted question-and-answer pairs.

[0193] In this embodiment of the application, when extracting multiple question-and-answer text information from various data sources, the data sources are divided into question-type data sources and non-question-type data sources. Then, different strategies are adopted to extract question-and-answer text information from each data source based on the content format characteristics of question-type data sources and non-question-type data sources. In this way, the targeted strategy for extracting question-and-answer text information makes the extracted question-and-answer text information more accurate.

[0194] In one embodiment, such as Figure 8 As shown, the process of constructing a vector index library based on multiple question-answer pair text information in the above embodiment includes the following steps:

[0195] S701, extract vectors from the text information of each question-and-answer pair to obtain multiple question-and-answer pair vector features.

[0196] To facilitate retrieval using vector features, the question-and-answer pair text information extracted from the data source also needs to undergo vector extraction. One vector feature is extracted for each question-and-answer pair text information, resulting in multiple question-and-answer pair vector features.

[0197] In one embodiment, the process of extracting vectors from the text information of each question-and-answer pair in this application embodiment may include: inputting the text information of each question-and-answer pair into a preset natural language processing model, encoding the text information of each question-and-answer pair through the natural language processing model, and determining the encoded text information of each question-and-answer pair as the vector feature of each question-and-answer pair text information.

[0198] Similar to extracting vector features from the initial response results mentioned earlier, the natural language processing model can use SentenceTransformers. This model converts the received question-and-answer pair text information into fixed-length numerical values ​​for encoding, such as using word embedding techniques. The resulting encoding can serve as a vector representation of the question-and-answer pair text information, which is the vector feature of each question-and-answer pair text information.

[0199] Alternatively, the text information of each question-and-answer pair can be directly input into a word vector model, which then outputs vector representations of the text information of each question-and-answer pair, thereby obtaining the vector features of each text information. This word vector model can be based on a neural network language model, which generates word vectors by learning words in a corpus and their contextual relationships.

[0200] In this embodiment, the vector representation of each question-and-answer pair is generated by encoding the text information, making the vector features of the text information of each question-and-answer pair more accurate.

[0201] S702, establish an index for the vector features of each question-answer pair; each question-answer pair vector feature corresponds to an index.

[0202] After obtaining multiple question-answer pair vector features, an index object is created for each question-answer pair vector feature, where each question-answer pair vector feature corresponds to an index.

[0203] Among them, the index of vector features refers to the construction of a data index structure that is efficient in both time and space for vector features through a certain mathematical quantification model. For example, the structure of the index may include a vector field and a text field to store the corresponding question-answer pair vector features.

[0204] S703, store the index of each question-answer pair vector feature, and the mapping relationship between the index of each question-answer pair vector feature and the corresponding question-answer pair text information, to obtain a vector index library.

[0205] Each question-answer pair vector feature is indexed, and the corresponding question-answer pair vector features are also stored in the index. This allows for the establishment of a mapping relationship between the index of each question-answer pair vector feature and the corresponding question-answer pair text information. All of this information is then built and stored in a vector index library.

[0206] In this embodiment, vector extraction is performed on the text information of each question-and-answer pair to obtain multiple question-and-answer pair vector features. An index for each question-and-answer pair vector feature is then established. The indexes of each question-and-answer pair vector feature, along with the mapping relationship between these indexes and the corresponding question-and-answer pair text information, are stored to obtain a vector index library. In other words, by vectorizing the text of each question-and-answer pair and establishing mapping relationships, a vector index library is formed. This ensures that the constructed vector index library matches the question-and-answer pair text information required for the target question, guaranteeing the correctness and comprehensiveness of the information in the vector index library and improving the accuracy of retrieving candidate answers to the target question from the vector index library.

[0207] In this embodiment of the application, multiple candidate answers to the target question are retrieved based on the preliminary answer results. These multiple candidate answers are then input into the retrieval enhancement model for retrieval generation, and the retrieval-generated answer is used as the accurate answer to the target question.

[0208] Based on any of the above embodiments, in one embodiment, S103 includes the following steps: inputting multiple candidate answer results and the target question into the answer retrieval module of the retrieval enhancement model to perform answer retrieval for the target question and obtain accurate answer results for the target question.

[0209] As mentioned earlier, the retrieval enhancement model has an intent judgment module and an answer retrieval module. At this stage, since multiple candidate answers that are relatively relevant to the target question have already been obtained, there is no need to go through the intent judgment module again. The multiple candidate answers and the target question are directly input into the answer retrieval module of the retrieval enhancement model. The multiple candidate answers are used as relevant information for retrieval to generate an answer to the target question, thereby obtaining an accurate answer to the target question.

[0210] For example, since multiple candidate answers were selected based on their high similarity, these multiple candidate answers can be represented as Top1, Top2, and Top3, respectively.

[0211] The instruction logic in the answer retrieval module of the retrieval enhancement model can be exemplified as follows:

[0212] Let's say you are a senior HR professional with M years of experience, working for company "{company}", and your ability is to accurately answer employees' questions using relevant information retrieved from the database. Your language style is "{style}".

[0213] The relevant information we know now includes:

[0214] Related information 1:

[0215] Top1

[0216] Related Information 2:

[0217] Top2

[0218] Related Information 3:

[0219] Top 3

[0220] An employee has asked you a question: "{question}". Please provide your answer based on the relevant information.

[0221] In this embodiment, multiple candidate answer results obtained based on the preliminary answer results are re-input into the retrieval enhancement model to generate the answer. In this way, the answer is found by the answer, rather than by the question, so that the answer generated by the multiple candidate answer results is closer to the question requirements, thereby greatly improving the accuracy of the final answer generated for the question.

[0222] In addition, such as Figure 9 As shown in the illustration, this application also provides an embodiment of a question-and-answer method, which includes the following steps:

[0223] S1: Obtain multiple data sources for the scenario to which the target problem belongs.

[0224] S2 divides each data source into problem-oriented data sources and non-problem-oriented data sources.

[0225] S3 associates the questions and answers in the question-based data source to obtain the question-answer pair text information corresponding to the question-based data source; and extracts the document titles and document content of each part of the document in the non-question-based data source, and uses the document titles of each part of the document as questions and the document content as answers to obtain the question-answer pair text information corresponding to the non-question-based data source.

[0226] S4. Input the text information of each question-and-answer pair into a preset natural language processing model, and encode the text information of each question-and-answer pair through the natural language processing model.

[0227] S5, the encoding of each question-and-answer pair text information is determined as the vector feature of each question-and-answer pair text information.

[0228] S6, establish an index for the vector features of each question-answer pair; each question-answer pair vector feature corresponds to an index.

[0229] S7. Store the index of each question-answer pair vector feature, as well as the mapping relationship between the index of each question-answer pair vector feature and the corresponding question-answer pair text information, to obtain the vector index library.

[0230] S8, in response to the question-and-answer request for the target question, inputs the target question into the intent judgment module of the retrieval enhancement model, performs user intent judgment on the target question, and obtains the intent judgment result.

[0231] S9. Input the intent judgment result into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain the preliminary answer result.

[0232] S10: Input the text information of the preliminary answer result into the preset natural language processing model, encode the text information through the natural language processing model, and use the obtained encoding as the vector feature of the preliminary answer result.

[0233] S11, calculate the similarity between the vector features of the preliminary answer results and the vector features of the question-answer pairs in each index.

[0234] S12, obtain the reference indexes of the question-answer pair vector features ranked in the top N by feature similarity from high to low.

[0235] N is a positive integer.

[0236] S13. Based on the mapping relationship between the indexes of multiple question-answer pair vector features and the corresponding question-answer pair text information, the text information of each question-answer pair corresponding to each reference index is used as multiple candidate answer results.

[0237] S14. Input multiple candidate answers and the target question into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain the accurate answer to the target question.

[0238] For example, taking the retrieval enhancement model as an AGI large model and the question-answer pair as an OA pair, the technical solution of this application can be divided into two stages by combining the above steps S1-S14:

[0239] (I) Preparation stage:

[0240] a. Extract QA pairs from the data source and use sentence-transformer to extract vector features.

[0241] Among them, the sentence-transformer is an external vector model independent of the AGI model.

[0242] For example, when using the "Salary and Benefits" data source, the data sources are roughly divided into two categories. The first category is question-based data sources, which are organized in the form of QA. The other category is non-question-based data sources, which contain a large number of segmented documents. The document titles of each segmented document are used as questions, and the content of each segmented document is used as an answer, to obtain the OA pairs for each type of data source.

[0243] For formatted data such as images and tables in the data source, conversion is required. If links need to be provided in the answers, additional links need to be added when constructing the data. Based on the actual business needs, the data source is processed to form QA pairs corresponding to each data source.

[0244] b. Construct a vector index library based on faiss (a similarity search tool) using the vector features of the QA pairs in (a) .

[0245] The construction and deployment of this vector index can both be carried out in an external retrieval system independent of the AGI large model.

[0246] (II) Application Phase:

[0247] a. Receive questions from users and input them into the AGI model so that the AGI model can generate preliminary answers.

[0248] This step is completed within the AGI big model. Specifically, after receiving a user's question, the AGI big model first determines the user's intent (casual conversation, retrieval, or inquiry). Based on the determined user intent, the AGI then retrieves and answers the question, generating the answer to the question.

[0249] In engineering implementation, the first step, determining the user's intent using AGI, can be performed within the intent determination module of the AGI master model. The second step, retrieving and generating the answer to the question using AGI, can be performed within the answer retrieval module of the AGI master model.

[0250] b. Extract vector features from the initial response results output by the AGI large model using the sentence-transformer in (a) (i).

[0251] c. The vector features of the preliminary response results extracted above are retrieved in the vector index library established in (a) b, and the Top N of the retrieval results are obtained (e.g., N=3).

[0252] This vector index can be deployed in a retrieval system independent of the AGI large model.

[0253] d. In the AGI large model, the TopN results obtained above are input into the system instructions corresponding to the retrieval and answer questions in AGI to obtain the final accurate answer.

[0254] Of course, the above-mentioned AGI large model, external vector model and external retrieval system can all be deployed and run on the same computer device or on different computer devices. This application embodiment does not limit this.

[0255] In this technical solution, an AGI (Automatic Guided Vehicle) model is first used to generate preliminary answer results. These preliminary results are then used as input to an external retrieval system for more precise searching, yielding Top N search results. Finally, the retrieved Top N search results are re-inputted into the AGI model to generate accurate answer results. In this way, the AGI model first generates a result for the question, obtaining a relevant but not entirely accurate answer. Then, semantic features are extracted from this answer to retrieve related content from the database, resulting in better answer retrieval results. Finally, the final answer is generated based on these retrieval results, significantly improving the accuracy of the AGI-generated question answers.

[0256] For example, the question-and-answer method provided by this application can be applied to scenarios where employees within an enterprise consult with HR policy experts, resulting in better quality and more effective responses from employees.

[0257] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0258] Based on the same inventive concept, this application also provides a question-answering device for implementing the question-answering method described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more question-answering device embodiments provided below can be found in the limitations of the question-answering method above, and will not be repeated here.

[0259] In one exemplary embodiment, such as Figure 10 As shown, a question-and-answer device 100 is provided, including: a first answer module 1001, a result retrieval module 1002, and a second answer module 1003, wherein:

[0260] The first answer module 1001 is used to respond to the question-and-answer request of the target question and generate preliminary answer results for the target question using a pre-built retrieval enhancement model;

[0261] The result retrieval module 1002 is used to retrieve answer-related information from the preliminary answer results and obtain multiple candidate answer results for the target question.

[0262] The second answer module 1003 is used to retrieve and generate accurate answers to the target question by employing a retrieval enhancement model to retrieve multiple candidate answer results.

[0263] In one embodiment, the result retrieval module 1002 includes: a vector feature extraction unit and an related information retrieval unit, wherein:

[0264] The vector feature extraction unit is used to obtain the vector features of the preliminary answer results;

[0265] The relevant information retrieval unit is used to retrieve answer-related information from the vector index library based on the vector features of the preliminary answer results, and obtain multiple candidate answer results for the target question.

[0266] In one embodiment, the vector feature extraction unit includes: a first vector feature extraction subunit, wherein:

[0267] The first vector feature extraction subunit is used to input the text information of the preliminary answer result into a preset natural language processing model, encode the text information through the natural language processing model, and use the obtained encoding as the vector feature of the preliminary answer result.

[0268] In one embodiment, the vector index library includes indexes of multiple question-answer pair vector features; the relevant information retrieval unit includes: a similarity determination subunit and a candidate answer result determination subunit, wherein:

[0269] The similarity determination subunit is used to calculate the similarity between the vector features of the preliminary answer results and the vector features of the question-answer pairs in each index;

[0270] The candidate answer determination subunit is used to determine multiple candidate answers to the target question based on the similarity calculation results.

[0271] In one embodiment, the vector index library also includes a mapping relationship between the indexes of multiple question-answer pair vector features and the corresponding question-answer pair text information; the candidate answer result determination subunit is also used to obtain the reference indexes of the top N question-answer pair vector features ranked by feature similarity in descending order; according to the mapping relationship, the question-answer pair text information corresponding to each reference index is used as multiple candidate answer results; N is a positive integer.

[0272] In one embodiment, the apparatus further includes: a data source acquisition unit, a question-answer pair text information extraction unit, and a vector index library construction unit, wherein:

[0273] The data source acquisition unit is used to acquire multiple data sources for the scenario to which the target problem belongs;

[0274] The question-and-answer pair text information extraction unit is used to extract multiple question-and-answer pair text information from various data sources;

[0275] The vector index library building unit is used to build a vector index library based on multiple question-answer pair text information.

[0276] In one embodiment, the data source acquisition unit includes: a data source partitioning subunit and a question-and-answer pair text information extraction subunit, wherein:

[0277] Data source partitioning sub-units are used to divide each data source into problem-oriented data sources and non-problem-oriented data sources;

[0278] The question-and-answer pair text information extraction subunit is used to extract question-and-answer pairs from question-based data sources and question-and-answer pairs from non-question-based data sources, resulting in multiple question-and-answer pair text information.

[0279] In one embodiment, the question-and-answer pair text information extraction subunit is also used to associate questions and answers in the question-based data source to obtain the question-and-answer pair corresponding to the question-based data source.

[0280] In one embodiment, the question-answer pair text information extraction subunit is further used to extract the document title and document content of each part of the document in the non-question-type data source; and to obtain the question-answer pair corresponding to the non-question-type data source by taking the document title of each part of the document as the question and the document content as the answer.

[0281] In one embodiment, the vector index library construction unit includes: a second vector feature extraction subunit, an index building subunit, and a mapping storage subunit; wherein:

[0282] The second vector feature extraction subunit is used to extract vectors from the text information of each question-answer pair to obtain multiple question-answer pair vector features.

[0283] The index building sub-unit is used to build the index for each question-answer pair vector feature; each question-answer pair vector feature corresponds to one index.

[0284] The mapping storage subunit is used to store the index of each question-answer pair vector feature, as well as the mapping relationship between the index of each question-answer pair vector feature and the corresponding question-answer pair text information, to obtain a vector index library.

[0285] In one embodiment, the second vector feature extraction subunit is further configured to input the text information of each question-and-answer pair into a preset natural language processing model, encode the text information of each question-and-answer pair through the natural language processing model, and determine the encoded text information of each question-and-answer pair as the vector feature of each question-and-answer pair text information.

[0286] In one embodiment, the second answer module 1003 includes: a precise answer retrieval unit, wherein:

[0287] The precise answer retrieval unit is used to input multiple candidate answer results and the target question into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain the precise answer result for the target question.

[0288] In one embodiment, the first answer module 1001 includes: a user intent determination unit and a preliminary answer retrieval unit, wherein:

[0289] The user intent determination unit is used to input the target question into the intent determination module of the retrieval enhancement model, determine the user intent of the target question, and obtain the intent determination result.

[0290] The preliminary answer retrieval unit is used to input the intent judgment results into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain preliminary answer results.

[0291] In one embodiment, the user intent determination unit includes: a semantic feature extraction subunit and a first intent determination subunit, wherein:

[0292] The semantic feature extraction subunit is used to extract semantic feature information from the target problem.

[0293] The first intent judgment subunit is used to determine the intent judgment result of the target question based on the extracted semantic feature information.

[0294] In one embodiment, the user intent determination unit includes: a keyword recognition subunit and a second intent determination subunit, wherein:

[0295] The keyword recognition subunit is used to identify keywords for the target question;

[0296] The second intent judgment subunit is used to filter intents that match the target question from the preset correspondence between keywords and intents based on the identified keywords, and use this as the intent judgment result.

[0297] The question-and-answer devices provided in this application are similar to the aforementioned question-and-answer methods in terms of their application concept, problem-solving methods, implementation principles, processes, and achievable technical effects. Therefore, the implementation of the devices and methods can refer to each other. Here, the parts and beneficial effects that are repeated in the embodiments of this application and the method embodiments will not be described again.

[0298] Each module in the aforementioned question-and-answer device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0299] It should be noted that the division of modules, units, and sub-units in the embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units.

[0300] If the aforementioned integrated units are implemented as software functional units and sold or used as independent products, they can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application.

[0301] In one exemplary embodiment, this application also provides a computer device, which may be a terminal, and its internal structure diagram may be as follows: Figure 11As shown. The computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a question-and-answer method. Those skilled in the art will understand that... Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0302] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0303] In response to a question-and-answer request for the target question, a pre-built retrieval enhancement model is used to generate preliminary answers to the target question.

[0304] The preliminary answers are used to retrieve relevant information to obtain multiple candidate answers to the target question.

[0305] A retrieval enhancement model is used to retrieve and generate accurate answers to the target question from multiple candidate responses.

[0306] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0307] Obtain vector features of the preliminary response results;

[0308] Based on the vector features of the preliminary answer results, relevant information about the answer is retrieved in the vector index library to obtain multiple candidate answer results for the target question.

[0309] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0310] The text information of the preliminary answer is input into a preset natural language processing model. The natural language processing model encodes the text information and uses the resulting encoding as the vector feature of the preliminary answer.

[0311] In one embodiment, the vector index library includes indexes of multiple question-answer pair vector features; the processor, when executing the computer program, also performs the following steps:

[0312] Similarity calculation is performed on the vector features of the preliminary answer results and the vector features of the question-and-answer pairs in each index;

[0313] Multiple candidate answers to the target question are determined based on the similarity calculation results.

[0314] In one embodiment, the vector index library also includes a mapping relationship between the indexes of multiple question-answer pair vector features and the corresponding question-answer pair text information; when the processor executes the computer program, it also implements the following steps:

[0315] Obtain the reference indices of the top N question-answer pair vector features in descending order of feature similarity; N is a positive integer.

[0316] Based on the mapping relationship, the text information of each question-and-answer pair corresponding to each reference index is used as multiple candidate answer results.

[0317] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0318] Obtain multiple data sources for the scenario to which the target problem belongs;

[0319] Extract multiple question-and-answer pairs of text information from various data sources;

[0320] A vector index library is built based on text information from multiple question-answer pairs.

[0321] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0322] The data sources are divided into problem-oriented data sources and non-problem-oriented data sources;

[0323] Extract question-answer pairs from question-based data sources and question-answer pairs from non-question-based data sources to obtain multiple question-answer pair text information.

[0324] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0325] By associating questions and answers in a question-based data source, you can obtain question-answer pairs corresponding to the question-based data source.

[0326] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0327] Extract the document titles and content of each part of the document from a non-problem data source;

[0328] By treating the document titles of each section as questions and the document content as answers, question-answer pairs corresponding to non-question-based data sources can be obtained.

[0329] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0330] Vector extraction is performed on the text information of each question-and-answer pair to obtain multiple question-and-answer pair vector features;

[0331] Establish an index for the vector features of each question-answer pair; each question-answer pair vector feature corresponds to an index;

[0332] The vector index library is obtained by storing the index of each question-answer pair vector feature and the mapping relationship between the index of each question-answer pair vector feature and the corresponding question-answer pair text information.

[0333] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0334] The text information of each question-and-answer pair is input into a preset natural language processing model, and the text information of each question-and-answer pair is encoded by the natural language processing model;

[0335] The encoding obtained from the text information of each question-and-answer pair is determined as the vector feature of the text information of each question-and-answer pair.

[0336] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0337] Multiple candidate answers and the target question are input into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain the accurate answer to the target question.

[0338] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0339] The target question is input into the intent judgment module of the retrieval enhancement model to judge the user intent of the target question and obtain the intent judgment result.

[0340] The intent judgment result is input into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain preliminary answer results.

[0341] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0342] Extract semantic feature information from the target problem;

[0343] Based on the extracted semantic feature information, the intent judgment result of the target question is determined.

[0344] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0345] Keyword identification for the target question;

[0346] Based on the identified keywords, intents that match the target question are selected from the pre-defined correspondence between keywords and intents, and these intents are used as the intent judgment results.

[0347] The computer device provided in this application embodiment has all the same method steps and technical effects implemented by its processor when executed, which are the same as those in the aforementioned question-and-answer method embodiment, and will not be repeated here.

[0348] In one exemplary embodiment, this application also provides a question-answering robot, which includes the computer device provided in this application embodiment. This question-answering robot can also implement the steps of any question-answering method that a computer device can implement.

[0349] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0350] In response to a question-and-answer request for the target question, a pre-built retrieval enhancement model is used to generate preliminary answers to the target question.

[0351] The preliminary answers are used to retrieve relevant information to obtain multiple candidate answers to the target question.

[0352] A retrieval enhancement model is used to retrieve and generate accurate answers to the target question from multiple candidate responses.

[0353] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0354] Obtain vector features of the preliminary response results;

[0355] Based on the vector features of the preliminary answer results, relevant information about the answer is retrieved in the vector index library to obtain multiple candidate answer results for the target question.

[0356] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0357] The text information of the preliminary answer is input into a preset natural language processing model. The natural language processing model encodes the text information and uses the resulting encoding as the vector feature of the preliminary answer.

[0358] In one embodiment, the vector index library includes indexes of multiple question-answer pair vector features; when the computer program is executed by a processor, it also performs the following steps:

[0359] Similarity calculation is performed on the vector features of the preliminary answer results and the vector features of the question-and-answer pairs in each index;

[0360] Multiple candidate answers to the target question are determined based on the similarity calculation results.

[0361] In one embodiment, the vector index library also includes a mapping relationship between the indexes of multiple question-answer pair vector features and the corresponding question-answer pair text information; when the computer program is executed by the processor, it also performs the following steps:

[0362] Obtain the reference indices of the top N question-answer pair vector features in descending order of feature similarity; N is a positive integer.

[0363] Based on the mapping relationship, the text information of each question-and-answer pair corresponding to each reference index is used as multiple candidate answer results.

[0364] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0365] Obtain multiple data sources for the scenario to which the target problem belongs;

[0366] Extract multiple question-and-answer pairs of text information from various data sources;

[0367] A vector index library is built based on text information from multiple question-answer pairs.

[0368] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0369] The data sources are divided into problem-oriented data sources and non-problem-oriented data sources;

[0370] Extract question-answer pairs from question-based data sources and question-answer pairs from non-question-based data sources to obtain multiple question-answer pair text information.

[0371] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0372] By associating questions and answers in a question-based data source, you can obtain question-answer pairs corresponding to the question-based data source.

[0373] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0374] Extract the document titles and content of each part of the document from a non-problem data source;

[0375] By treating the document titles of each section as questions and the document content as answers, question-answer pairs corresponding to non-question-based data sources can be obtained.

[0376] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0377] Vector extraction is performed on the text information of each question-and-answer pair to obtain multiple question-and-answer pair vector features;

[0378] Establish an index for the vector features of each question-answer pair; each question-answer pair vector feature corresponds to an index;

[0379] The vector index library is obtained by storing the index of each question-answer pair vector feature and the mapping relationship between the index of each question-answer pair vector feature and the corresponding question-answer pair text information.

[0380] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0381] The text information of each question-and-answer pair is input into a preset natural language processing model, and the text information of each question-and-answer pair is encoded by the natural language processing model;

[0382] The encoding obtained from the text information of each question-and-answer pair is determined as the vector feature of the text information of each question-and-answer pair.

[0383] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0384] Multiple candidate answers and the target question are input into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain the accurate answer to the target question.

[0385] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0386] The target question is input into the intent judgment module of the retrieval enhancement model to judge the user intent of the target question and obtain the intent judgment result.

[0387] The intent judgment result is input into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain preliminary answer results.

[0388] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0389] Extract semantic feature information from the target problem;

[0390] Based on the extracted semantic feature information, the intent judgment result of the target question is determined.

[0391] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0392] Keyword identification for the target question;

[0393] Based on the identified keywords, intents that match the target question are selected from the pre-defined correspondence between keywords and intents, and these intents are used as the intent judgment results.

[0394] The computer-readable storage medium provided in this application embodiment has the same method steps and technical effects as those implemented by the computer program stored thereon when executed by a processor, and will not be repeated here.

[0395] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0396] In response to a question-and-answer request for the target question, a pre-built retrieval enhancement model is used to generate preliminary answers to the target question.

[0397] The preliminary answers are used to retrieve relevant information to obtain multiple candidate answers to the target question.

[0398] A retrieval enhancement model is used to retrieve and generate accurate answers to the target question from multiple candidate responses.

[0399] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0400] Obtain vector features of the preliminary response results;

[0401] Based on the vector features of the preliminary answer results, relevant information about the answer is retrieved in the vector index library to obtain multiple candidate answer results for the target question.

[0402] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0403] The text information of the preliminary answer is input into a preset natural language processing model. The natural language processing model encodes the text information and uses the resulting encoding as the vector feature of the preliminary answer.

[0404] In one embodiment, the vector index library includes indexes of multiple question-answer pair vector features; when the computer program is executed by a processor, it also performs the following steps:

[0405] Similarity calculation is performed on the vector features of the preliminary answer results and the vector features of the question-and-answer pairs in each index;

[0406] Multiple candidate answers to the target question are determined based on the similarity calculation results.

[0407] In one embodiment, the vector index library also includes a mapping relationship between the indexes of multiple question-answer pair vector features and the corresponding question-answer pair text information; when the computer program is executed by the processor, it also performs the following steps:

[0408] Obtain the reference indices of the top N question-answer pair vector features in descending order of feature similarity; N is a positive integer.

[0409] Based on the mapping relationship, the text information of each question-and-answer pair corresponding to each reference index is used as multiple candidate answer results.

[0410] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0411] Obtain multiple data sources for the scenario to which the target problem belongs;

[0412] Extract multiple question-and-answer pairs of text information from various data sources;

[0413] A vector index library is built based on text information from multiple question-answer pairs.

[0414] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0415] The data sources are divided into problem-oriented data sources and non-problem-oriented data sources;

[0416] Extract question-answer pairs from question-based data sources and question-answer pairs from non-question-based data sources to obtain multiple question-answer pair text information.

[0417] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0418] By associating questions and answers in a question-based data source, you can obtain question-answer pairs corresponding to the question-based data source.

[0419] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0420] Extract the document titles and content of each part of the document from a non-problem data source;

[0421] By treating the document titles of each section as questions and the document content as answers, question-answer pairs corresponding to non-question-based data sources can be obtained.

[0422] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0423] Vector extraction is performed on the text information of each question-and-answer pair to obtain multiple question-and-answer pair vector features;

[0424] Establish an index for the vector features of each question-answer pair; each question-answer pair vector feature corresponds to an index;

[0425] The vector index library is obtained by storing the index of each question-answer pair vector feature and the mapping relationship between the index of each question-answer pair vector feature and the corresponding question-answer pair text information.

[0426] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0427] The text information of each question-and-answer pair is input into a preset natural language processing model, and the text information of each question-and-answer pair is encoded by the natural language processing model;

[0428] The encoding obtained from the text information of each question-and-answer pair is determined as the vector feature of the text information of each question-and-answer pair.

[0429] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0430] Multiple candidate answers and the target question are input into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain the accurate answer to the target question.

[0431] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0432] The target question is input into the intent judgment module of the retrieval enhancement model to judge the user intent of the target question and obtain the intent judgment result.

[0433] The intent judgment result is input into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain preliminary answer results.

[0434] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0435] Extract semantic feature information from the target problem;

[0436] Based on the extracted semantic feature information, the intent judgment result of the target question is determined.

[0437] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0438] Keyword identification for the target question;

[0439] Based on the identified keywords, intents that match the target question are selected from the pre-defined correspondence between keywords and intents, and these intents are used as the intent judgment results.

[0440] The computer program product provided in this application embodiment has all the same method steps and technical effects implemented when executed by a processor as those in the aforementioned question-and-answer method embodiment, and will not be repeated here.

[0441] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0442] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0443] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0444] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A question-and-answer method, characterized in that, The method includes: In response to a question-and-answer request for the target question, a pre-built retrieval enhancement model is used to generate a preliminary answer to the target question; The preliminary answer results are used to retrieve answer-related information to obtain multiple candidate answer results for the target question; The retrieval enhancement model is used to retrieve and generate accurate answers to the target question from the multiple candidate answers.

2. The method according to claim 1, characterized in that, The preliminary answer result is used to retrieve answer-related information to obtain multiple candidate answer results for the target question, including: Obtain the vector features of the preliminary answer result; Based on the vector features of the preliminary answer results, the relevant information of the answer is retrieved in the vector index library to obtain multiple candidate answer results for the target question.

3. The method according to claim 2, characterized in that, The process of obtaining the vector features of the preliminary answer result includes: The text information of the preliminary answer result is input into a preset natural language processing model, and the text information is encoded by the natural language processing model. The resulting encoding is used as the vector feature of the preliminary answer result.

4. The method according to claim 2, characterized in that, The vector index library includes indexes of multiple question-answer pair vector features; the step of retrieving answer-related information from the vector index retrieval library based on the vector features of the preliminary answer results to obtain multiple candidate answer results for the target question includes: Similarity calculation is performed on the vector features of the preliminary answer results and the vector features of the question-answer pairs in each of the indices; Based on the similarity calculation results, multiple candidate answers to the target question are determined.

5. The method according to claim 4, characterized in that, The vector index library also includes the mapping relationship between the indexes of the multiple question-answer pair vector features and the corresponding question-answer pair text information; the step of determining multiple candidate answers to the target question based on the similarity calculation results includes: Obtain the reference indices of the top N question-answer pair vector features in descending order of feature similarity; N is a positive integer. According to the mapping relationship, the text information of each question-and-answer pair corresponding to each of the reference indices is used as the multiple candidate answer results.

6. The method according to any one of claims 2-5, characterized in that, Before performing the answer-related information retrieval in the vector index retrieval database, the method further includes: Obtain multiple data sources for the scenario to which the target problem belongs; Extract multiple question-answer pair text information from each of the aforementioned data sources; Based on the multiple question-and-answer pairs of text information, the vector index library is constructed.

7. The method according to claim 6, characterized in that, The extraction of multiple question-answer pair text information from each of the aforementioned data sources includes: The data sources are categorized into problem-oriented data sources and non-problem-oriented data sources. Extract question-answer pairs from the question-type data source and extract question-answer pairs from the non-question-type data source to obtain the multiple question-answer pair text information.

8. The method according to claim 7, characterized in that, The extraction of question-answer pairs from the question-based data source includes: By associating the questions and answers in the question-based data source, the question-answer pairs corresponding to the question-based data source are obtained.

9. The method according to claim 7, characterized in that, The extraction of question-answer pairs from the non-question-type data source includes: Extract the document titles and document content of each part of the documents in the non-problem data source; By using the document titles of each part of the document as questions and the document content as answers, question-answer pairs corresponding to the non-question-type data source are obtained.

10. The method according to claim 6, characterized in that, The construction of the vector index library based on the multiple question-answer pair text information includes: Vector extraction is performed on the text information of each question-and-answer pair to obtain multiple question-and-answer pair vector features; Establish an index for each question-answer pair vector feature; each question-answer pair vector feature corresponds to an index; The vector index library is obtained by storing the indexes of the vector features of each question-answer pair and the mapping relationship between the indexes of the vector features of each question-answer pair and the text information of the question-answer pairs corresponding to the vector features of each question-answer pair.

11. The method according to claim 10, characterized in that, The step of extracting vectors from the text information of each question-and-answer pair to obtain multiple question-and-answer pair vector features includes: The text information of each question-and-answer pair is input into a preset natural language processing model, and the text information of each question-and-answer pair is encoded by the natural language processing model. The encoding obtained from the text information of each question-and-answer pair is determined as the vector feature of the text information of each question-and-answer pair.

12. The method according to any one of claims 1-5, characterized in that, The process of using the retrieval enhancement model to process the multiple candidate answer results to obtain the accurate answer to the target question includes: The multiple candidate answers and the target question are input into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain the accurate answer to the target question.

13. The method according to any one of claims 1-5, characterized in that, The process of generating preliminary answers to the target question using a pre-built retrieval enhancement model includes: The target question is input into the intent judgment module of the retrieval enhancement model to judge the user intent of the target question and obtain the intent judgment result. The intent judgment result is input into the answer retrieval module of the retrieval enhancement model to retrieve the answer to the target question and obtain the preliminary answer result.

14. The method according to claim 13, characterized in that, The step of determining user intent for the target question and obtaining the intent determination result includes: Semantic feature information is extracted from the target problem; Based on the extracted semantic feature information, the intent judgment result of the target question is determined.

15. The method according to claim 13, characterized in that, The step of determining user intent for the target question and obtaining the intent determination result includes: Keyword identification is performed on the target question; Based on the identified keywords, intents that match the target question are selected from the preset correspondence between keywords and intents, and these intents are used as the intent judgment results.

16. A question-and-answer device, characterized in that, The device includes: The first answer module is used to respond to the question-and-answer request of the target question and generate preliminary answer results for the target question using a pre-built retrieval enhancement model; The result retrieval module is used to retrieve answer-related information from the preliminary answer results to obtain multiple candidate answer results for the target question. The second answer module is used to retrieve and generate accurate answers to the target question by employing the retrieval enhancement model to the multiple candidate answer results.

17. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1-15.

18. A question-answering robot, characterized in that, The question-answering robot includes the computer device as described in claim 17.

19. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-15.

20. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-15.