A retrieval enhancement processing method and system based on a large model

By adaptively parsing and segmenting knowledge documents, combined with multi-routing strategies for sparse and dense retrieval, the shortcomings of the RAG question-answering system in knowledge retrieval and recall are addressed, achieving higher accuracy in knowledge question answering and intelligent dialogue, especially in adaptive parsing and segmentation when handling documents of different formats.

CN120256648BActive Publication Date: 2025-11-14ASIAINFO TECH CHINA INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510719249.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-11-14
Estimated Expiration
2045-05-30

AI Technical Summary

Technical Problem

Existing RAG question-answering systems fail to comprehensively retrieve the corresponding knowledge points when users' questions are only partially expressed or involve detailed knowledge, resulting in knowledge retrieval failures and reducing the accuracy of knowledge-based question answering and intelligent dialogue.

Method used

A large-model-based retrieval enhancement processing method is adopted. Through adaptive parsing and segmentation of knowledge documents, combined with multi-routing strategies of sparse and dense retrieval, a fine ranking model is used to fine-rank the knowledge retrieval results, and the retrieval results are determined based on a preset sorting method, so as to realize multi-dimensional matching and secondary retrieval of user questions and knowledge blocks.

Benefits of technology

It improves the knowledge retrieval accuracy of the RAG question-answering system and enhances the accuracy of knowledge question answering and intelligent dialogue. In particular, when processing knowledge documents of different formats, it can achieve batch adaptive parsing and segmentation, thereby improving the knowledge recall effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256648B_ABST
    Figure CN120256648B_ABST
Patent Text Reader

Abstract

This application discloses a retrieval enhancement processing method and system based on a large model, relating to the field of artificial intelligence technology. When a user question is received, the method obtains the knowledge document corresponding to the user question, performs adaptive parsing and segmentation on the knowledge document to obtain the segmentation result, and performs retrieval and recall on the segmentation result based on a multi-route retrieval and recall strategy and the user question to obtain the knowledge recall result. The multi-route retrieval and recall strategy is determined by sparse retrieval and dense retrieval. The knowledge recall result is finely ranked based on a fine ranking model to obtain the fine ranking result, and the fine ranking result is sorted according to a preset ranking method to determine the retrieval result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and more specifically, to a retrieval enhancement processing method and system based on a large model. Background Technology

[0002] Retrieval Augmented Generation (RAG) question answering systems are knowledge-enhanced question answering systems that primarily answer information queries in specific knowledge domains or knowledge-based questions in open domains.

[0003] Existing RAG question-answering systems typically rely on database-based cosine similarity semantic retrieval and text content retrieval for knowledge retrieval. However, when user questions are presented in a limited way or involve specific knowledge details, simple text matching cannot comprehensively and multi-dimensionally retrieve the knowledge blocks containing the corresponding knowledge points. This leads to knowledge retrieval failures in RAG question-answering systems, thereby reducing the accuracy of knowledge-based question answering and intelligent dialogue content.

[0004] Therefore, how to improve the knowledge retrieval of the RAG question-answering system in order to improve the accuracy of the knowledge-based question answering and intelligent dialogue content of the RAG question-answering system is an urgent problem to be solved in this application. Summary of the Invention

[0005] In view of this, this application discloses a retrieval enhancement processing method and system based on a large model, which aims to improve the knowledge retrieval accuracy of the retrieval enhancement question-answering system, thereby improving the accuracy of the knowledge questions and answers and intelligent dialogue content of the retrieval enhancement question-answering system.

[0006] To achieve the above objectives, the disclosed technical solution is as follows:

[0007] The first aspect of this application discloses a retrieval enhancement processing method based on a large model, the method comprising:

[0008] When a user question is received, the corresponding knowledge document is retrieved.

[0009] The knowledge document is adaptively parsed and segmented to obtain the segmentation result;

[0010] Based on the multi-route retrieval and recall strategy and the user question, the segmentation results are retrieved and recalled to obtain knowledge retrieval results; wherein, the multi-route retrieval and recall strategy is determined by sparse retrieval and dense retrieval.

[0011] The knowledge retrieval results are then refined based on the refined ranking model to obtain the refined ranking results.

[0012] The refined ranking results are sorted according to a preset sorting method to determine the retrieval results.

[0013] Preferably, the adaptive parsing and segmentation of the knowledge document to obtain the segmentation result includes:

[0014] Identify the various feature types in the knowledge document;

[0015] Based on each feature type, the corresponding parsing method is invoked to perform adaptive knowledge corpus content parsing on the knowledge document, and the parsing result is obtained.

[0016] The parsing results are segmented into segments by combining hierarchical structure and linear character length segmentation.

[0017] Preferably, the step of segmenting the parsing result into a corpus using a combination of hierarchical structure and linear character length segmentation to obtain the segmentation result includes:

[0018] The parsing results are then segmented into text to obtain the content of each chapter; wherein, the chapter content includes at least the chapter length and the chapter text content;

[0019] The length of each chapter is determined from the content of each chapter;

[0020] If the length of consecutive chapters at the same level is less than or equal to a preset threshold, the content of consecutive chapters at the same level will be merged.

[0021] If the length of a single chapter is less than or equal to the preset threshold, the content of consecutive chapters at the same level will be merged.

[0022] If the length of a single chapter in each chapter exceeds the preset threshold, the threshold length of the next level directory of the current level chapter is judged until the length of a single chapter in the last level directory exceeds the preset threshold. Threshold segmentation is completed based on the line breaks and punctuation marks in the chapter content to complete the corpus segmentation of the parsing results and obtain the segmentation result.

[0023] Preferably, the step of performing retrieval and retrieval on the segmentation results based on the multi-route retrieval and retrieval strategy and the user question to obtain knowledge retrieval results includes:

[0024] Set the global cosine similarity threshold for knowledge search and the number of knowledge blocks to retrieve;

[0025] Extract keywords from the user's question;

[0026] The user question and the keywords are represented by vectors using an embedding model, resulting in a sparse vector of the search query, a dense vector of the search query, a sparse vector of the search keywords, and a dense vector of the search keywords.

[0027] The sparse vector of the retrieval query is retrievaled by an open-source vector database to obtain a first sparse vector corresponding knowledge block. Dense vector retrieval is performed on the dense vector of the retrieval query to obtain a first dense vector corresponding knowledge block. The first sparse vector corresponding knowledge block and the first dense vector corresponding knowledge block are deduplicated and merged to obtain a retrieval query matching knowledge block.

[0028] The sparse vector retrieval of the sparse vector of the search keyword is performed by an open-source vector database to obtain the second sparse vector corresponding knowledge block. The dense vector of the search keyword is then performed by a dense vector retrieval to obtain the second dense vector corresponding knowledge block. The second sparse vector corresponding knowledge block and the second dense vector corresponding knowledge block are deduplicated and merged to obtain the search keyword matching knowledge block.

[0029] The sparse vector of the retrieval query is used to perform sparse vector retrieval for knowledge generation problem matching in an open-source vector database to obtain the knowledge block corresponding to the third sparse vector. The dense vector of the retrieval query is used to perform dense vector retrieval for knowledge generation problem matching to obtain the knowledge block corresponding to the third dense vector. The knowledge block corresponding to the third sparse vector and the knowledge block corresponding to the third dense vector are then merged to obtain the knowledge block corresponding to the knowledge generation problem.

[0030] The sparse vector retrieval of the retrieval query is performed by summarizing the sparse vectors of the retrieval query to obtain the fourth sparse vector corresponding knowledge block. The dense vector retrieval of the retrieval query is performed by summarizing the dense vectors to obtain the fourth dense vector corresponding knowledge block. The fourth sparse vector corresponding knowledge block and the fourth dense vector corresponding knowledge block are deduplicated and merged to obtain the summarizing knowledge block.

[0031] The search query matching knowledge block, the search keyword matching knowledge block, the knowledge generation question matching knowledge block, and the summary matching knowledge block are scored and calculated using a multi-route search result formula to obtain a comprehensive score for all search results.

[0032] The knowledge recall results are obtained by scoring and filtering all search results based on the comprehensive score of the number of retrieved knowledge blocks and the global cosine similarity threshold of the knowledge search.

[0033] Preferably, the step of refining the knowledge recall results based on the fine-ranking model to obtain the fine-ranking results includes:

