Multi-task hybrid retrieval enhancement generation question answering method, system, electronic device and storage medium

By calculating the semantic similarity and text similarity between the user's question text and the data to be retrieved, the target task is adaptively identified, and the problem of model solidification in existing RAG question-and-answer methods is solved, reducing the cost of modification and improving the accuracy of the answer.

CN119760059APending Publication Date: 2025-04-04GRG INTELLIGENT TECH SOLUTION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411643270.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

When the existing RAG question-and-answer method deals with multitasking problems, the model solidification problem cannot be responded quickly, and the construction of training data is complex and the modification cost is high.

Method used

By calculating the semantic similarity and text similarity between the user problem text and the search knowledge of each search task corresponding to the data to be retrieved, it is converted into the scoring probability of each search task, and adaptively identify the target task to avoid model solidification.

Benefits of technology

The adaptive identification of target tasks in RAG questions and answers is realized, which reduces the cost of changes caused by category increase and decrease and business adjustment, and improves the accuracy of answers to large language models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760059A_ABST
    Figure CN119760059A_ABST
Patent Text Reader

Abstract

The present invention provides a multi-task hybrid retrieval enhanced question-answering method, system, electronic device and storage medium, which relates to the field of artificial intelligence technology. The method introduces task-based question-answering into RAG question-answering, and adaptively identifies the target task according to the cumulative probability of each retrieval task during the RAG question-answering process, so as to avoid the problem of model solidification leading to the inability to respond quickly. Moreover, it is not necessary to construct a large amount of training data during the task identification process, only the cumulative probability needs to be calculated, which can reduce the cost of changes caused by the increase or decrease of categories and business adjustments. Furthermore, task answers are obtained through task-based question-answering, and prompt information is constructed as a guide for large language models to answer through the retrieval knowledge of the target task and the task answer, so that the target answer obtained by the large language model can be made more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a multi-task hybrid retrieval enhancement generation question and answer method, system, electronic device and storage medium. Background Art

[0002] With the rise of big model technology, question-answering systems have evolved from frequently-asked questions (FAQ) and task-based question-answering to retrieval-augmented generation (RAG) question-answering. FAQ-based question-answering uses natural language processing (NLP) technology to match the best answer from a pre-defined list of frequently asked questions to answer users' questions. Task-based question-answering uses semantic understanding algorithms to identify user intent and mentioned entities, manages dialogues and interacts with users through task parsing, obtains complete information needed to complete this round of dialogue, and then organizes a complete answer. RAG question-answering retrieves relevant knowledge and integrates it into prompts, allowing large language models (LLMs) to refer to the corresponding knowledge and give reasonable answers.

[0003] The existing RAG question-answering method only searches for existing knowledge and uses LLM to combine the searched knowledge to give answers. This method can make full use of LLM's ability to understand, summarize, and analyze, and provide targeted answers to knowledge and questions. However, when user questions involve multiple tasks, classification models are often used for multi-classification of intents, or LLM is used to split tasks. This will lead to the problem of model solidification. When categories need to be increased or decreased, or business adjustments and changes occur, the model cannot respond quickly, and constructing training data is very complex and the cost of changes is high. Summary of the invention

[0004] The present invention provides a multi-task hybrid retrieval enhanced question-answering method, system, electronic device and storage medium to solve the defects in the related art.

[0005] The present invention provides a multi-task hybrid retrieval enhancement generation question answering method, comprising: Get the user question text; Calculating the semantic similarity and textual similarity between the user question text and the retrieval knowledge of each retrieval task corresponding to the data to be retrieved, and calculating the retrieval score of the retrieval knowledge of each retrieval task based on the semantic similarity and the textual similarity; Converting the retrieval scores of the retrieval knowledge of each retrieval task into the score probabilities of each retrieval task, and determining the cumulative probabilities of each retrieval task in descending order of the score probabilities of each retrieval task, and identifying the target task involved in the user question text based on the cumulative probabilities of each retrieval task; According to the task requirements of the target task, the task answer corresponding to the user question text is determined in the data to be retrieved, and based on the retrieval knowledge of the target task and the task answer, prompt information is constructed to guide the large language model to answer the user question text.

[0006] According to a multi-task hybrid retrieval enhancement question-answering method provided by the present invention, the target task involved in the user question text is identified based on the cumulative probability of each retrieval task, including: Determine the specified tasks whose cumulative probability is greater than the set threshold for the first time; Other tasks having a higher score probability than the designated task are used as the target tasks.

