Question answering reply method, apparatus, device, storage medium and program product

CN122925531APending Publication Date: 2026-10-16BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510429533.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

然而,该方式仅根据chunk确定回复结果,降低了回复结果的全面性和准确性

Benefits of technology

[0023] The question-and-answer response method, apparatus, computer-readable storage medium, and computer program product provided in this application embodiment can determine the target text block most relevant to the query statement whenever a user's query statement is obtained, obtain the document information of the target document containing the target text block, obtain the summary information of the target document based on the document information, and then generate a response result for the query statement based on the target text block and the summary information of the document containing the target text block. It can be understood that, compared with the response results of the question-and-answer system in the prior art which are generated only based on the target text block most relevant to the user's query statement, in this application embodiment, the response result can be generated based on the target text block and the summary information. In this way, the content of the response result can be made richer, and the comprehensiveness and accuracy of the response result can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122925531A_ABST
    Figure CN122925531A_ABST
Patent Text Reader

Abstract

The application provides a query response method and device, a computer readable storage medium and a computer program product. The method comprises the following steps: obtaining a query statement; determining a target text block most relevant to the query statement from a knowledge base; obtaining document information of a target document in which the target text block is located; obtaining summary information of the target document according to the document information of the target document; and generating a response result of the query statement according to the target text block and the summary information of the target document. It can be seen that the response result of the query statement is generated according to the target text block and the summary information of the target document in which the target text block is located, so that the comprehensiveness and accuracy of the response result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and in particular to a question-and-answer response method, apparatus, computer-readable storage medium, and computer program product. Background Technology

[0002] In recent years, research on question-answering systems has gradually emerged to meet users' needs for quick and accurate information retrieval. Retriever-Augmented Generation (RAG) systems are a type of question-answering system. Existing RAG systems typically segment documents into multiple text chunks, then calculate the relevance of each chunk based on the user's query, determining the response result only based on the most relevant chunk. However, this approach, which determines the response result solely based on chunks, reduces the comprehensiveness and accuracy of the response. Summary of the Invention

[0003] This application provides a question-and-answer response method, apparatus, computer-readable storage medium, and computer program product, which can improve the comprehensiveness and accuracy of the response results.

[0004] The technical solution of this application embodiment is implemented as follows:

[0005] This application provides a question-and-answer method, the method including:

[0006] Retrieve the query statement;

[0007] Identify the target text block most relevant to the query statement from the knowledge base;

[0008] Obtain the document information of the target document containing the target text block;

[0009] Based on the document information of the target document, obtain the summary information of the target document;

[0010] The response result for the query statement is generated based on the target text block and the summary information of the target document.

[0011] This application embodiment also provides a question-and-answer response device, the question-and-answer response device comprising:

[0012] The first acquisition module is used to acquire the query statement;

[0013] The determination module is used to determine the target text block most relevant to the query statement from the knowledge base;

[0014] The second acquisition module is used to acquire document information of the target document where the target text block is located;

[0015] The third acquisition module is used to acquire the summary information of the target document based on the document information of the target document;

[0016] The response generation module is used to generate a response result for the query statement based on the target text block and the summary information of the target document.

[0017] This application embodiment also provides a question-and-answer response device, the question-and-answer response device comprising:

[0018] Memory is used to store executable instructions for a computer;

[0019] A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the question-and-answer method as described in any of the preceding claims.

[0020] This application also provides a computer-readable storage medium storing computer-executable instructions or computer programs, which, when executed by a processor, implement the question-and-answer method as described in any of the preceding claims.

[0021] This application also provides a computer program product, including computer-executable instructions or a computer program, which, when executed by a processor, can implement the question-and-answer method as described in any of the preceding claims.

[0022] The embodiments of this application have the following beneficial effects:

[0023] The question-and-answer response method, apparatus, computer-readable storage medium, and computer program product provided in this application embodiment can determine the target text block most relevant to the query statement whenever a user's query statement is obtained, obtain the document information of the target document containing the target text block, obtain the summary information of the target document based on the document information, and then generate a response result for the query statement based on the target text block and the summary information of the document containing the target text block. It can be understood that, compared with the response results of the question-and-answer system in the prior art which are generated only based on the target text block most relevant to the user's query statement, in this application embodiment, the response result can be generated based on the target text block and the summary information. In this way, the content of the response result can be made richer, and the comprehensiveness and accuracy of the response result can be improved. Attached Figure Description

[0024] Figure 1 A flowchart illustrating a question-and-answer response method provided in an embodiment of this application;

[0025] Figure 2 A flowchart illustrating another question-and-answer method provided in an embodiment of this application;

[0026] Figure 3 This is a schematic diagram of the question-and-answer response device provided in the embodiments of this application;

[0027] Figure 4 This is a schematic diagram of the question-and-answer response device provided in an embodiment of this application. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0029] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0030] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0031] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for descriptive purposes only and is not intended to limit the scope of this application.

[0032] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0033] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0034] 1) query: The query or instruction submitted by the user to the large model, such as "Where is the capital of XX?" or "Give me a brief introduction to the history of XX".

[0035] 2) Response: The large model generates the response content based on the user query, that is, the response result to the user query.

[0036] 3) RAG: A technical framework that combines information retrieval and generative models. RAG uses information retrieval systems to extract content related to the user's query from external knowledge bases or documents and provides it as context to the generative big model to improve the accuracy, relevance and knowledge coverage of the generated response.

[0037] 4) Chunk: In the RAG system, a chunk refers to a small block of text or a fragment of data that has been divided into smaller segments. The purpose of a chunk is to divide long texts or large-scale documents into smaller, more easily processed units, making it easier for large models to retrieve, process, and generate data.

[0038] 5) obs: refers to the observations of the system or large model on the external environment, context or input data. In the RAG system, it represents the knowledge content provided by the information retrieval system to answer user queries.

[0039] In related technologies, RAG systems typically segment documents into multiple text chunks, then calculate the relevance of each chunk based on the user's query, determining the response result only based on the most relevant chunk. However, this method, which determines the response result based solely on chunks, reduces the comprehensiveness and accuracy of the response.

[0040] Based on the above technical problems, embodiments of this application provide a question-and-answer response method, apparatus, computer-readable storage medium, and computer program product.

[0041] Figure 1 This is a flowchart illustrating a question-and-answer method provided in an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:

[0042] S101. Obtain the query statement.

[0043] In this embodiment, the question-and-answer method can be applied to the RAG system; the query statement refers to the query statement entered by the user in the RAG system.

[0044] Here, there are no specific restrictions on the input format of the query statement. For example, it can be input in text form or in voice form. For example, the query statement can be the information entered by the user in text form, such as "Give me a brief introduction to the history of XX".

[0045] For example, after obtaining the user's input query, the query can be vectorized to obtain the corresponding feature vector. Vectorization is the process of converting non-numerical text data into numerical data, making the text data suitable for mathematical operations and model processing. Here, the specific method for implementing vectorization is not limited; for example, methods such as the bag-of-words model and word2vec can be used to implement vectorization.

[0046] S102. Identify the target text block most relevant to the query statement from the knowledge base.

[0047] For example, the knowledge base refers to an external knowledge base of the RAG system, which is used to assist the large model in the RAG system to generate more accurate and richer answer results.

[0048] The knowledge base can include a large amount of data such as documents, images, and audio. The documents in the knowledge base include various formats, which are not specifically limited here. For example, they can include documents in formats such as pdf, doc, and docx.

[0049] It should be noted that, in addition to storing documents in various formats, the knowledge base also stores text blocks of each document, as well as the feature vectors corresponding to each text block. Here, the text blocks of a document are obtained by breaking down the document using block segmentation techniques, and the feature vectors corresponding to the text blocks are obtained by vectorizing the text blocks.