[0034] By using a fine-tuned ranking model based on data from the communications domain, semantic relevance scores are assigned to the knowledge blocks and user questions in the knowledge retrieval results to obtain individual semantic relevance scores. This completes the process of fine-ranking the knowledge retrieval results based on the fine-ranking model to obtain the fine-ranking results.

[0035] Preferably, the step of sorting the refined ranking results according to a preset sorting method to determine the search results includes:

[0036] The semantic relevance scores in the refined ranking results are sorted according to a preset sorting method to obtain the sorting results;

[0037] A preset number of knowledge blocks are extracted from the sorting results to determine the search results.

[0038] A second aspect of this application discloses a retrieval enhancement processing system based on a large model, the system comprising:

[0039] The acquisition unit is used to acquire the knowledge document corresponding to the user's question when a user's question is received.

[0040] The parsing and segmentation unit is used to adaptively parse and segment the knowledge document to obtain the segmentation result;

[0041] The recall unit is used to retrieve and recall the segmentation results based on the multi-route retrieval recall strategy and the user question to obtain knowledge recall results; wherein, the multi-route retrieval recall strategy is determined by sparse retrieval and dense retrieval.

[0042] The fine-ranking unit is used to fine-rank the knowledge recall results based on the fine-ranking model to obtain the fine-ranking results.

[0043] The sorting unit is used to sort the refined sorting results according to a preset sorting method in order to determine the retrieval results.

[0044] Preferably, the parsing and segmentation unit includes:

[0045] The identification module is used to identify the various feature types in the knowledge document;

[0046] The parsing module is used to call the corresponding parsing method according to each feature type, perform adaptive knowledge corpus content parsing on the knowledge document, and obtain the parsing result;

[0047] The segmentation module is used to segment the parsing results into segments by combining hierarchical structure and linear segmentation based on character length.

[0048] Preferably, the segmentation module includes:

[0049] The first molecular module is used to perform text segmentation on the parsing results to obtain the content of each chapter; wherein, the chapter content includes at least the chapter length and the chapter text content;

[0050] A determination submodule is used to determine the length of each chapter from the content of each chapter;

[0051] The first merging submodule is used to merge the content of consecutive chapters with the same level of consecutive chapter lengths if the length of consecutive chapters with the same level of consecutive chapter lengths is less than or equal to a preset threshold.

[0052] The second merging submodule is used to merge the content of consecutive chapters at the same level if the length of a single chapter in each chapter is less than or equal to the preset threshold.

[0053] The second segmentation module is used to determine the threshold length of the next level directory of the current level directory if the length of a single chapter in each chapter is greater than the preset threshold, until the length of a single chapter in the last level directory is greater than the preset threshold. The threshold segmentation is completed based on the line breaks and punctuation marks in the chapter content, so as to complete the corpus segmentation of the parsing results and obtain the segmentation result.

[0054] Preferably, the recall unit includes:

[0055] The settings module is used to set the global cosine similarity threshold for knowledge search and the number of knowledge blocks to be retrieved.

[0056] The extraction module is used to extract keywords from the user's question;

[0057] The acquisition module is used to represent the user question and the keywords into vectors through an embedding model, and obtain the sparse vector of the search query, the dense vector of the search query, the sparse vector of the search keywords, and the dense vector of the search keywords.

[0058] The first retrieval processing module is used to perform sparse vector retrieval on the sparse vector of the retrieval query through an open-source vector database to obtain a knowledge block corresponding to the first sparse vector, perform dense vector retrieval on the dense vector of the retrieval query to obtain a knowledge block corresponding to the first dense vector, and merge the first knowledge block corresponding to the sparse vector and the first knowledge block corresponding to the dense vector after deduplication to obtain a retrieval query matching knowledge block.

[0059] The second retrieval processing module is used to perform sparse vector retrieval on the sparse vector of the retrieval keyword through an open-source vector database to obtain the knowledge block corresponding to the second sparse vector, perform dense vector retrieval on the dense vector of the retrieval keyword to obtain the knowledge block corresponding to the second dense vector, and merge the knowledge block corresponding to the second sparse vector and the knowledge block corresponding to the second dense vector after deduplication to obtain the retrieval keyword matching knowledge block.

[0060] The third retrieval processing module is used to perform sparse vector retrieval for knowledge generation problem matching on the sparse vector of the retrieval query through an open-source vector database to obtain the knowledge block corresponding to the third sparse vector; to perform dense vector retrieval for knowledge generation problem matching on the dense vector of the retrieval query to obtain the knowledge block corresponding to the third dense vector; and to merge the knowledge block corresponding to the third sparse vector and the knowledge block corresponding to the third dense vector to obtain the knowledge block matching the knowledge generation problem.

[0061] The fourth retrieval processing module is used to perform sparse vector retrieval by summarizing the sparse vector of the retrieval query through an open-source vector database to obtain the knowledge block corresponding to the fourth sparse vector; to perform dense vector retrieval by summarizing the dense vector of the retrieval query to obtain the knowledge block corresponding to the fourth dense vector; and to merge the knowledge block corresponding to the fourth sparse vector and the knowledge block corresponding to the fourth dense vector after deduplication to obtain the summarizing knowledge block.

[0062] The calculation module is used to score the search query matching knowledge block, the search keyword matching knowledge block, the knowledge generation question matching knowledge block, and the summary matching knowledge block using a multi-route search result formula, and to obtain a comprehensive score for all search results;

[0063] The scoring and filtering module is used to score and filter all search results based on the number of retrieved knowledge blocks and the global cosine similarity threshold of the knowledge search, so as to obtain knowledge recall results.

[0064] As can be seen from the above technical solution, this application discloses a retrieval enhancement processing method and system based on a large model. When a user question is received, the knowledge document corresponding to the user question is obtained, the knowledge document is adaptively parsed and segmented to obtain the segmentation result, and the segmentation result is retrieved based on a multi-route retrieval recall strategy and the user question to obtain the knowledge retrieval result. The multi-route retrieval recall strategy is determined by sparse retrieval and dense retrieval. The knowledge retrieval result is finely ranked based on a fine ranking model to obtain the fine ranking result, and the fine ranking result is sorted according to a preset sorting method to determine the retrieval result.

[0065] Through the above scheme, batch adaptive parsing and segmentation of a large number of knowledge documents of different formats can be achieved. For the segmented knowledge blocks in the segmentation results, a multi-route retrieval recall strategy based on hybrid retrieval is adopted. The multi-route retrieval recall strategy includes multiple recall dimensions such as knowledge matching, knowledge keyword matching, knowledge block generation question matching, and document summary matching. The multi-route retrieval recall strategy, which combines sparse retrieval and dense retrieval, is used to achieve knowledge matching, knowledge keyword matching, knowledge generation related question matching, and knowledge summary matching for user questions. The fine ranking model trained with communication domain data is used in conjunction with the fine ranking results obtained by the multi-route retrieval recall strategy. The fine ranking results are sorted according to a preset sorting method to determine the retrieval results, that is, the user questions and knowledge blocks are scored, and the highest-scoring results are returned. On the basis of the knowledge recall already achieved, a secondary retrieval of questions and knowledge blocks is performed based on the semantic model to further improve the knowledge retrieval accuracy of the retrieval-enhanced question-answering system, thereby improving the accuracy of the knowledge question-answering and intelligent dialogue content of the retrieval-enhanced question-answering system. Attached Figure Description

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

[0067] Figure 1 This is a flowchart illustrating a retrieval enhancement processing method based on a large model disclosed in an embodiment of this application;

[0068] Figure 2 This is a schematic diagram illustrating the adaptive parsing and segmentation of the knowledge documents disclosed in the embodiments of this application;

[0069] Figure 3 This is an example diagram illustrating the OCR layout analysis model disclosed in the embodiments of this application;

[0070] Figure 4 This is an example diagram illustrating the text, chapter, title, and table of contents segmentation methods disclosed in the embodiments of this application;

[0071] Figure 5 This is a flowchart of the RAG knowledge question-and-answer process disclosed in an embodiment of this application;

[0072] Figure 6 This is a schematic diagram of the structure of a large-model-based retrieval enhancement processing system disclosed in an embodiment of this application;

[0073] Figure 7 This is a schematic diagram of the structure of the electronic device disclosed in the embodiments of this application. Detailed Implementation