[0007] According to a multi-task hybrid retrieval enhancement generation question answering method provided by the present invention, the task requirement of the target task is an entity requirement; The step of determining the task answer corresponding to the user question text in the to-be-retrieved data according to the task requirements of the target task includes: Performing entity recognition on the user question text to determine target entity information involved in the user question text; If the target entity information does not meet the entity requirement, sending interaction information to the user, receiving entity supplementary information from the user in response to the interaction information, and determining complete entity information based on the supplementary information and the target entity information; Based on the target task, the complete entity information is applied to search for the task answer in the data to be retrieved.

[0008] According to a multi-task hybrid retrieval enhancement question-answering method provided by the present invention, the retrieval scores of the retrieval knowledge of each retrieval task are converted into the score probabilities of each retrieval task, including: Based on the softmax activation function, the retrieval scores of the retrieval knowledge of each retrieval task are converted into score probabilities of each retrieval task.

[0009] According to a multi-task hybrid retrieval enhancement generation question-answering method provided by the present invention, the retrieval knowledge of each retrieval task includes a retrieval title and a retrieval content; the data to be retrieved includes structured data and / or unstructured data; If there is unstructured data in the data to be retrieved, the retrieval content is the document knowledge of the unstructured data, and the retrieval title is the summary of the document knowledge; If there is structured data in the data to be retrieved, the retrieval title is the retrieval task name, and the retrieval content is the retrieval task question.

[0010] According to a multi-task hybrid retrieval enhancement generation question answering method provided by the present invention, the retrieval task corresponding to the unstructured data includes one; The structured data includes multiple retrieval tasks corresponding to the structured data, and the multiple retrieval tasks corresponding to the structured data are obtained based on entity extraction from the structured data.

[0011] According to a multi-task hybrid retrieval enhancement question-answering method provided by the present invention, the calculation of the semantic similarity and textual similarity between the user question text and the retrieval knowledge of each retrieval task corresponding to the data to be retrieved includes: Based on the semantic model, obtaining the semantic representation of the user question text and the retrieval knowledge of each retrieval task, and calculating the semantic similarity based on the semantic representation; Based on the keyword model, the keyword features of the user question text and the retrieval knowledge of each retrieval task are obtained, and based on the keyword features, the text similarity is calculated.

[0012] The present invention also provides a multi-task hybrid retrieval enhancement generation question answering system, comprising: Question acquisition module, used to obtain user question text; A score calculation module, used to calculate the semantic similarity and text similarity between the user question text and the retrieval knowledge of each retrieval task corresponding to the data to be retrieved, and calculate the retrieval score of the retrieval knowledge of each retrieval task based on the semantic similarity and the text similarity; A task identification module, used to convert the retrieval scores of the retrieval knowledge of each retrieval task into the score probability of each retrieval task, and determine the cumulative probability of each retrieval task in descending order of the score probability of each retrieval task, and identify the target task involved in the user question text based on the cumulative probability of each retrieval task; The answering module is used to determine the task answer corresponding to the user question text in the data to be retrieved according to the task requirements of the target task, and to construct prompt information based on the retrieval knowledge of the target task and the task answer to guide the large language model to answer the user question text.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the multi-task hybrid retrieval enhancement question-answering generation method as described in any one of the above is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the multi-task hybrid retrieval enhancement question-answering methods described above.

[0015] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the multi-task hybrid retrieval enhancement question-answering methods described above.

[0016] The present invention provides a multi-task hybrid retrieval enhanced question-answering method, system, electronic device and storage medium. The method introduces task-based question-answering into RAG question-answering, and adaptively identifies the target task according to the cumulative probability of each retrieval task during the RAG question-answering process, thereby avoiding the problem of model solidification leading to an inability to respond quickly. Moreover, it is not necessary to construct a large amount of training data during the task identification process, only the cumulative probability needs to be calculated, which can reduce the cost of changes caused by category increases and decreases and business adjustments. Furthermore, task answers are obtained through task-based question-answering, and prompt information is constructed as a guide for large language model answers through the retrieval knowledge of the target task and the task answer, which can make the target answer obtained by the large language model answer more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 This is one of the flow charts of the multi-task hybrid retrieval enhanced question-answering method provided by the present invention.

[0019] Figure 2 It is a structural schematic diagram of the multi-task hybrid retrieval enhancement generation question and answer device provided by the present invention.