[0050] In this embodiment of the application, after obtaining the feature vector corresponding to the query statement according to the above steps, the text blocks of the document in the knowledge base can be retrieved by vector retrieval or ES (Elasticsearch) retrieval based on the feature vector corresponding to the query statement to obtain the target text block most relevant to the query statement.

[0051] Furthermore, to ensure the integrity of the target text blocks, a query request corresponding to the query statement can be generated based on the above method. Based on the query request, information related to the query statement can be searched on the Internet. This information includes the Uniform Resource Locator (URL). Then, the text blocks of the knowledge base document are queried through the URL to obtain other target text blocks most relevant to the query statement. At this point, all target text blocks most relevant to the query statement can be obtained.

[0052] Here, the number of target text blocks can be one or more. If there are multiple target text blocks, these target text blocks can come from the same document or different documents. No specific limitation is made here.

[0053] For example, if there is only one target text block, the target text block can be used to construct obs for generating subsequent response results; if there are multiple target text blocks, the multiple target text blocks can be concatenated first, and the concatenated text blocks can be used to construct obs for generating subsequent response results.

[0054] For example, the most relevant target text block to the query statement can be obtained by: calculating the relevance between the query statement and text blocks of documents in the knowledge base, and determining the most relevant target text block to the query statement from the knowledge base based on the relevance.

[0055] For example, the most relevant target text block to the query statement can be determined as follows: based on a pre-set relevance threshold, all text blocks greater than the threshold are returned; in this case, the most relevant target text block to the query statement includes all text blocks greater than the threshold; or sorted according to relevance from high to low, and the top N text blocks are returned based on the relevance sorting result, where N is an integer greater than zero; in this case, the most relevant target text block to the query statement includes the top N text blocks.

[0056] S103. Obtain the document information of the target document where the target text block is located.

[0057] The target document containing the target text block is located in the knowledge base; the document information includes the document type, which can characterize whether the corresponding document is suitable for summary generation; that is, the document information of the target document can characterize whether the corresponding target document is suitable for summary generation.

[0058] For example, document types may include the following five types: timeline summary type, comparative analysis type, list and ranking type, plan or step type, and other document types; for ease of understanding, these five document types will be explained below.

[0059] Here, the timeline type refers to a document that details the background and development of events, with relatively complete information but from scattered sources. Examples include "Important Policies of the XX Dynasty" or "Key Milestones in the Development of Artificial Intelligence." The comparative analysis type refers to a document that provides comparisons or evaluations of multiple things, requiring integration to form a conclusion. Examples include "Which is better, XX mobile phone or XX mobile phone?" or "Analysis of the most popular programming languages ​​in XX year." The list and ranking type refers to a document containing rankings or category lists, requiring integration into a comprehensive summary. An example is "Market Value of the Top Ten Global Technology Companies." The solution or step type refers to a document describing multiple steps or solutions, requiring integration into a clear execution plan. Examples include "How to Apply for Graduate Studies at XX University" or "The Process of Developing a Financial Budget." Other types refer to document types other than the four mentioned above.

[0060] It should be noted that when a document's document type is any of the first four types (i.e., timeline summary, comparative analysis, list and ranking of items, or plan or step type), the document is suitable for summary generation; conversely, when a document's document type is any other type, the document is not suitable for summary generation.

[0061] In this embodiment of the application, before obtaining the document information of the target document containing the target text block, the following operations can be performed: at each preset time point, the first large model is used to perform real-time analysis on the historical documents retrieved within the historical time period in the knowledge base to obtain a first document information subset; the historical time period is the time period between the previous preset time point and the current preset time point; the first document information subset includes the document information of the retrieved historical documents; the first large model is used to perform delayed analysis on other documents in the knowledge base other than the retrieved historical documents to obtain a second document information subset; the second document information subset includes the document information of other documents.

[0062] For example, the first large model is a large model for document analysis that is fine-tuned from an existing large model using a type training dataset; the type of the first large model can be a large language model (LLM) or other types of large models, which is not limited here.