[0074] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0075] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0076] As the background technology shows, existing RAG question-answering systems typically rely on database-based cosine similarity semantic retrieval and text content retrieval for knowledge retrieval. However, when user questions are presented in a limited way or involve specific knowledge details, simple text matching cannot comprehensively retrieve the knowledge blocks containing the corresponding knowledge points. This leads to knowledge retrieval failures in RAG question-answering systems, thus reducing the accuracy of their knowledge-based question-answering and intelligent dialogue content. Therefore, improving knowledge retrieval in RAG question-answering systems to enhance the accuracy of their knowledge-based question-answering and intelligent dialogue content is a problem that this application urgently needs to solve.

[0077] To address the aforementioned issues, this application discloses a retrieval enhancement processing method and system based on a large model. For a large number of knowledge documents of different formats, it can achieve batch adaptive parsing and segmentation. For the segmented knowledge blocks in the segmentation results, a multi-route retrieval recall strategy based on hybrid retrieval is adopted. This strategy includes multiple recall dimensions such as knowledge matching, knowledge keyword matching, knowledge block generation question matching, and document summary matching. A multi-route retrieval recall strategy combining sparse and dense retrieval is used to achieve knowledge matching for user questions, knowledge keyword matching, knowledge generation related question matching, and knowledge summary matching. A fine-ranking model trained using communication domain data is used in conjunction with the fine-ranking results obtained from the multi-route retrieval recall strategy. These results are then sorted according to a preset ranking method to determine the retrieval results, i.e., scoring user questions and knowledge blocks, and returning the highest-scoring results. Based on the already achieved knowledge recall, a secondary retrieval of questions and knowledge blocks is performed based on a semantic model, further improving the knowledge retrieval accuracy of the retrieval enhancement question-answering system, thereby improving the accuracy of the knowledge question-answering and intelligent dialogue content of the retrieval enhancement question-answering system. The specific implementation is described in detail in the following embodiments.

[0078] The technical field of this application falls under the category of artificial intelligence, mainly involving technologies such as large models, machine learning, deep learning, and knowledge graphs. It can be used in scenarios such as intelligent dialogue and knowledge question answering in the customer service field to improve the accuracy of knowledge question answering and intelligent dialogue content.

[0079] refer to Figure 1 The image shows a retrieval enhancement processing method based on a large model disclosed in an embodiment of this application. This retrieval enhancement processing method based on a large model mainly includes the following steps:

[0080] S101: When a user question is received, retrieve the knowledge document corresponding to the user question.

[0081] The document formats of the knowledge documents corresponding to user questions include, but are not limited to, Portable Document Format (PDF), Word, Excel, TXT, HyperText Markup Language (HTML), CSV, PPT, MMD, TeX, JPG, PNG, etc.

[0082] S102: Perform adaptive parsing and segmentation on the knowledge document to obtain the segmentation result.

[0083] This solution supports input of corpora in different document formats and automatically identifies whether knowledge documents contain features such as chapters, titles, table of contents, images, paragraphs, tables, page numbers, and whether the document has source documents.

[0084] The specific process of adaptively parsing and segmenting the knowledge document to obtain the segmentation result is shown in A1-A3.

[0085] A1: Identify the various feature types in knowledge documents.

[0086] The feature types include chapter titles, table of contents, images, paragraphs, tables, page numbers, and documents.

[0087] A2: Based on each feature type, the corresponding parsing method is called to perform adaptive knowledge corpus content parsing on multiple documents of different format types to obtain the parsing results.

[0088] In A2, based on different feature classifications, corresponding information parsing methods are invoked, such as image optical character recognition (OCR) parsing, table structure parsing, paragraph content parsing, chapter title and table of contents parsing, header and footer parsing, etc., thereby cooperating with custom-defined and open-source document loading components such as AamPDFLoader and AamWordLoader to complete the content parsing of the knowledge corpus. This application does not specifically limit the type of document loading component.

[0089] A3: The parsing results are segmented into segments by combining hierarchical structure and linear segmentation based on character length.

[0090] In A3, automatic adaptation uses custom and open-source text segmentation components such as CharterTextSplitter, LineTextSplitter, and DocSeqTextSplitter to segment corpora. This application does not specifically limit the type of text segmentation component.

[0091] The automatic recognition effect of this solution has reached the level of human judgment to a certain extent, and it has been implemented in multiple field applications.

[0092] To facilitate understanding of the process of adaptive parsing and segmenting knowledge documents to obtain the segmentation results, we will combine... Figure 2 Please refer to B1-B5 for further explanation. Figure 2 This diagram illustrates the adaptive parsing and segmentation of knowledge documents.

[0093] In existing technologies, if the knowledge document is in PDF format, the PDF document parsing component AamPDFLoader uses an embedded OCR model to process image-based PDF files. However, general OCR models do not perform well in specific domains.

[0094] Therefore, this solution uses a large amount of on-site annotated corpus of communication domain knowledge (such as on-site management methods, operation manuals, business process diagrams, etc.) to complete the fine-tuning training of the OCR layout analysis model, which can recognize heading levels, images, tables, paragraph text, image titles, table titles, header and footer information, etc. in PDF documents in the communication domain.

[0095] Meanwhile, corresponding parsing methods are used for the identified feature types to extract text content while preserving the semantic structure information of each feature as much as possible, providing effective semantic guidance for subsequent knowledge corpus segmentation.

[0096] For details on the OCR layout analysis model's parsing process, please refer to [link / reference]. Figure 3 As shown.

[0097] Figure 3 In this process, the OCR layout analysis model is used to perform convolution on the knowledge document to obtain various feature types, such as document title, chapter title, text, image, table, page number, etc.

[0098] B1: Perform text segmentation on the parsed results to obtain the content of each chapter; the chapter content includes at least the chapter length and the chapter text content.

[0099] The `CharpterTextSplitter` component is a text segmentation component that combines hierarchical structure with linear character length segmentation to segment knowledge text according to chapters (levels 1-3), titles, and table of contents. To facilitate understanding of its process, we will combine... Figure 4 To explain, Figure 4 The diagram shows examples of how text, chapters, headings, and tables of contents are segmented.

[0100] Figure 4 In this process, knowledge text is segmented and title is segmented based on the hierarchical structure of the knowledge document.

[0101] B2: Determine the length of each chapter from the content of each chapter.

[0102] B3: If the length of consecutive chapters at the same level is less than or equal to the preset threshold (chunk_size), the content of consecutive chapters at the same level will be merged.

[0103] In B3, when the length of consecutive chapters at the same level is less than a preset threshold, the content of consecutive chapters is merged. When a single chapter is greater than the preset threshold, the next level of the current chapter is entered to judge the threshold length. This process continues until a single chapter in the last level of the directory is still greater than the preset threshold. Threshold segmentation is then performed sequentially based on line breaks, punctuation marks, etc., in the chapter text content. Otherwise (i.e., if the length of a single chapter in each chapter is less than or equal to the preset threshold), the content of consecutive chapters at the same level is merged directly.

[0104] This algorithm, which combines segmentation based on chapter title hierarchy and text character length, ensures the content independence and semantic integrity of individual knowledge text blocks while preserving the semantic connections between consecutive knowledge blocks within the same chapter. It not only guarantees high matching performance for single knowledge blocks addressing detailed knowledge points but also enhances the retrieval and matching capabilities for multiple knowledge blocks covering general summaries of entire chapters and paragraphs.

[0105] The preset threshold is set according to the actual situation, and this application does not impose specific limitations.

[0106] B4: If the length of a single chapter is less than or equal to a preset threshold, the content of consecutive chapters at the same level will be merged.

[0107] B5: If the length of a single chapter in each chapter exceeds the preset threshold, the threshold length is judged for the next level of the current chapter until the length of a single chapter in the last level exceeds the preset threshold. Threshold segmentation is completed based on the line breaks and punctuation marks in the chapter content to complete the corpus segmentation of the parsing results and obtain the segmentation results.

[0108] This solution not only achieves adaptive parsing and segmentation of the corpus, but also provides capabilities such as knowledge block keyword extraction, knowledge block related question generation, and document summary generation. This provides more tools and evidence for subsequent multi-dimensional knowledge retrieval and recall, improves the retrieval and recall effect, and thus enhances the question-answering accuracy of the entire RAG question-answering system.

[0109] RAG question answering systems primarily focus on improving the accuracy of knowledge question answering systems based on LLMs (Large-Scale Knowledge Models). Currently, research in this field mainly concentrates on the following aspects:

[0110] Optimizing retrieval algorithms: Knowledge block retrieval and recall based on knowledge databases is a key step in determining the effectiveness of cognitive enhancement. If database knowledge retrieval fails to effectively recall valid information, even if the semantic understanding and answer generation capabilities of the large model are excellent, they will not be fully utilized. Therefore, how to optimize retrieval algorithms and improve knowledge retrieval recall is an important research direction for improving the accuracy of RAG knowledge question answering systems.

[0111] Knowledge base management: The importance of knowledge base management is determined by the knowledge retrieval and recall based on the knowledge base. Once there are a large number of noisy corpus blocks in the knowledge base, it will greatly interfere with the efficiency and accuracy of knowledge retrieval and recall. However, by extracting and classifying the features of various types of knowledge in the knowledge base, and performing retrieval and recall based on the features, it will help reduce the interference of noisy knowledge and improve the accuracy of retrieval results.

[0112] Text Segmentation: The granularity of knowledge text segmentation has a significant impact on the matching of the embedding model. Generally, for knowledge documents with the same chapters and paragraphs, different granularity segments will result in different matching effects of the embedding model. In particular, for retrieval of detailed questions, finer granular segmentation is more likely to achieve accurate matching, while for retrieval of questions with a summary or generalization, larger granular segmentation blocks are more effective in explaining the question.

[0113] Knowledge graphs: Knowledge graphs are a structured way of representing knowledge that can provide rich background knowledge for question-answering systems. Currently, researchers are mainly exploring how to combine knowledge graphs with pre-trained models to improve the accuracy of question-answering systems.

[0114] Keyword extraction from knowledge texts:

[0115] In retrieval methods, text keyword retrieval can effectively supplement the results of text retrieval, highlighting key information in the user's question. For system efficiency considerations, this application compares open-source small-model and large-model keyword extraction schemes, ultimately selecting the more efficient open-source small-model jionlp.keyphrase.ChineseKeyPhrasesExtractor. Testing on public datasets shows that its extraction accuracy is 2 percentage points lower than the large model Qwen14b, but its extraction efficiency is 20 times higher. As one of the recall mechanisms for knowledge retrieval, it can completely replace the large model for knowledge text keyword extraction. The open-source embedding model bge-m3 is used to represent knowledge text keywords as vectors. The open-source databases used are ElsticSearch and Milvus. ElsticSearch is used to store the knowledge text (text) and knowledge keyword text (keywordtext); Milvus is used to store the knowledge vector (vector) and knowledge keyword vector (keywordvector).

[0116] Issues related to knowledge text generation:

[0117] During the retrieval phase, a series of possible questions are generated for each document. These questions are considered relevant to the document content and represent the potential questions that the document needs to answer. By matching user questions with relevant questions in these knowledge texts, the retrieval results can be enhanced.

[0118] For system efficiency considerations, this application uses communication domain data to fine-tune and train an open-source small model, doc2query, and compares its performance with the large model Qwen14B in generating relevant questions for knowledge text blocks. The fine-tuned open-source small model doc2query, when evaluated using field sample data, shows a lower performance (approximately 8 percentage points lower than the large model Qwen14B) in terms of the cosine similarity score between the extracted question and the user's question (a score above 90), but its extraction efficiency is more than 10 times higher. As one of the knowledge retrieval recall mechanisms, it can replace the large model for generating relevant questions for knowledge text. A separate table of relevant questions for knowledge blocks is used to store the relevant questions generated from the knowledge blocks. The open-source embedding model bge-m3 is used to represent the relevant questions as vectors. The ElsticSearch database is used to store the relevant question text (querytext), and Milvus is used to store the relevant question vectors (queryvector). The relevant question table and the knowledge block table are associated and mapped based on the knowledge block chunk_id.

[0119] Knowledge document summary generation:

[0120] This application uses a large model to generate full document summaries of knowledge documents, and uses the open-source embedding model bge-m3 to represent the document summaries as vectors. It uses the ElsticSearch database to store the document summary text (abstracttext) and Milvus to store the document summary vectors (abstractvector).

[0121] S103: Based on the multi-route retrieval strategy and user questions, the segmentation results are retrieved to obtain knowledge retrieval results; wherein, the multi-route retrieval strategy is determined by sparse retrieval and dense retrieval.

[0122] Among them, the multi-route retrieval recall strategy is a multi-route knowledge retrieval recall algorithm based on a combination of sparse retrieval and dense retrieval in hybrid retrieval. The specific algorithm principle steps are as follows (1) to (9):

[0123] (1) Set the default number of recall results for knowledge block vector similarity matching (similarity_topk), the default number of recall results for knowledge block text content word segmentation matching (docs_topk), the global cosine similarity threshold for knowledge search (similarity), and the number of knowledge blocks retrieved (topk).

[0124] (2) Extract keywords from user questions and use the embedding model bge-m3 to represent user questions and user question keywords as vectors. Output query, query vector, query keyword, and query keyword vector. Query keyword vector refers to the process of converting query keywords into vector representations.

[0125] The query vector includes the sparse vector of the retrieval query and the dense vector of the retrieval query.

[0126] The query keyword vector includes sparse vectors of the search keywords and dense vectors of the search keywords.

[0127] (3) Perform similarity search and text content search: Input the sparse vector and dense vector of the text into the Milvus database respectively, and perform sparse and dense vector retrieval on the user's question based on the Milvus database. The combination of the two vector retrieval results is shown in formula (1):

[0128] (1)

[0129] in, Score the vector; This is an overall adjustment factor used to adjust the scale of the final score; Weights for sparse vector retrieval; S represents the weight of dense vector retrieval; S represents the score of sparse vector retrieval results; and D represents the score of dense vector retrieval results.

[0130] In order from high to low, or from low to high, Sort the results and obtain the similarity_topk recalled knowledge blocks and their matching scores; use the distributed search and analysis engine (ElsticSearch) to search for the docs_topk recalled knowledge blocks and their matching scores by matching text content tokens with the docs_search inverted index.

[0131] (4) Filter the two recall results based on the similarity threshold, retain the knowledge blocks that meet the threshold requirements and return them.

[0132] To better understand the process of filtering the two recall results based on a similarity threshold, retaining the knowledge blocks that meet the threshold requirements, and returning them, an example is provided below:

[0133] For example, 1. Recall similarity_topk. Example of knowledge block: {'page_content': '2. Spring in Nature: The Awakening and Blooming of Life #2.1 Meteorological Changes: The Overture of Warmth and Vitality\nIn spring in nature, the temperature warms up and precipitation increases, playing the overture of the awakening of life.', 'page_keyword': 'Spring in Nature, Life, Awakening, Blooming, Meteorological Changes, Warmth, Vitality, Overture, Temperature Rise, Precipitation Increase, Playing','source': ' / work / tac-maas / file_loader / upload / corpus / xxxx / Poetic Picture of the Recovery of All Things in the Rhythm of Spring.docx', 'data_id': '5dYP0I0BRmlw0i2ZYPam','vector': [0.026929408311843872, 0.03982673957943916, -0.06498610973358154,..., 0.0076858592219650745, -0.01657874882221222],'similarity': 0.9125836};

[0134] 2. Recall docs_topk. Example of knowledge block: {'page_content': '2. Spring in Nature: The Awakening and Blooming of Life #2.1 Meteorological Changes: The Overture of Warmth and Vitality #2.1.1 Temperature Rise\nAs the direct point of the sun moves northward, the temperature gradually warms up. The average daily temperature rises from below zero or a low temperature in the cold winter to around 10°C - 20°C. The morning mist no longer condenses into frost but turns into gentle water vapor and dissipates in the sun, and the air is filled with a fresh and humid atmosphere, indicating that the earth is about to wake up.\n2. Spring in Nature: The Awakening and Blooming of Life #2.1 Meteorological Changes: The Overture of Warmth and Vitality #2.1.2 Precipitation Increase\nPrecipitation in spring...', 'page_keyword': 'xxxxx','source': ' / work / tac-maas / file_loader / upload / corpus / xxxx / Poetic Picture of the Recovery of All Things in the Rhythm of Spring.docx', 'data_id': 'zNYP0I0BRmlw0i2ZXvbw','score': 33.20973,'similarity': 0.9012284}.

[0135] 3. Filter according to the threshold: Filter out the knowledge blocks with'similarity' values greater than or equal to the similarity threshold similarity from each knowledge block recalled by the two paths and return them.