[0020] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] Based on the technical problems existing in the existing RAG question-answering method, a multi-task hybrid retrieval-enhanced generation question-answering method is provided in the embodiment of the present invention. This method is a variant of the existing RAG question-answering method. It integrates task-based question-answering into RAG question-answering, which can not only utilize the capabilities of large models, but also retain the advantages of task-based question-answering. Based on the "retrieval + generation" mode of RAG question-answering, multi-task question-answering is realized.

[0023] Figure 1 FIG. 1 is a flow chart of a multi-task hybrid retrieval enhancement question-answering method provided in an embodiment of the present invention. Figure 1 As shown, the method includes: S1, obtain the user question text; S2, calculating the semantic similarity and text similarity between the user question text and the retrieval knowledge of each retrieval task corresponding to the data to be retrieved, and calculating the retrieval score of the retrieval knowledge of each retrieval task based on the semantic similarity and the text similarity; S3, converting the retrieval scores of the retrieval knowledge of each retrieval task into the score probability of each retrieval task, and determining the cumulative probability of each retrieval task in descending order of the score probability of each retrieval task, and identifying the target task involved in the user question text based on the cumulative probability of each retrieval task; S4, according to the task requirements of the target task, determine the task answer corresponding to the user question text in the data to be retrieved, and construct prompt information based on the retrieval knowledge of the target task and the task answer to guide the large language model to answer the user question text.

[0024] Specifically, the multi-task hybrid retrieval enhanced question and answer generation method provided in the embodiment of the present invention is executed by a multi-task hybrid retrieval enhanced question and answer generation system, which can be configured in a computer, which can be a local computer or a cloud computer. The local computer can be a computer, a tablet, etc., which is not specifically limited here.

[0025] First, step S1 is performed to obtain a user question text. The user question text may be a question input by the user through voice conversion, or may be a question input by the user in text form, which is not specifically limited here. The user question text may be a question for the data to be retrieved, and an answer that can answer the user question text may be obtained by retrieving the data to be retrieved.

[0026] The data to be retrieved may include structured data and / or unstructured data. The unstructured data may be a document, and the structured data may be a table, a graph, etc.

[0027] For documents with long contents, the segmentation slicing method, length slicing method, and content slicing method can be used to slice the document. At the same time, in order to prevent the semantics of the document context from being destroyed, a window with a length greater than a length threshold can be used for slicing, or a window slicing method can be used to form document knowledge. All document knowledge can correspond to a retrieval task, and the retrieval knowledge of the retrieval task corresponding to the document can be formed through the knowledge of each document.

[0028] For structured data, since it is impossible to directly use RAG question-answering for retrieval and generate answers, different retrieval tasks in the structured data can be extracted based on the structure, relationship, and attributes of the structured data. Each retrieval task corresponds to a retrieval entity in the structured data, that is, a retrieval entity used to query the structured data. The retrieval entity is the retrieval knowledge of the retrieval task.

[0029] Then, step S2 is performed to calculate the semantic similarity and text similarity between the user question text and the search knowledge of each search task corresponding to the data to be searched. The text similarity can be calculated first, and the semantics of the user question text and each search knowledge are determined respectively to calculate the semantic similarity.

[0030] Text similarity focuses on the similarity between user question text and retrieval knowledge in surface form or structure, which usually involves the comparison of language units such as characters, words, phrases or sentences. Semantic similarity focuses more on the similarity between user question text and retrieval knowledge in meaning or intent. Even if there are great differences between user question text and retrieval knowledge in terms of vocabulary selection, sentence structure, etc., as long as the information or intent they convey is the same or similar, they can be considered semantically similar.

[0031] After that, the retrieval score of the retrieval knowledge of each retrieval task is calculated using the semantic similarity and text similarity. For example, the semantic similarity and text similarity between the user question text and the retrieval knowledge of each retrieval task can be weighted and fused, and the fusion result obtained is the retrieval score of the retrieval knowledge of each retrieval task. It can be seen that the retrieval knowledge of each retrieval task corresponds to a retrieval score. The weights used in weighted fusion can be set according to the characteristics of the scene, and are not specifically limited here.

[0032] After that, step S3 is executed, and the retrieval scores of the retrieval knowledge of each retrieval task can form a vector, and the vector can be converted into a probability distribution through a normalization function to obtain the score probability of each retrieval task. Here, the normalization function can be an activation function such as softmax, sigmoid, etc. that maps the input to between 0 and 1, or other types of normalization functions, which are not specifically limited here.