[0063] Here, there are no restrictions on how to obtain the type training dataset; for example, a large language model can be used to analyze a large number of documents (e.g., 30,000 documents) multiple times (e.g., 3 times), and then the three document types output by the model each time can be manually selected and labeled to obtain the type training dataset; then the existing large model can be fine-tuned using the type training dataset to obtain the first large model.

[0064] In this embodiment of the application, a first large model can be used to analyze the documents in the knowledge base to obtain a first document information subset and a second document information subset; the process of obtaining the first document information subset and the second document information subset is described below.

[0065] It should be noted that the processes involved in steps S101 and S102 above are all online processes, while the analysis process involved in this step and the summary generation process involved in subsequent steps are all offline processes.

[0066] Understandably, considering the need for rapid response to user queries and high-frequency documents, the first major model can be used to perform real-time analysis on historical documents retrieved within the historical time period in the knowledge base at each preset time point to obtain a first subset of document information.

[0067] Here, the preset time point can be set according to the actual situation, and there is no specific limitation here; for example, the preset time point can be 8:00, 12:00 or 20:00, etc.; the historical time period is the time period between the previous preset time point and the current preset time point; assuming the preset time point is 8:00, the historical time period can be 24 hours between 8:00 yesterday and 8:00 today; at this time, the first document information subset includes the document types of historical documents that have been retrieved in the past 24 hours.

[0068] Furthermore, after obtaining the first subset of document information, the first major model can be used to perform time-delay analysis on other documents in the knowledge base besides the historical documents that have been retrieved, to obtain the second subset of document information.

[0069] It should be noted that the document information set may include a first document information subset and a second document information subset, or it may only include the first document information subset. By determining the first document information subset, we can ensure the rapid response of high-frequency documents in the knowledge base. By determining the second document information subset, we can ensure the completeness of document type information in the knowledge base. The following explanation will take the example of a document information set including a first document information subset and a second document information subset.

[0070] In this embodiment, the first document information subset includes document information of historical documents retrieved within a historical time period, and this document information includes document type. The second document information subset includes document information of other documents in the knowledge base besides historical documents, and this document information includes document type. The document type characterizes whether the corresponding document is suitable for summary generation.

[0071] In some embodiments, obtaining the document information of the target document containing the target text block may include: obtaining the document information of the target document containing the target text block from a document information set.

[0072] In this embodiment of the application, after obtaining the document information set according to the above steps, the document information of the target document where the target text block is located can be obtained from the document information set, and then it can be determined whether it is suitable for summary generation based on the document information.

[0073] As can be seen, in this embodiment of the application, a large model is used to analyze the documents in the knowledge base before generating the summary to determine whether they are suitable for summary generation. This can improve the accuracy of the RAG system's answers and avoid the time-consuming problem of generating a summary for the entire knowledge base.

[0074] S104. Obtain the summary information of the target document based on the document information of the target document.

[0075] In this embodiment of the application, after obtaining the document information of the target document containing the target text block from the document information set, the summary information of the target document can be obtained based on the document information.

[0076] In some embodiments, obtaining summary information of a target document based on the document information of the target document may include: obtaining summary information of the target document from a summary information set based on the document information of the target document.

[0077] The summary information set is generated by summarizing the document information of documents in the knowledge base; the summary information set may include the summary information of documents in the knowledge base; here, the documents in the knowledge base may be some documents in the knowledge base or all documents in the knowledge base, without specific limitation.

[0078] To facilitate understanding, the process of obtaining the summary information set will be illustrated below based on the document information set.

[0079] For example, after obtaining the document information set, the following operations can be performed first: based on the document types of the historical documents retrieved in the first document information subset, determine documents suitable for summary generation from the retrieved historical documents; use the second large model to generate summaries for the documents suitable for summary generation in the retrieved historical documents, thus obtaining the first summary information subset; based on the document types of other documents in the second document information subset, determine documents suitable for summary generation from the other documents; use the second large model to generate summaries for the documents suitable for summary generation in the other documents, thus obtaining the second summary information subset.