[0136] (5) Recall the multi-route process from (1) to (4) by matching knowledge text with multi-route problem text, matching knowledge keywords with problem keywords, generating related problems and problem matching summaries, etc.

[0137] Among them, multi-route question text matching knowledge text means matching question text with knowledge text, matching question keywords with knowledge keywords, matching question with knowledge blocks to generate related questions, and matching question with summaries, etc.

[0138] (6) For user questions, knowledge blocks are matched to generate related questions. The knowledge blocks corresponding to the route recall are obtained by associating and mapping the knowledge block related question table with the knowledge block table and the knowledge block chunk_id.

[0139] (7) For the results of the document summary retrieval for user questions, which are knowledge documents (in order to improve the retrieval efficiency, the number of knowledge documents retrieved is generally set to top 1), this scheme needs to perform a second retrieval and matching of user questions and knowledge within the scope of the knowledge documents retrieved this time, as the retrieval result under this route.

[0140] (8) The formula for the multi-route retrieval result is shown in formula (2):

[0141] (2)

[0142] in, The final score for the multi-route retrieval results; Scoring the results of matching question text with knowledge text; Scoring is given based on the results of matching knowledge keywords with question keywords; Match knowledge blocks to questions to generate relevant question scores; The results of matching the question summary are scored; , , and The weights for the corresponding retrieval methods; This is an overall adjustment factor used to adjust the overall score of all search results; It serves as a diversity moderating factor, used to enhance or reduce the differences between different search scores; A score is given for the diversity of each search score. The expression is shown in formula (3).

[0143] (3)

[0144] Where R is the number of retrieval routes; The score returned for each retrieval route.

[0145] (9) Perform fusion_ranked deduplication on the above multi-route retrieval results to obtain knowledge recall results.

[0146] Specifically, based on the multi-route retrieval and recall strategy and user questions, the process of retrieving and recalling the segmented results to obtain knowledge recall results is shown in C1-C7.

[0147] C1: Set the global cosine similarity threshold (similarity) for knowledge search and the number of knowledge blocks to retrieve (topk).

[0148] C2: Extract keywords from user questions.

[0149] C3: By embedding the user question and the keywords into vector representations, we obtain the sparse vector of the search query, the dense vector of the search query, the sparse vector of the search keywords, and the dense vector of the search keywords.

[0150] The execution process and execution principle of C3 are consistent with those of (2) above, and can be referred to. They will not be repeated here.

[0151] C4: Perform sparse vector retrieval on the sparse vector of the search query using the open-source vector database (Milvus) to obtain the knowledge block corresponding to the first sparse vector. Perform dense vector retrieval on the dense vector of the search query to obtain the knowledge block corresponding to the first dense vector. Then, merge the knowledge blocks corresponding to the first sparse vector and the knowledge blocks corresponding to the first dense vector after deduplication to obtain the knowledge block matching the search query.

[0152] In C4, the sparse vector and dense vector of the search query are respectively entered into the Milvus database. Based on the Milvus database, sparse and dense vector searches are performed on the user's question to obtain the knowledge block corresponding to the first dense vector and the knowledge block matching the search query.

[0153] To make it easier to understand, the process of fusion-ranking and deduplicating multi-route search results is illustrated with an example:

[0154] For example, the recall results for type 2 are as follows:

[0155] Data to be sorted:

[0156] Sorting 1: [a, b, c, d, e];

[0157] Sort 2: [c, b, a, d, f];

[0158] The scoring process defaults to k=60;

[0159] Sorting 1: a→1 / 60, b→1 / 61, c→1 / 62, d→1 / 63, e→1 / 64;

[0160] Sorting 2: c→1 / 60, b→1 / 61, a→1 / 62, d→1 / 63, f→1 / 64;

[0161] polymerization:

[0162] a = 1 / 60 + 1 / 62 = 61 / 1860;

[0163] b = 1 / 61 + 1 / 61 = 2 / 61;

[0164] c = 1 / 60 + 1 / 62 = 61 / 1860;

[0165] d = 1 / 63 + 1 / 63 = 2 / 63;

[0166] e = 1 / 64 = 0.015625;

[0167] f = 1 / 64 = 0.015625;

[0168] Right now,

[0169] a≈0.0327956;

[0170] b≈0.0327868;

[0171] c≈0.0327956;

[0172] d≈0.0317460;

[0173] e=0.015625;

[0174] f=0.015625;

[0175] Sorting results: a, c, b, d, e, f (when scores are the same, the result from sorting 1 is taken first).

[0176] C5: Perform sparse vector retrieval on the sparse vectors of the search keywords using an open-source vector database to obtain the second sparse vector corresponding knowledge block. Perform dense vector retrieval on the dense vectors of the search keywords to obtain the second dense vector corresponding knowledge block. Then, deduplicate and merge the second sparse vector corresponding knowledge block and the second dense vector corresponding knowledge block to obtain the search keyword matching knowledge block.

[0177] C6: By using an open-source vector database, sparse vector retrieval for knowledge generation problem matching is performed on the sparse vectors of the retrieval query to obtain the knowledge block corresponding to the third sparse vector. Dense vector retrieval for knowledge generation problem matching is performed on the dense vectors of the retrieval query to obtain the knowledge block corresponding to the third dense vector. The knowledge blocks corresponding to the third sparse vector and the knowledge blocks corresponding to the third dense vector are then merged to obtain the knowledge block corresponding to the knowledge generation problem.

[0178] C7: Sparse vector retrieval by summarizing the sparse vectors of the retrieval query using an open-source vector database to obtain the knowledge block corresponding to the fourth sparse vector. Dense vector retrieval by summarizing the dense vectors of the retrieval query to obtain the knowledge block corresponding to the fourth dense vector. The knowledge blocks corresponding to the fourth sparse vector and the knowledge blocks corresponding to the fourth dense vector are deduplicated and merged to obtain the summarizing knowledge block.

[0179] The execution process and execution principle of C4-C7 are consistent with the execution process and execution principle of (4) to (6) above, and can be referred to. They will not be repeated here.

[0180] C8: The multi-route retrieval result formula is used to score the knowledge blocks that match the retrieval query, the knowledge blocks that match the retrieval keywords, the knowledge blocks that match the knowledge generation question, and the knowledge blocks that match the summary, to obtain a comprehensive score for all retrieval results.

[0181] The execution process of C8 can be referred to the above multi-route retrieval result formula (2), which will not be repeated here.

[0182] C9: The comprehensive score of all search results is used to filter the results by retrieving the number of knowledge blocks and the global cosine similarity threshold of knowledge search, thus obtaining the knowledge recall results.

[0183] In C9, rating filtering refers to sorting the data in descending or ascending order and retrieving knowledge blocks that are multiples of the top_k number of retrieved knowledge blocks.

[0184] S104: Based on the fine ranking model, the knowledge recall results are finely ranked to obtain the fine ranking results.

[0185] In S104, a domain-customized info-reranker model, finely tuned from communication domain data, is used to score the semantic relevance of knowledge blocks and user questions in the knowledge retrieval results, obtaining various semantic relevance scores to complete the fine ranking process of the knowledge retrieval results.

[0186] Model fine-tuning is performed in the final stage of the retrieval process to merge and sort results from different retrieval systems, ensuring that documents most relevant to the user's question are ranked first. This solution uses an open-source info-reranker model fine-tuned with data from the communications domain. This info-reranker model scores the semantic relevance of knowledge blocks retrieved through multi-route recall to the user's question, sorts them from highest to lowest score, and returns the top_k knowledge blocks as results. Specifically... Figure 5 As shown. Figure 5 The flowchart of the RAG knowledge question and answer process is shown.

[0187] S105: Sort the results according to the preset sorting method to determine the search results.

[0188] In S105, the semantic relevance scores of each item in the ranking results are sorted according to the preset sorting method to obtain the ranking results. A preset number of knowledge blocks are extracted from the ranking results to determine the retrieval results.

[0189] The preset sorting method can be a high-to-low sorting method or a low-to-high sorting method. This application does not specifically limit the preset sorting method.