[0033] The cumulative probability of each retrieval task can be determined in descending order of the score probability of each retrieval task. For example, the cumulative probability of the nth retrieval task can be equal to the sum of the score probabilities of the first n-1 retrieval tasks. Furthermore, the target task involved in the user's question text can be identified through the cumulative probability of each retrieval task. For example, a designated task whose cumulative probability is greater than a set threshold for the first time can be selected, and other tasks with a score probability higher than the designated task can be used as the target task involved in the user's question text. The designated threshold can be set as needed and is not specifically limited here. The target task may include one or more retrieval tasks.

[0034] Finally, step S4 is executed to determine the task answer corresponding to the user question text in the data to be retrieved based on the task requirements of the target task. The task requirements of the target task can be obtained from the user question text or through interaction with the user. The task requirements of the target task refer to the key information needed to perform the target task. For example, the target task is what is the employee number of employee A. The corresponding retrieval entity is "employee number", and the task requirement is A, which can be directly obtained from the user question text. For another example, the target task is how many overtime hours does employee A have on March 5, 2021. The corresponding retrieval entity can be "overtime hours", and the task requirements can include A and the time point of March 5, 2021.

[0035] It is understandable that if there is only one target task, the task requirements of the target task can be directly used to determine the task answer corresponding to the user question text in the data to be retrieved. If there are multiple target tasks, since each retrieval task is independent of each other, they do not affect each other when determining the task answer. That is, for multiple target tasks, the task answer of each target task can be determined in order from high to low according to the corresponding score probability, or in random order. The different execution order of each target task will not affect the determination of the task answer of the target task.

[0036] Afterwards, the retrieval knowledge and task answers of the target task are used to construct prompt information, and the user's question text and prompt information are input into the large language model. Through the prompt information, the knowledge large language model generates a target answer for the user's question text and feeds back the target answer to the user.

[0037] The multi-task hybrid retrieval enhancement generation question-answering method provided in the embodiment of the present invention first obtains the user question text; then calculates the semantic similarity and text similarity between the user question text and the retrieval knowledge of each retrieval task corresponding to the data to be retrieved, and calculates the retrieval score of the retrieval knowledge of each retrieval task based on the semantic similarity and text similarity; thereafter, the retrieval score of the retrieval knowledge of each retrieval task is converted into the score probability of each retrieval task, and the cumulative probability of each retrieval task is determined in the order of the score probability of each retrieval task from high to low, and the target task involved in the user question text is identified based on the cumulative probability of each retrieval task; finally, according to the task requirements of the target task, the task answer corresponding to the user question text is determined in the data to be retrieved, and based on the retrieval knowledge and task answer of the target task, prompt information is constructed to guide the large language model to answer the user question text. The method introduces task-based question-answering into RAG question-answering, and adaptively identifies the target task according to the cumulative probability of each retrieval task in the RAG question-answering process, avoiding the problem of model solidification leading to the inability to respond quickly. Moreover, it is not necessary to construct a large amount of training data in the task identification process, only the cumulative probability needs to be calculated, which can reduce the modification cost caused by category increase and decrease and business adjustment. Furthermore, by obtaining task answers through task-based question answering, and by constructing prompt information as a guide for the large language model to answer through the retrieval knowledge of the target task and the task answer, the target answer obtained by the large language model can be made more accurate.

[0038] Different from the shortcomings of the traditional intent recognition model, which has the disadvantage of model solidification, this method transforms the multi-classification problem into a knowledge retrieval method, and can adaptively identify all the target tasks contained in the user's question text. When the user's question text changes, it is only necessary to adjust the retrieval knowledge of the target task. For example, when the original intent in the user's question text is modified, it is only necessary to modify the retrieval knowledge of the original target task; when a new intent is added or the original intent is deleted in the user's question text, it is only necessary to perform a relative increase or deletion operation on the target task.

[0039] Based on the above embodiment, the task requirement of the target task is a physical requirement; The step of determining the task answer corresponding to the user question text in the to-be-retrieved data according to the task requirements of the target task includes: Performing entity recognition on the user question text to determine target entity information involved in the user question text; If the target entity information does not meet the entity requirement, sending interaction information to the user, receiving entity supplementary information from the user in response to the interaction information, and determining complete entity information based on the supplementary information and the target entity information; Based on the target task, the complete entity information is applied to search for the task answer in the data to be retrieved.