[0080] The summary information set may include only the first summary information subset, or it may include both the first summary information subset and the second summary information subset.

[0081] For example, the second large model is a large model for summarization generation that is fine-tuned from an existing large model using a summary training dataset; the type of the second large model can be LLM or other types of large models, which is not limited here.

[0082] Here, there are no restrictions on how to obtain the summary training dataset; for example, a large language model can be used to generate summaries multiple times (e.g., 3 times) for a large number of documents (e.g., 30,000 documents), and then the 3 summaries output by the model each time can be manually selected and labeled to obtain the summary training dataset; then the existing large model can be fine-tuned using the summary training dataset to obtain the second large model.

[0083] In this embodiment of the application, if the document information set includes a first document information subset and a second document information subset, after obtaining the first document information subset, the documents suitable for summary generation among the retrieved historical documents can be determined based on the document types of the retrieved historical documents in the first document information subset; then, the second large model is used to generate summaries for the documents suitable for summary generation among the retrieved historical documents to obtain the first summary information subset; similarly, after obtaining the second document information subset, the documents suitable for summary generation among the other documents can be determined based on the document types of the other documents in the second document information subset; then, the second large model is used to generate summaries for the documents suitable for summary generation among the other documents to obtain the second summary information subset.

[0084] It should be noted that if the document information set includes a first document information subset and a second document information subset, then the summary information set includes a first summary information subset and a second summary information subset; the first summary information subset includes summary information corresponding to documents suitable for summary generation among the retrieved historical documents; the second summary information subset includes summary information corresponding to documents suitable for summary generation among other documents.

[0085] It should be noted that if the document information set only includes the first document information subset, then the summary information set only includes the first summary information subset; the corresponding determination process is similar to the above process, and will not be repeated here to avoid repetition.

[0086] For example, obtaining the summary information of the target document from the summary information set based on the document information of the target document may include: determining whether the target document is suitable for summary generation based on the document type of the target document; and obtaining the summary information of the target document from the summary information set when it is determined that the target document is suitable for summary generation.

[0087] In this embodiment of the application, the knowledge base includes the target document corresponding to the target text block most relevant to the query statement; after obtaining the document information of the target document containing the target text block from the document information set, it can be determined whether the target document is suitable for summary generation based on the document type of the target document; when it is determined that the target document is suitable for summary generation, the summary information of the target document can be directly obtained from the summary information set; otherwise, the summary information of the target document cannot be obtained.

[0088] In some embodiments, determining whether a target document is suitable for summary generation based on its document type may include: determining that the target document is suitable for summary generation when the document type of the target document is a preset document type; and determining that the target document is not suitable for summary generation when the document type of the target document is another document type.

[0089] Here, the preset document type can be any one of the following: timeline summary, comparative analysis, list and ranking of items, or plan or step type; other document types are document types other than the preset document types.

[0090] For example, if the document type of the target document is determined to be any one of the following: timeline analysis, comparative analysis, list and ranking of things, or plan or step type, then the target document is determined to be suitable for summary generation; otherwise, the target document is determined to be unsuitable for summary generation.

[0091] As can be seen, the embodiments of this application propose both real-time document analysis and summary generation mechanisms and delayed document analysis and summary generation mechanisms. This ensures rapid response to high-frequency documents while improving the coverage of historical documents.

[0092] S105. Generate the response results of the query statement based on the target text block and the summary information of the target document.

[0093] In this embodiment of the application, the response result refers to the response result corresponding to the query statement entered by the user; after generating the response result of the query statement based on the summary information of the target text block and the target document, the RAG system will output the response result.

[0094] Here, the output format of the response can be the same as the input format of the query statement, and there is no specific limitation. For example, if the query statement is a text input, the response can be output in text form; if the query statement is a voice input, and the response is text information, the response can be converted into voice information and output.

[0095] In some embodiments, generating a response to a query statement based on a target text block and a summary of a target document may include: concatenating the summary of the target document with the target text block to obtain concatenated text; and generating a response to the query statement based on the concatenated text.