[0190] This solution enables batch adaptive parsing and segmentation of a large number of knowledge documents of different formats present at the customer's site. It employs an OCR model retrained with data from the communications domain to process images and image-centric PDF files. The method supports multi-route knowledge retrieval and recall, combining sparse and dense retrieval methods to achieve knowledge matching for user questions, knowledge keyword matching, knowledge generation-related question matching, and knowledge summary matching. Furthermore, this method uses a fine-ranking model trained with communications domain data, combined with multi-route retrieval and recall results, to score user questions and knowledge blocks, returning the highest-scoring results. Based on the already achieved knowledge recall, a secondary retrieval of questions and knowledge blocks is performed using a semantic model, further improving knowledge retrieval accuracy and thus enhancing the overall performance of RAG question answering.

[0191] This solution utilizes RAG retrieval enhancement technology based on a domain-specific ranking model and multi-route retrieval recall. It enables batch adaptive parsing and segmentation of a large number of knowledge documents in various formats. An OCR model retrained with communication domain data is used to process images and image-heavy PDF files. For the segmented knowledge blocks, a multi-route retrieval recall strategy based on hybrid retrieval is employed, including knowledge matching, knowledge keyword matching, knowledge block generation question matching, and document summary matching. Finally, the info-reranker model, finely tuned based on communication domain data, performs secondary ranking on the multi-route knowledge recall results. The results are sorted in descending order according to the model ranking score, and the top N results with the highest scores are used as the final retrieval results.

[0192] This solution addresses the following issues:

[0193] 1. Adaptive document parsing and segmentation: For knowledge documents of different formats, it automatically identifies document features such as chapter titles, images, tables, etc., and executes corresponding parsing and segmentation strategies to achieve automatic parsing and segmentation of various types of knowledge corpora.

[0194] 2. Domain-Specific Text Parsing Optimization: For documents in specific formats, such as images and PDF files, domain-specific OCR models are used to improve text parsing performance, especially in professional fields such as communications, to enhance the effectiveness of knowledge data entry and improve user experience.

[0195] 3. Multi-route retrieval and recall strategy: Construct a multi-route knowledge retrieval and recall strategy based on hybrid retrieval, combining text content matching and semantic matching, and adopting a combination of sparse retrieval and hybrid retrieval methods to improve the accuracy and comprehensiveness of retrieval and recall through multi-dimensional knowledge retrieval and recall.

[0196] 4. Multi-dimensional knowledge retrieval and recall: Incorporating multiple dimensions such as knowledge matching, keyword matching, question matching, and document summary matching into the retrieval and recall process ensures the completeness of the recall results.

[0197] 5. Model Re-ranking Strategy: Based on the industry's excellent long text and multilingual re-ranking models, we fine-tuned and developed an open-source info-reranker model for the communications field. This model performs secondary scoring and evaluation on the recall results to improve the accuracy of the final knowledge retrieval.

[0198] Key technological value points of this solution:

[0199] 1. Adaptive Document Parsing: This solution uses an innovative adaptive parsing strategy that can intelligently identify and process various document formats, including but not limited to PDF, Word, Excel and HTML documents, enhancing the flexibility and breadth of document parsing.

[0200] 2. Multi-feature recognition technology: By automatically recognizing features such as chapter titles, images, paragraphs, tables, page numbers, and document sources in a document, the patented solution improves the accuracy and depth of document processing.

[0201] 3. Customized OCR Model for the Communication Domain: Based on data from the communication domain, this OCR model is trained and exhibits higher parsing efficiency and accuracy when processing images and documents in the communication domain compared to traditional general OCR models.

[0202] 4. Customized parsing tools: The components AamPDFLoader, AamWordLoader, AamExcelLoader and AamHTMLLoader proposed in this application provide customized parsing tools for different types of documents, ensuring the efficiency and accuracy of the parsing process.

[0203] 5. Advanced text splitting components: The application of text splitting components such as CharterTextSplitter, LineTextSplitter, and DocSeqTextSplitter ensures the semantic integrity of the split text blocks and the logical coherence within the chapters.

[0204] 6. Hybrid Retrieval Algorithm: The patent implements a knowledge retrieval method based on a hybrid retrieval algorithm, which improves the effective recall rate of question-related knowledge blocks through multi-dimensional matching.

[0205] 7. Domain-Specific Question Rewriting Model: Based on data from the communications domain, a doc2query model is trained. This model is specifically designed to generate relevant questions from knowledge blocks, optimizing the knowledge generation and question matching process and improving the application value and efficiency in the communications domain.

[0206] 8. Domain-Customized Fine Ranking Model: The info-reranker model, which is based on fine-tuning data from the communication domain, is used for secondary fine ranking, further improving the accuracy and relevance of knowledge retrieval.

[0207] 9. Significantly improved recall: Through optimized retrieval methods, a significant improvement in recall was achieved, especially in the recall rates of top 1, top 5, and top 10, where quantitative improvements were made.

[0208] These value propositions demonstrate the significant contributions of this solution to technological innovation, efficiency improvement, accuracy enhancement, and user experience optimization, showcasing its clear market application potential and competitive advantages.

[0209] Key protection points of this solution:

[0210] 1. Customized OCR Solution for the Communications Domain: This solution proposes an OCR model specifically designed for the communications domain. This model, trained on communications-specific datasets, optimizes layout analysis and image parsing processes. Compared to traditional general-purpose OCR models, this model demonstrates higher parsing efficiency and accuracy when processing images and documents in the communications domain.

[0211] 2. Multi-dimensional Retrieval Technology: The patent includes a hybrid retrieval technology that combines sparse vector, dense vector, and text retrieval methods. This technology performs question retrieval from multiple dimensions, including knowledge text matching, keyword matching, question generation matching, and document summary matching, enabling parallel processing of retrieval tasks and improving the comprehensiveness and efficiency of the retrieval.

[0212] 3. Domain-Specific Question Rewriting Model: The patent includes a doc2query model trained on data from the communications domain. This model is specifically designed to generate relevant questions from knowledge blocks, optimizing the knowledge generation and question matching process and improving its application value and efficiency within the communications field.

[0213] 4. Domain-Specific Fine-Ranking Model: The patent covers an info-reranker model for fine-tuning data in the communications field. This model performs deep secondary fine-ranking of recall results, significantly improving the relevance and accuracy of search results and optimizing the user search experience.

[0214] It should be noted that all models, components, and tools in this solution are open source, allowing users to freely use, copy, modify, and distribute the software.

[0215] The beneficial effects of this application's embodiments are as follows: For a large number of knowledge documents of different formats, batch adaptive parsing and segmentation can be achieved. For the segmented knowledge blocks in the segmentation results, a multi-route retrieval recall strategy based on hybrid retrieval is adopted. The multi-route retrieval recall strategy includes multiple recall dimensions such as knowledge matching, knowledge keyword matching, knowledge block generation question matching, and document summary matching. The multi-route retrieval recall strategy, which combines sparse retrieval and dense retrieval, is used to achieve knowledge matching, knowledge keyword matching, knowledge generation related question matching, and knowledge summary matching for user questions. The fine ranking model trained with communication domain data is used in conjunction with the fine ranking results obtained by the multi-route retrieval recall strategy. The fine ranking results are sorted according to a preset sorting method to determine the retrieval results, that is, the user questions and knowledge blocks are scored, and the results with the highest scores are returned. On the basis of the already achieved knowledge recall, a secondary retrieval of questions and knowledge blocks is performed based on the semantic model, which further improves the knowledge retrieval accuracy of the retrieval-enhanced question-and-answer system, thereby improving the accuracy of the knowledge question-and-answer and intelligent dialogue content of the retrieval-enhanced question-and-answer system.

[0216] Based on the above embodiments Figure 1 This application discloses a retrieval enhancement processing method based on a large model, and also discloses a retrieval enhancement processing system based on a large model, such as... Figure 6 As shown, this large-model-based retrieval enhancement processing system includes:

[0217] The acquisition unit 601 is used to acquire the knowledge document corresponding to the user question when a user question is received;

[0218] The parsing and segmentation unit 602 is used to perform adaptive parsing and segmentation of knowledge documents to obtain segmentation results.

[0219] The recall unit 603 is used to retrieve and recall the segmentation results based on the multi-route retrieval recall strategy and user questions to obtain knowledge recall results; wherein, the multi-route retrieval recall strategy is determined by sparse retrieval and dense retrieval.

[0220] The fine-ranking unit 604 is used to fine-rank the knowledge recall results based on the fine-ranking model to obtain the fine-ranking results.

[0221] The sorting unit 605 is used to sort the fine sorting results according to a preset sorting method in order to determine the retrieval results.