[0040] Specifically, the task requirement of the target task may be an entity requirement, which refers to key entity information required to execute the target task, and may be determined when constructing each retrieval task.

[0041] In the process of determining the task answer corresponding to the user question text in the to-be-retrieved data, entity recognition may be performed on the user question text to determine the target entity information involved in the user question text. The target entity information may include the entity and entity type involved in the user question text.

[0042] After that, the target entity information is matched with the entity requirements of the target task. If the target entity information meets the entity requirements of the target task, it means that task-based question answering can be carried out. The target entity information is used as complete entity information, and the task answer is found in the data to be retrieved based on the target task and the complete entity information.

[0043] If the target entity information does not meet the entity requirements of the target task, it means that the task-based question and answer cannot be performed, and the user needs to provide further entity supplementary information. Therefore, interactive information can be sent to the user, and the interactive information is used to instruct the user to provide entity supplementary information, which can be a question asked to the user. The user can input the user question text on the interactive interface, and the target entity information involved in the user question text is determined by performing entity recognition on the user question text.

[0044] In the case that the target entity information does not meet the entity requirements of the target task, the interaction information can be displayed to the user on the interaction interface.

[0045] After viewing the interactive information, the user can provide entity supplementary information for the interactive information on the interactive interface. Here, the entity supplementary information can be the answer to the question given by the user.

[0046] Afterwards, the user's entity supplementary information for the interactive information is received, and the supplementary information and the target entity information are used to determine the complete entity information required for the target task. Afterwards, the target task and the complete entity information are used to find the task answer in the data to be retrieved.

[0047] For example, the data to be retrieved is a summary table of work information of each employee of a company. The data to be retrieved is structured data, and includes multiple columns. The first column can be the name of each employee in the company, the second column can be the work number of each employee, the third column can be the overtime hours of each employee, and the fourth column can be the working years of each employee, etc.

[0048] If the target task is what employee A's work number is, then employee A's work number can be determined by looking up a table.

[0049] If the target task is how many overtime hours does employee A work, then since the entity requirements of the target task include A and a specific time point, interactive information can be sent to the user, and the interactive information can be to clarify which day employee A needs to know the overtime hours on. The user can provide entity supplementary information, which can be February 28, 2024. Furthermore, the complete entity information can be A and February 28, 2024. At this time, the overtime hours of employee A on February 28, 2024 can be determined by looking up a table.

[0050] In an embodiment of the present invention, when the user's question text is not clear enough or the information is incomplete, the system can actively interact with the user to obtain more useful information and avoid ambiguous answers. When faced with complex business or customized needs, the user's actual usage needs can also be met.

[0051] On the basis of the above embodiment, the search knowledge of each search task includes a search title and a search content; the data to be searched includes structured data and / or unstructured data; If there is unstructured data in the data to be retrieved, the retrieval content is the document knowledge of the unstructured data, and the retrieval title is the summary of the document knowledge; If there is structured data in the data to be retrieved, the retrieval title is the retrieval task name, and the retrieval content is the retrieval task question.

[0052] Specifically, the search knowledge of each search task may include a search title and a search content.

[0053] For structured data in the data to be retrieved, the retrieval title may be a retrieval task name, the retrieval content may be a retrieval task question, and each retrieval task may correspond to a retrieval task name and one or more retrieval task questions.

[0054] For unstructured data in the data to be retrieved, the retrieval content can be the document knowledge of the unstructured data, and the retrieval title can be a summary of the document knowledge. The summary can be generated by a large language model.

[0055] In the embodiment of the present invention, the retrieval knowledge of each retrieval task is subdivided into retrieval title and retrieval content, which can improve the calculation accuracy of semantic similarity and text similarity, simplify the calculation process, and reduce the calculation difficulty and amount.

[0056] On the basis of the above embodiment, the calculation of the semantic similarity and textual similarity between the user question text and the retrieval knowledge of each retrieval task corresponding to the data to be retrieved includes: Based on the semantic model, obtaining the semantic representation of the user question text and the retrieval knowledge of each retrieval task, and calculating the semantic similarity based on the semantic representation; Based on the keyword model, the keyword features of the user question text and the retrieval knowledge of each retrieval task are obtained, and based on the keyword features, the text similarity is calculated.