[0096] For example, if the target document is determined to be suitable for summary generation, the summary information corresponding to the target document can be obtained from the summary information set, and the summary information can be concatenated with the target text block to obtain the concatenated text; then, the response result of the query statement can be generated based on the concatenated text; at this time, an obscuration object (OBS) can be constructed based on the concatenated text; the way to generate the response result can be: inputting the OBS constructed from the concatenated text into the large model to obtain the response result of the query statement; correspondingly, the format of the OBS constructed from the concatenated text can be represented as follows:

[0097] [Summary Information] {summary}

[0098] [Original excerpt] {chunk}

[0099] Here, "original text fragment" refers to the target text block.

[0100] For example, if it is determined that the target document is not suitable for summary generation, it means that the summary information set does not include the summary information corresponding to the target document. In this case, the response result of the query can be generated directly based on the target text block; in this case, the obs can be constructed directly based on the target text block; the way to generate the response result is to input the obs constructed from the target text block into the large model to obtain the response result of the query; correspondingly, the format of the obs constructed from the target text block can be represented as follows:

[0101] [Original excerpt] {chunk}

[0102] Here, "original text fragment" refers to the target text block.

[0103] Understandably, by generating document summaries, the embodiments of this application can provide global information that cannot be included in the target text block, such as the background of an event and comparative analysis of things, so that the RAG system can better answer the user's query based on the document summary and improve the comprehensiveness and accuracy of the response results.

[0104] To better illustrate the purpose of this application, further examples are provided based on the above embodiments.

[0105] For example, Figure 2 A flowchart illustrating another question-and-answer method provided in this application embodiment is shown below. Figure 2 As shown, the method includes: an online processing flow and an offline processing flow, wherein the online processing flow includes: obtaining the user's input query statement (corresponding to...) Figure 2 After the query statement is defined, it can be vectorized to obtain the corresponding feature vector. Figure 2 The process involves several steps: first, using the feature vector corresponding to the query statement; then, vector retrieval or Elasticsearch (ES) retrieval of the target text blocks in the knowledge base documents based on the feature vector corresponding to the query statement to obtain the target text blocks most relevant to the query statement; second, a query request corresponding to the query statement can be generated, and based on this query request, information related to the query statement can be searched on the Internet. Then, the text blocks of the knowledge base documents can be queried using the URLs included in the information to obtain other target text blocks most relevant to the query statement. At this point, all target text blocks (corresponding to...) can be obtained. Figure 2 The process involves concatenating three target text blocks (chunk2, chunk3, and chunk4) into a single block. This concatenated text block can then be used to construct an obsolete object (OBS) for generating subsequent response results. The offline processing workflow includes using the first main model (corresponding to...). Figure 2Analysis LLM (or similar tools) analyzes documents in a knowledge base to obtain a document information set (corresponding to...) Figure 2 (docinfo in the middle); using the second largest model (corresponding to Figure 2 Summary LLM (in this context) generates summaries from documents in the knowledge base that are suitable for summarization, resulting in a summary information set (corresponding to...). Figure 2 The summary is used to construct the obs. The construction method of the obs is determined based on the document information set and the summary information set. Subsequently, based on the document information of the target document where each target text block is located, it can be determined whether each target document is suitable for generating a summary. If so, the summary information of each target document is obtained, and the summary information of each target document and the concatenated text block are concatenated to construct the final obs for generating subsequent response results. The corresponding generation process has been described in the above embodiments, and will not be repeated here to avoid repetition.