[0222] Furthermore, the parsing segmentation unit 602 includes;

[0223] The recognition module is used to identify various feature types in knowledge documents;

[0224] The parsing module is used to call the corresponding parsing method according to each feature type, perform adaptive parsing of the knowledge corpus content of the knowledge document, and obtain the parsing result;

[0225] The segmentation module is used to segment the parsed results into segments by combining hierarchical structure and linear segmentation based on character length.

[0226] Furthermore, the segmentation module includes:

[0227] The first molecular module is used to segment the parsed results into text to obtain the content of each chapter; the chapter content includes at least the chapter length and the chapter text content;

[0228] The determination submodule is used to determine the length of each chapter from the content of each chapter;

[0229] The first merging submodule is used to merge the content of consecutive chapters with the same level of consecutive chapter lengths if the length of consecutive chapters with the same level of consecutive chapter lengths is less than or equal to a preset threshold.

[0230] The second merging submodule is used to merge the content of consecutive chapters at the same level if the length of a single chapter is less than or equal to a preset threshold.

[0231] The second segmentation module is used to determine the threshold length of the next level directory of the current level directory if the length of a single chapter in each chapter is greater than a preset threshold, until the length of a single chapter in the last level directory is greater than the preset threshold. The threshold segmentation is completed based on the line breaks and punctuation marks in the chapter content, so as to complete the corpus segmentation of the parsing results and obtain the segmentation result.

[0232] Furthermore, recall unit 603 includes:

[0233] The settings module is used to set the global cosine similarity threshold for knowledge search and the number of knowledge blocks to be retrieved.

[0234] The extraction module is used to extract keywords from user questions;

[0235] The acquisition module is used to represent user questions and keywords into vectors through the embedding model, and obtain the sparse vector of the search query, the dense vector of the search query, the sparse vector of the search keywords, and the dense vector of the search keywords.

[0236] The first retrieval processing module is used to perform sparse vector retrieval on the sparse vector of the retrieval query through an open-source vector database to obtain the knowledge block corresponding to the first sparse vector, perform dense vector retrieval on the dense vector of the retrieval query to obtain the knowledge block corresponding to the first dense vector, and merge the knowledge block corresponding to the first sparse vector and the knowledge block corresponding to the first dense vector after deduplication to obtain the retrieval query matching knowledge block.

[0237] The second retrieval processing module is used to perform sparse vector retrieval on the sparse vectors of the search keywords through an open-source vector database to obtain the knowledge block corresponding to the second sparse vector, perform dense vector retrieval on the dense vectors of the search keywords to obtain the knowledge block corresponding to the second dense vector, and merge the knowledge block corresponding to the second sparse vector and the knowledge block corresponding to the second dense vector after deduplication to obtain the knowledge block matching the search keywords.

[0238] The third retrieval processing module is used to perform sparse vector retrieval for knowledge generation problem matching on the sparse vector of the retrieval query through an open-source vector database to obtain the knowledge block corresponding to the third sparse vector; to perform dense vector retrieval for knowledge generation problem matching on the dense vector of the retrieval query to obtain the knowledge block corresponding to the third dense vector; and to merge the knowledge block corresponding to the third sparse vector and the knowledge block corresponding to the third dense vector to obtain the knowledge block matching the knowledge generation problem.

[0239] The fourth retrieval processing module is used to perform sparse vector retrieval by summarizing the sparse vector of the retrieval query through an open-source vector database to obtain the knowledge block corresponding to the fourth sparse vector, and to perform dense vector retrieval by summarizing the dense vector of the retrieval query to obtain the knowledge block corresponding to the fourth dense vector. The knowledge blocks corresponding to the fourth sparse vector and the knowledge blocks corresponding to the fourth dense vector are deduplicated and merged to obtain the summarizing knowledge block.

[0240] The calculation module is used to score the knowledge blocks that match the search query, the knowledge blocks that match the search keywords, the knowledge blocks that match the knowledge generation question, and the knowledge blocks that match the summary using a multi-route retrieval result formula, and to obtain a comprehensive score for all retrieval results;

[0241] The scoring and filtering module is used to score and filter all search results based on the comprehensive score of the number of retrieved knowledge blocks and the global cosine similarity threshold of the knowledge search, so as to obtain the knowledge recall results.

[0242] Furthermore, the fine-ranking unit 604 is specifically used to score the semantic relevance of knowledge blocks and user questions in the knowledge retrieval results using a fine-ranking model finely adjusted from communication domain data, thereby obtaining various semantic relevance scores, in order to complete the process of fine-ranking the knowledge retrieval results based on the fine-ranking model and obtaining the fine-ranking results.

[0243] Furthermore, the sorting unit 605 includes:

[0244] The sorting module is used to sort the semantic relevance scores in the fine-sorting results according to a preset sorting method, and obtain the sorting results.

[0245] The determination module is used to extract a preset number of knowledge blocks from the sorting results and determine them as the search results.

[0246] The beneficial effects of this application's embodiments are as follows: For a large number of knowledge documents of different formats, batch adaptive parsing and segmentation can be achieved. For the segmented knowledge blocks in the segmentation results, a multi-route retrieval recall strategy based on hybrid retrieval is adopted. The multi-route retrieval recall strategy includes multiple recall dimensions such as knowledge matching, knowledge keyword matching, knowledge block generation question matching, and document summary matching. The multi-route retrieval recall strategy, which combines sparse retrieval and dense retrieval, is used to achieve knowledge matching, knowledge keyword matching, knowledge generation related question matching, and knowledge summary matching for user questions. The fine ranking model trained with communication domain data is used in conjunction with the fine ranking results obtained by the multi-route retrieval recall strategy. The fine ranking results are sorted according to a preset sorting method to determine the retrieval results, that is, the user questions and knowledge blocks are scored, and the results with the highest scores are returned. On the basis of the already achieved knowledge recall, a secondary retrieval of questions and knowledge blocks is performed based on the semantic model, which further improves the knowledge retrieval accuracy of the retrieval-enhanced question-and-answer system, thereby improving the accuracy of the knowledge question-and-answer and intelligent dialogue content of the retrieval-enhanced question-and-answer system.

[0247] This application embodiment also provides a storage medium, the storage medium including stored instructions, wherein, when the instructions are executed, the device where the storage medium is located is controlled to perform the retrieval enhancement processing method based on the large model described above.

[0248] This application also provides an electronic device, the structural schematic diagram of which is shown below. Figure 7 As shown, it specifically includes a memory 701 and one or more instructions 702, wherein one or more instructions 702 are stored in the memory 701 and are configured to be executed by one or more processors 703 to perform the above-mentioned large model-based retrieval enhancement processing method.

[0249] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0250] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system-type embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0251] The steps in the methods of the various embodiments of this application can be adjusted, combined, or deleted according to actual needs.

[0252] Finally, it should be noted that in this paper, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0253] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0254] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A retrieval enhancement processing method based on a large model, characterized in that, The method includes: When a user question is received, the corresponding knowledge document is retrieved. The knowledge document is adaptively parsed and segmented to obtain the segmentation result; Based on the multi-route retrieval and recall strategy and the user question, the segmentation results are retrieved and recalled to obtain knowledge retrieval results; wherein, the multi-route retrieval and recall strategy is determined by sparse retrieval and dense retrieval. The knowledge retrieval results are then refined based on the refined ranking model to obtain the refined ranking results. The refined ranking results are sorted according to a preset sorting method to determine the search results; The step of performing retrieval and retrieval based on the multi-route retrieval and retrieval strategy and the user question to obtain knowledge retrieval results includes: Set the global cosine similarity threshold for knowledge search and the number of knowledge blocks to retrieve; Extract keywords from the user's question; The user question and the keywords are represented by vectors using an embedding model, resulting in a sparse vector of the search query, a dense vector of the search query, a sparse vector of the search keywords, and a dense vector of the search keywords. The sparse vector of the retrieval query is retrievaled by an open-source vector database to obtain a first sparse vector corresponding knowledge block. Dense vector retrieval is performed on the dense vector of the retrieval query to obtain a first dense vector corresponding knowledge block. The first sparse vector corresponding knowledge block and the first dense vector corresponding knowledge block are deduplicated and merged to obtain a retrieval query matching knowledge block. The sparse vector retrieval of the sparse vector of the search keyword is performed by an open-source vector database to obtain the second sparse vector corresponding knowledge block. The dense vector of the search keyword is then performed by a dense vector retrieval to obtain the second dense vector corresponding knowledge block. The second sparse vector corresponding knowledge block and the second dense vector corresponding knowledge block are deduplicated and merged to obtain the search keyword matching knowledge block. The sparse vector of the retrieval query is used to perform sparse vector retrieval for knowledge generation problem matching in an open-source vector database to obtain the knowledge block corresponding to the third sparse vector. The dense vector of the retrieval query is used to perform dense vector retrieval for knowledge generation problem matching to obtain the knowledge block corresponding to the third dense vector. The knowledge block corresponding to the third sparse vector and the knowledge block corresponding to the third dense vector are then merged to obtain the knowledge block corresponding to the knowledge generation problem. The sparse vector retrieval of the retrieval query is performed by summarizing the sparse vectors of the retrieval query to obtain the fourth sparse vector corresponding knowledge block. The dense vector retrieval of the retrieval query is performed by summarizing the dense vectors to obtain the fourth dense vector corresponding knowledge block. The fourth sparse vector corresponding knowledge block and the fourth dense vector corresponding knowledge block are deduplicated and merged to obtain the summarizing knowledge block. The search query matching knowledge block, the search keyword matching knowledge block, the knowledge generation question matching knowledge block, and the summary matching knowledge block are scored and calculated using a multi-route search result formula to obtain a comprehensive score for all search results. The knowledge recall results are obtained by scoring and filtering all search results based on the comprehensive score of the number of retrieved knowledge blocks and the global cosine similarity threshold of the knowledge search.