[0057] Specifically, when calculating the semantic similarity and textual similarity between the user question text and the retrieval knowledge of each retrieval task corresponding to the data to be retrieved, the semantic model can be used to obtain the semantic representation of the user question text and the retrieval knowledge of each retrieval task, respectively, and then the semantic similarity between the user question text and the retrieval knowledge of each retrieval task is calculated through the semantic representation of the user question text and the semantic representation of the retrieval knowledge of each retrieval task.

[0058] The keyword model can be used to obtain the keyword features of the user question text and the search knowledge of each search task, and then the text similarity between the user question text and the search knowledge of each search task is calculated through the keyword features of the user question text and the keyword features of the search knowledge of each search task. It can be understood that the semantic model and the keyword model can be trained neural network models or pre-trained models, which are not specifically limited here.

[0059] like Figure 2 As shown, based on the above embodiment, a multi-task hybrid retrieval enhancement generation question answering system is provided in an embodiment of the present invention, including: The question acquisition module 21 is used to obtain the user's question text; A score calculation module 22 is used to calculate the semantic similarity and text similarity between the user question text and the retrieval knowledge of each retrieval task corresponding to the data to be retrieved, and calculate the retrieval score of the retrieval knowledge of each retrieval task based on the semantic similarity and the text similarity; The task identification module 23 is used to convert the search scores of the search knowledge of each search task into the score probability of each search task, and determine the cumulative probability of each search task in descending order of the score probability of each search task, and identify the target task involved in the user question text based on the cumulative probability of each search task; The answering module 24 is used to determine the task answer corresponding to the user question text in the data to be retrieved according to the task requirements of the target task, and to construct prompt information based on the retrieval knowledge of the target task and the task answer to guide the large language model to answer the user question text.

[0060] Based on the above embodiment, the task identification module is specifically used for: Determine the specified tasks whose cumulative probability is greater than the set threshold for the first time; Other tasks having a higher score probability than the designated task are used as the target tasks.

[0061] Based on the above embodiment, the task requirement of the target task is a physical requirement; The answering module is specifically used for: Performing entity recognition on the user question text to determine target entity information involved in the user question text; If the target entity information does not meet the entity requirement, sending interaction information to the user, receiving entity supplementary information from the user in response to the interaction information, and determining complete entity information based on the supplementary information and the target entity information; Based on the target task, the complete entity information is applied to search for the task answer in the data to be retrieved.

[0062] Based on the above embodiment, the task identification module is specifically used for: Based on the softmax activation function, the retrieval scores of the retrieval knowledge of each retrieval task are converted into score probabilities of each retrieval task.

[0063] On the basis of the above embodiment, the search knowledge of each search task includes a search title and a search content; the data to be searched includes structured data and / or unstructured data; If there is unstructured data in the data to be retrieved, the retrieval content is the document knowledge of the unstructured data, and the retrieval title is the summary of the document knowledge; If there is structured data in the data to be retrieved, the retrieval title is the retrieval task name, and the retrieval content is the retrieval task question.

[0064] Based on the above embodiment, the retrieval task corresponding to the unstructured data includes one; The structured data includes multiple retrieval tasks corresponding to the structured data, and the multiple retrieval tasks corresponding to the structured data are obtained based on entity extraction from the structured data.

[0065] Based on the above embodiment, the score calculation module is specifically used for: Based on the semantic model, obtaining the semantic representation of the user question text and the retrieval knowledge of each retrieval task, and calculating the semantic similarity based on the semantic representation; Based on the keyword model, the keyword features of the user question text and the retrieval knowledge of each retrieval task are obtained, and based on the keyword features, the text similarity is calculated.

[0066] Specifically, the functions of each module in the multi-task hybrid retrieval enhanced question-answering system provided in the embodiment of the present invention correspond one-to-one to the operational procedures of each step in the above-mentioned method embodiment, and the effects achieved are also consistent. Please refer to the above-mentioned embodiment for details, and no further details will be given in the embodiment of the present invention.

[0067] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the multi-task hybrid retrieval enhancement generation question answering method provided in the above embodiments.

[0068] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0069] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the multi-task hybrid retrieval enhanced question and answer generation method provided in the above embodiments.

[0070] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the multi-task hybrid retrieval enhanced question and answer generation method provided in the above embodiments.

[0071] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0072] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.