[0106] It should be noted that the offline processing flow refers to the document analysis and summary generation process, which can include real-time processing and delayed processing. The real-time processing involves: at each preset time point, using a first-large model to perform real-time analysis on historical documents retrieved within a historical time period in the knowledge base, obtaining a first subset of document information; based on the first subset of document information, determining documents suitable for summary generation from the retrieved historical documents; and using a second-large model to generate summaries from the suitable documents in the retrieved historical documents, obtaining a first subset of summary information. The delayed processing involves: using the first-large model to perform delayed analysis on other documents in the knowledge base besides the retrieved historical documents, obtaining a second subset of document information; based on the second subset of document information, determining documents suitable for summary generation from the other documents; and using the second-large model to generate summaries from the suitable documents in the other documents, obtaining a second subset of summary information. These processing steps have been described in the above embodiments and will not be repeated here to avoid repetition. Figure 2 The summary library in the knowledge base is an abstract concept used to describe how, if a summary is generated for a document, the corresponding summary information for that document will be stored in the knowledge base after the summary information for that document is generated.

[0107] As can be seen, in this embodiment, by generating summaries from documents in the knowledge base suitable for summarization, global information that cannot be encompassed by text blocks can be provided, such as the background of events and comparative analysis of things. Furthermore, this embodiment analyzes documents before summarization to determine their suitability, which improves the accuracy of the RAG system's responses and avoids the time-consuming problem of summarizing the entire knowledge base. Further, it provides both real-time and delayed processing mechanisms to ensure rapid response to high-frequency documents while improving the coverage of historical documents; the entire processing is automated, reducing manual intervention and improving system response speed and accuracy.

[0108] Based on the foregoing embodiments, this application also provides a question-and-answer response device. Figure 3 This is a schematic diagram of the question-and-answer response device provided in the embodiments of this application, as shown below. Figure 3 As shown, the question-and-answer response device 3 may include:

[0109] The first acquisition module 300 is used to acquire the query statement;

[0110] The determination module 301 is used to determine the target text block most relevant to the query statement from the knowledge base;

[0111] The second acquisition module 302 is used to acquire document information of the target document where the target text block is located;

[0112] The third acquisition module 303 is used to acquire the summary information of the target document based on the document information of the target document;

[0113] The response generation module 304 is used to generate response results for the query statement based on the target text block and the summary information of the target document.

[0114] In some embodiments, the above-described apparatus further includes an analysis module, which is configured to:

[0115] At each preset time point, the first major model is used to perform real-time analysis on the historical documents retrieved within the historical time period in the knowledge base to obtain the first document information subset; the historical time period is the time period between the previous preset time point and the current preset time point; the first document information subset includes the document information of the retrieved historical documents;

[0116] The first major model is used to perform time-delay analysis on documents in the knowledge base other than the retrieved historical documents to obtain the second document information subset; the second document information subset includes the document information of other documents;

[0117] The second acquisition module 302 is also used for:

[0118] Obtain the document information of the target document containing the target text block from the document information set; the document information set includes a first document information subset and a second document information subset.

[0119] In some embodiments, the third acquisition module 303 is further configured to:

[0120] Based on the document information of the target document, extract the summary information of the target document from the summary information set; the summary information set is generated by summarizing the document information of documents in the knowledge base.

[0121] In some embodiments, the document information includes a document type, which can characterize whether the corresponding document is suitable for summary generation. The third acquisition module 303 is further configured to:

[0122] Based on the document type of the target document, determine whether the target document is suitable for summary generation;

[0123] When a target document is determined to be suitable for summary generation, the summary information of the target document is obtained from the summary information set.

[0124] In some embodiments, the response generation module 304 is further configured to:

[0125] The summary information of the target document is concatenated with the target text block to obtain the concatenated text;

[0126] Generate the response results of the query statement based on the concatenated text.

[0127] In some embodiments, the response generation module 304 is further configured to:

[0128] When the target document's document type is a preset document type, determine that the target document is suitable for summary generation;

[0129] If the target document is of another document type, the target document is determined to be unsuitable for summary generation; other document types are document types other than the preset document types.

[0130] In some embodiments, the response generation module 304 is further configured to:

[0131] When it is determined that the target document is not suitable for summary generation, the response results of the query statement are generated based on the target text block.

[0132] In practical applications, the first acquisition module 300, the determination module 301, the second acquisition module 302, the third acquisition module 303, the response generation module 304, and the analysis module can all be implemented by a processor located in the question-and-answer response device. The processor can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor.