2. The method according to claim 1, characterized in that, The adaptive parsing and segmentation of the knowledge document to obtain the segmentation result includes: Identify the various feature types in the knowledge document; Based on each feature type, the corresponding parsing method is invoked to perform adaptive knowledge corpus content parsing on the knowledge document, and the parsing result is obtained. The parsing results are segmented into segments by combining hierarchical structure and linear character length segmentation.

3. The method according to claim 2, characterized in that, The parsing results are segmented into corpora using a combination of hierarchical structure and linear character length segmentation to obtain segmentation results, including: The parsing results are then segmented into text to obtain the content of each chapter; wherein, the chapter content includes at least the chapter length and the chapter text content; The length of each chapter is determined from the content of each chapter; If the length of consecutive chapters at the same level is less than or equal to a preset threshold, the content of consecutive chapters at the same level will be merged. If the length of a single chapter is less than or equal to the preset threshold, the content of consecutive chapters at the same level will be merged. If the length of a single chapter in each chapter exceeds the preset threshold, the threshold length of the next level directory of the current level chapter is judged until the length of a single chapter in the last level directory exceeds the preset threshold. Threshold segmentation is completed based on the line breaks and punctuation marks in the chapter content to complete the corpus segmentation of the parsing results and obtain the segmentation result.

4. The method according to claim 1, characterized in that, The refinement of the knowledge recall results based on the refinement model yields the following refinement results: By using a fine-tuned ranking model based on data from the communications domain, semantic relevance scores are assigned to the knowledge blocks and user questions in the knowledge retrieval results to obtain individual semantic relevance scores. This completes the process of fine-ranking the knowledge retrieval results based on the fine-ranking model to obtain the fine-ranking results.

5. The method according to claim 1, characterized in that, The step of sorting the refined ranking results according to a preset sorting method to determine the search results includes: The semantic relevance scores in the refined ranking results are sorted according to a preset sorting method to obtain the sorting results; A preset number of knowledge blocks are extracted from the sorting results to determine the search results.

6. A retrieval enhancement processing system based on a large model, characterized in that, The system includes: The acquisition unit is used to acquire the knowledge document corresponding to the user's question when a user's question is received. The parsing and segmentation unit is used to adaptively parse and segment the knowledge document to obtain the segmentation result; The recall unit is used to retrieve and recall the segmentation results based on the multi-route retrieval recall strategy and the user question to obtain knowledge recall results; wherein, the multi-route retrieval recall strategy is determined by sparse retrieval and dense retrieval. The fine-ranking unit is used to fine-rank the knowledge recall results based on the fine-ranking model to obtain the fine-ranking results. A sorting unit is used to sort the refined sorting results according to a preset sorting method to determine the retrieval results; The recall unit includes: The settings module is used to set the global cosine similarity threshold for knowledge search and the number of knowledge blocks to be retrieved. The extraction module is used to extract keywords from the user's question; The acquisition module is used to represent the user question and the keywords into vectors through an embedding model, and obtain the sparse vector of the search query, the dense vector of the search query, the sparse vector of the search keywords, and the dense vector of the search keywords. The first retrieval processing module is used to perform sparse vector retrieval on the sparse vector of the retrieval query through an open-source vector database to obtain a knowledge block corresponding to the first sparse vector, perform dense vector retrieval on the dense vector of the retrieval query to obtain a knowledge block corresponding to the first dense vector, and merge the first knowledge block corresponding to the sparse vector and the first knowledge block corresponding to the dense vector after deduplication to obtain a retrieval query matching knowledge block. The second retrieval processing module is used to perform sparse vector retrieval on the sparse vector of the retrieval keyword through an open-source vector database to obtain the knowledge block corresponding to the second sparse vector, perform dense vector retrieval on the dense vector of the retrieval keyword to obtain the knowledge block corresponding to the second dense vector, and merge the knowledge block corresponding to the second sparse vector and the knowledge block corresponding to the second dense vector after deduplication to obtain the retrieval keyword matching knowledge block. The third retrieval processing module is used to perform sparse vector retrieval for knowledge generation problem matching on the sparse vector of the retrieval query through an open-source vector database to obtain the knowledge block corresponding to the third sparse vector; to perform dense vector retrieval for knowledge generation problem matching on the dense vector of the retrieval query to obtain the knowledge block corresponding to the third dense vector; and to merge the knowledge block corresponding to the third sparse vector and the knowledge block corresponding to the third dense vector to obtain the knowledge block matching the knowledge generation problem. The fourth retrieval processing module is used to perform sparse vector retrieval by summarizing the sparse vector of the retrieval query through an open-source vector database to obtain the knowledge block corresponding to the fourth sparse vector; to perform dense vector retrieval by summarizing the dense vector of the retrieval query to obtain the knowledge block corresponding to the fourth dense vector; and to merge the knowledge block corresponding to the fourth sparse vector and the knowledge block corresponding to the fourth dense vector after deduplication to obtain the summarizing knowledge block. The calculation module is used to score the search query matching knowledge block, the search keyword matching knowledge block, the knowledge generation question matching knowledge block, and the summary matching knowledge block using a multi-route search result formula, and to obtain a comprehensive score for all search results; The scoring and filtering module is used to score and filter all search results based on the number of retrieved knowledge blocks and the global cosine similarity threshold of the knowledge search, so as to obtain knowledge recall results.

7. The system according to claim 6, characterized in that, The parsing and segmentation unit includes: The identification module is used to identify the various feature types in the knowledge document; The parsing module is used to call the corresponding parsing method according to each feature type, perform adaptive knowledge corpus content parsing on the knowledge document, and obtain the parsing result; The segmentation module is used to segment the parsing results into segments by combining hierarchical structure and linear segmentation based on character length.

8. The system according to claim 7, characterized in that, The segmentation module includes: The first molecular module is used to perform text segmentation on the parsing results to obtain the content of each chapter; wherein, the chapter content includes at least the chapter length and the chapter text content; A determination submodule is used to determine the length of each chapter from the content of each chapter; The first merging submodule is used to merge the content of consecutive chapters with the same level of consecutive chapter lengths if the length of consecutive chapters with the same level of consecutive chapter lengths is less than or equal to a preset threshold. The second merging submodule is used to merge the content of consecutive chapters at the same level if the length of a single chapter in each chapter is less than or equal to the preset threshold. The second segmentation module is used to determine the threshold length of the next level directory of the current level directory if the length of a single chapter in each chapter is greater than the preset threshold, until the length of a single chapter in the last level directory is greater than the preset threshold. The threshold segmentation is completed based on the line breaks and punctuation marks in the chapter content, so as to complete the corpus segmentation of the parsing results and obtain the segmentation result.

Citation Information

Patent Citations

  • RAG-based vertical domain knowledge multi-round question and answer method

    CN118964556A

  • Multipath fusion-based law and regulation recommendation system and method

    CN119903234A