[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A multi-task hybrid retrieval-enhanced generation question-answering method, characterized in that: include: Get the user question text; Calculating the semantic similarity and textual similarity between the user question text and the retrieval knowledge of each retrieval task corresponding to the data to be retrieved, and calculating the retrieval score of the retrieval knowledge of each retrieval task based on the semantic similarity and the textual similarity; Converting the retrieval scores of the retrieval knowledge of each retrieval task into the score probabilities of each retrieval task, and determining the cumulative probabilities of each retrieval task in descending order of the score probabilities of each retrieval task, and identifying the target task involved in the user question text based on the cumulative probabilities of each retrieval task; According to the task requirements of the target task, the task answer corresponding to the user question text is determined in the data to be retrieved, and based on the retrieval knowledge of the target task and the task answer, prompt information is constructed to guide the large language model to answer the user question text.

2. The multi-task hybrid retrieval-enhanced question-answering method according to claim 1, characterized in that: The step of identifying the target task involved in the user question text based on the cumulative probability of each retrieval task includes: Determine the specified tasks whose cumulative probability is greater than the set threshold for the first time; Other tasks having a higher score probability than the designated task are used as the target tasks.

3. The multi-task hybrid retrieval-enhanced question-answering method according to claim 1, characterized in that: The task requirements of the target task are entity requirements; The step of determining the task answer corresponding to the user question text in the to-be-retrieved data according to the task requirements of the target task includes: Performing entity recognition on the user question text to determine target entity information involved in the user question text; If the target entity information does not meet the entity requirement, sending interaction information to the user, receiving entity supplementary information from the user in response to the interaction information, and determining complete entity information based on the supplementary information and the target entity information; Based on the target task, the complete entity information is applied to search for the task answer in the data to be retrieved.

4. The multi-task hybrid retrieval-enhanced question-answering method according to claim 1, characterized in that: The converting the retrieval scores of the retrieval knowledge of each retrieval task into the score probabilities of each retrieval task includes: Based on the softmax activation function, the retrieval scores of the retrieval knowledge of each retrieval task are converted into score probabilities of each retrieval task.

5. The multi-task hybrid retrieval-enhanced question-answering method according to any one of claims 1 to 4, characterized in that: The retrieval knowledge of each retrieval task includes a retrieval title and a retrieval content; the data to be retrieved includes structured data and / or unstructured data; If there is unstructured data in the data to be retrieved, the retrieval content is the document knowledge of the unstructured data, and the retrieval title is the summary of the document knowledge; If there is structured data in the data to be retrieved, the retrieval title is the retrieval task name, and the retrieval content is the retrieval task question.

6. The multi-task hybrid retrieval-enhanced question-answering method according to claim 5, characterized in that: The retrieval task corresponding to the unstructured data includes one; The structured data includes multiple retrieval tasks corresponding to the structured data, and the multiple retrieval tasks corresponding to the structured data are obtained based on entity extraction from the structured data.

7. The multi-task hybrid retrieval-enhanced question-answering method according to any one of claims 1 to 4, characterized in that: The calculating of the semantic similarity and textual similarity between the user question text and the retrieval knowledge of each retrieval task corresponding to the data to be retrieved includes: Based on the semantic model, obtaining the semantic representation of the user question text and the retrieval knowledge of each retrieval task, and calculating the semantic similarity based on the semantic representation; Based on the keyword model, the keyword features of the user question text and the retrieval knowledge of each retrieval task are obtained, and based on the keyword features, the text similarity is calculated.

8. A multi-task hybrid retrieval-enhanced generation question-answering system, characterized in that: include: Question acquisition module, used to obtain user question text; A score calculation module, used to calculate the semantic similarity and text similarity between the user question text and the retrieval knowledge of each retrieval task corresponding to the data to be retrieved, and calculate the retrieval score of the retrieval knowledge of each retrieval task based on the semantic similarity and the text similarity; A task identification module, used to convert the retrieval scores of the retrieval knowledge of each retrieval task into the score probability of each retrieval task, and determine the cumulative probability of each retrieval task in descending order of the score probability of each retrieval task, and identify the target task involved in the user question text based on the cumulative probability of each retrieval task; The answering module is used to determine the task answer corresponding to the user question text in the data to be retrieved according to the task requirements of the target task, and to construct prompt information based on the retrieval knowledge of the target task and the task answer to guide the large language model to answer the user question text.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the multi-task hybrid retrieval enhancement generation question and answer method as described in any one of claims 1-7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the multi-task hybrid retrieval enhancement generation question answering method as described in any one of claims 1 to 7 is implemented.