[0133] Based on the foregoing embodiments, this application also provides a question-and-answer response device. Figure 4 This is a schematic diagram of the structure of the question-and-answer response device provided in the embodiments of this application, such as... Figure 4 As shown, the question-and-answer response device 4 may include a processor 401 and a memory 402; wherein,

[0134] Memory 402 is used to store computer-executable instructions;

[0135] The processor 401, when executing computer-executable instructions or computer programs stored in the memory 402, implements a question-and-answer method as described above.

[0136] Based on the foregoing embodiments, this application also provides a computer-readable storage medium storing computer-executable instructions or computer programs, which, when executed by a processor, implement the question-and-answer method as described in any of the preceding embodiments.

[0137] Based on the foregoing embodiments, this application also provides a computer program product, including computer-executable instructions or a computer program, which, when executed by a processor, can implement the question-and-answer method as described in any of the preceding embodiments.

[0138] In some embodiments, the computer-readable storage medium may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it may be a device that includes one or any combination of the above-mentioned memories.

[0139] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0140] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

Claims

1. A question-and-answer method, characterized in that, The method includes: Retrieve the query statement; Identify the target text block most relevant to the query statement from the knowledge base; Obtain the document information of the target document containing the target text block; Based on the document information of the target document, obtain the summary information of the target document; The response result for the query statement is generated based on the target text block and the summary information of the target document.

2. The method according to claim 1, characterized in that, The method further includes: At each preset time point, the first large model is used to perform real-time analysis on the historical documents retrieved within the historical time period in the knowledge base to obtain a first document information subset; the historical time period is the time period between the previous preset time point and the current preset time point; the first document information subset includes the document information of the retrieved historical documents; The first large model is used to perform time-delay analysis on other documents in the knowledge base besides the retrieved historical documents to obtain a second document information subset; the second document information subset includes the document information of the other documents; The step of obtaining the document information of the target document containing the target text block includes: The document information of the target document containing the target text block is obtained from the document information set; the document information set includes the first document information subset and the second document information subset.

3. The method according to claim 1 or 2, characterized in that, The step of obtaining the summary information of the target document based on the document information of the target document includes: Based on the document information of the target document, the summary information of the target document is obtained from the summary information set; the summary information set is generated by summarizing the document information of the documents in the knowledge base.

4. The method according to claim 3, characterized in that, The document information includes a document type, which indicates whether the corresponding document is suitable for summary generation. The step of obtaining the summary information of the target document from the summary information set based on the document information of the target document includes: Based on the document type of the target document, determine whether the target document is suitable for summary generation; When it is determined that the target document is suitable for summary generation, the summary information of the target document is obtained from the summary information set.

5. The method according to any one of claims 1 to 4, characterized in that, The step of generating the response result for the query statement based on the summary information of the target text block and the target document includes: The summary information of the target document is concatenated with the target text block to obtain the concatenated text; The response result for the query statement is generated based on the concatenated text.

6. The method according to claim 4, characterized in that, The step of determining whether the target document is suitable for summary generation based on its document type includes: When the document type of the target document is a preset document type, the target document is determined to be suitable for summary generation; When the document type of the target document is other document types, it is determined that the target document is not suitable for summary generation; the other document types are document types other than the preset document types.

7. The method according to claim 4 or 6, characterized in that, The method further includes: When it is determined that the target document is not suitable for summary generation, the response result of the query statement is generated based on the target text block.

8. A question-and-answer response device, characterized in that, The question-and-answer response device includes: The first acquisition module is used to acquire the query statement; The determination module is used to determine the target text block most relevant to the query statement from the knowledge base; The second acquisition module is used to acquire document information of the target document where the target text block is located; The third acquisition module is used to acquire the summary information of the target document based on the document information of the target document; The response generation module is used to generate a response result for the query statement based on the target text block and the summary information of the target document.

9. A question-and-answer response device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the question-and-answer method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the question-and-answer method as described in any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the question-and-answer method according to any one of claims 1 to 7.