An answer provenance method based on large model paragraph identification and reordering

CN122262286BActive Publication Date: 2026-10-20SMO CLINPLUS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202610367625.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-03-24
Publication Date
2026-10-20
Estimated Expiration
2046-03-24

AI Technical Summary

Technical Problem

[0003]当前主流RAG系统的常规实现方案,是先将原始文档切分为若干固定大小的文本块,通过向量检索技术从文本库中召回与用户问题语义相关的少量文本块,再把该部分召回文本作为上下文输入大语言模型生成答案,并将召回文本块直接标注为答案的对应来源,以此完成基础的答案溯源;而CN117453897A所述现有技术仍未脱离“有限召回、后序生成”的传统RAG框架,依旧存在难以弥补的技术缺陷

Benefits of technology

[0025]本发明采用全量文本块输入与段落标识显式输出的方式,替代传统向量检索召回机制,能够保留文档中的完整信息,避免文本筛选过程中的信息丢失,同时结合段落检测小模型与重排序模型形成校验匹配闭环,可修正模型输出的标识与答案不匹配的问题,让答案与文本段落的对应关系保持稳定,适配包含文本与表格的复杂文档处理场景,维持语义关联的完整性与匹配结果的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122262286B_ABST
    Figure CN122262286B_ABST
Patent Text Reader

Abstract

The application discloses an answer tracing method based on a large model paragraph identification and reordering, and relates to the technical field of natural language processing, and comprises the following steps: S1, performing text blocking processing on an original document to obtain text blocks, and configuring corresponding file identification and paragraph identification for each text block.The answer tracing method based on the large model paragraph identification and reordering can retain complete information in the document, avoid information loss in the text screening process, form a check matching closed loop in combination with a paragraph detection small model and a reordering model, can correct the problem that the identification and the answer output by the model do not match, can keep the corresponding relationship between the answer and the text paragraph stable, is suitable for complex document processing scenes containing text and tables, and can maintain the integrity of semantic association and the accuracy of matching results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, specifically to an answer tracing method based on large model paragraph identification and reordering. Background Technology

[0002] Retrieval Enhancement (RAG) is a core technology for the practical application of large language models. It is widely used in scenarios such as intelligent document question answering and professional knowledge retrieval, and is a key means to alleviate model illusion and improve answer reliability. Current mainstream RAG systems focus on text processing, recall ranking, and answer generation for document question answering. The authorized publication number "CN117453897A" describes "a document question answering method and system based on a large model and genetic algorithm. It utilizes QLoRA technology to fine-tune the ChatGLM model to extract text knowledge tags and synonym tags, transforming the text into questions. After preprocessing document segments, the text is stored in a vector database and a document database. Candidate texts are recalled through multiple paths using similar questions, knowledge tags, and vector data. Multiple similarity algorithms are combined, and a genetic algorithm is used to optimize the weighting coefficients to complete text ranking. Finally, question answering is generated based on the selected documents." This technology improves the recall accuracy and answer reliability of document question answering through large model instruction fine-tuning, multi-path recall, and genetic algorithm weight optimization, exhibiting good flexibility and scalability.

[0003] The conventional implementation of current mainstream RAG systems involves first dividing the original document into several fixed-size text blocks, then using vector retrieval technology to recall a small number of text blocks semantically related to the user's question from a text library. These recalled text blocks are then used as context input to a large language model to generate the answer, and the recalled text blocks are directly labeled as the corresponding source of the answer, thus completing basic answer tracing. However, the existing technology described in CN117453897A still hasn't broken away from the traditional RAG framework of "limited recall, subsequent generation," and still suffers from insurmountable technical flaws. First, vector retrieval and multi-path limited recall mechanisms cause a significant loss of effective information during the screening stage, retaining only a small number of highly relevant text blocks and failing to retain all valuable information. When faced with complex documents containing tables and mixed text, the recall method struggles to accurately match deep semantic relationships, easily leading to recall bias and omission of key information, directly reducing the accuracy and completeness of the generated answer. Secondly, both traditional RAG tracing and the solution described in CN117453897A can only achieve text-based annotations such as "the answer corresponds to a certain paragraph". They cannot accurately align the tracing results with the page coordinates and spatial positions of the original documents such as PDFs and scanned copies. The tracing results lack intuitive visual positioning capabilities, and users cannot quickly verify the matching relationship between the answer and the original text, which greatly increases the cost and difficulty of manual verification.

[0004] As the demand for complex document processing continues to increase, the industry has placed higher demands on the completeness of information, the accuracy of semantic matching, and the ability to locate the original text spatially in order to trace the source of answers. Traditional solutions and existing improved technologies cannot meet the needs of high-precision and visualized source tracing applications.

[0005] This patent aims to solve the practical problems of information loss in the recall process of existing RAG solutions, inaccurate semantic matching of complex documents, and inability to accurately align the source with the spatial location of the original document. Summary of the Invention

[0006] The purpose of this invention is to provide an answer tracing method based on large model paragraph identification and reordering to solve the problems mentioned in the background art.

[0007] To address the aforementioned technical problems, this invention provides the following technical solution: an answer tracing method based on large-model paragraph identification and reordering, applied to document question answering and answer tracing scenarios in retrieval enhancement generation systems. This method includes the following steps:

[0008] S1: Perform text chunking on the original document to obtain text chunks, and configure corresponding file identifiers and paragraph identifiers for each text chunk;

[0009] S2: Input all text blocks with configured identifiers into the large language model. The large language model generates the corresponding answer based on the user's input question and outputs the file identifier and paragraph identifier that match the answer.

[0010] S3: A small paragraph detection model trained using LoRA fine-tuning is used to perform matching and verification between the file identifier, paragraph identifier, and corresponding answer output by the large language model.

[0011] S4: When the judgment identifier does not match the answer, start the reordering model to perform secondary matching processing on all text blocks to obtain the target paragraph content;

[0012] S5: Extract the spatial coordinate data of the target paragraph content in the original document based on OCR technology, and determine the border range of the target paragraph content in the original document based on the start and end text of the target paragraph content;

[0013] S6: Convert the original document into an image format and visualize the target paragraph content based on the border range;

[0014] S7: The final output contains the source tracing results, including the answer, the corresponding file identifier, the corresponding paragraph identifier, and the original document location information.

[0015] Preferably, the original document includes single documents and combinations of multiple documents. During the text segmentation process, the segmentation operation is performed based on the text semantic boundaries and format boundaries of the document. Each segmented text block carries a unique corresponding file identifier and paragraph identifier. The file identifier is used to distinguish the original document to which the text block belongs, and the paragraph identifier is used to distinguish text blocks in different positions within the same original document. All text blocks are directly input into the large language model without undergoing vector retrieval filtering. The text semantic boundaries include paragraph end positions and semantic transformation nodes, and the format boundaries include heading separation positions, table separation positions, and page separation positions, which can complete the text segmentation by conforming to the document's own structure.

[0016] Preferably, the training process of the paragraph detection mini-model adopts the LoRA fine-tuning mode, freezing the basic parameters of the large language model and training only the low-rank adaptation parameters for paragraph detection. When the paragraph detection mini-model performs verification, it extracts the core semantic features of the answer and the semantic features of the text block corresponding to the identifier. The two types of semantic features are compared to determine the matching relationship. The verification process covers the correspondence between all output identifiers and answers. The low-rank adaptation parameters are adjusted only for the paragraph detection task, which can reduce the resource consumption of model training. The dimensional comparison of semantic features can improve the accuracy of matching judgment.

[0017] Preferably, after the re-ranking model starts, it loads the text content and semantic features of all text blocks. It then performs an association matching between the semantic features of the user-input question and the semantic features of all text blocks. The re-ranking model sorts the text blocks according to their matching degree, selecting the top-ranked text block as the target paragraph content. During the secondary matching, the re-ranking model does not discard any text blocks, retaining the eligibility of all text blocks for matching. Participating in matching with all text blocks avoids excluding valid content, and sorting by matching degree quickly identifies the text block most relevant to the question.

[0018] Preferably, during OCR processing, the original document's text content is first converted into recognizable character data and spatial coordinate data. The spatial coordinate data corresponding to the target paragraph content is in bbox format, and the border range is the largest closed area occupied by the target paragraph content in the original document. After the original document is converted into image format, the border range is marked in the image based on the bbox format coordinates to achieve visual positioning. The bbox format coordinates can completely record the paragraph's spatial position on the page, and the largest closed area can completely cover the display area of ​​the target paragraph.

[0019] Preferably, after the paragraph detection mini-model performs matching verification, a secondary verification process is performed on the verified identifiers and answers. This secondary verification employs two different mechanisms: semantic consistency verification and text attribution verification. These two mechanisms are executed sequentially. Identifiers and answers that fail the secondary verification are re-entered into the re-ranking model for a second matching process. Semantic consistency verification compares the semantic matching status of the answer and the text block, while text attribution verification confirms the document and paragraph position corresponding to the text block. This dual verification improves the stability of the matching results.

[0020] Preferably, for results that fail the second verification, a cyclical feedback process is performed. The feedback result is input into the re-sorting model, and the new matching result is input into the paragraph detection mini-model for verification. After the cyclical feedback process is executed a set number of times, a stable target paragraph content is output. During the loop, the matching data of each iteration is retained for subsequent source tracing and verification. The cyclical feedback can gradually correct matching deviations, and the retained matching data can completely record the entire source tracing process information.

[0021] Preferably, when the large language model outputs answers and identifiers, it binds and associates file identifiers, paragraph identifiers, and answers. The binding and association format is a fixed structured format, which includes answer content, file identifier fields, paragraph identifier fields, and original document page number fields. The output tracing results directly call this structured format data. The fixed structured format can standardize the data storage format and facilitate the rapid reading and corresponding verification of tracing information.

[0022] Preferably, when the original document contains both text and table content, the text segmentation process divides the table content into independent text blocks, assigns a unique paragraph identifier to each text block, and when the paragraph detection mini-model and the re-ranking model perform matching processing on the text blocks corresponding to the table content, they adapt the semantic feature extraction rules of the table content. The unique paragraph identifier can distinguish between tables and regular text blocks, and the adaptation rules can extract table cells, headers, and row-column relationship information as semantic features.

[0023] Preferably, after visual positioning is completed, the positioning markers are integrated with the image format file of the original document and the tracing results, and the positioning markers completely overlap with the border area of ​​the target paragraph content. The integrated output content can be directly used for checking the answer against the content of the original document without the need for additional text retrieval and location search. The overlap between the positioning markers and the border area can intuitively show the paragraph position, and the integrated output content can simplify the operation steps of checking the original text.

[0024] This invention provides an answer tracing method based on large-scale model paragraph identification and reordering. It has the following beneficial effects:

[0025] This invention adopts a method of full text block input and explicit paragraph label output to replace the traditional vector retrieval recall mechanism. It can retain the complete information in the document and avoid information loss during the text screening process. At the same time, it combines the paragraph detection small model and the re-ranking model to form a verification matching closed loop, which can correct the problem of mismatch between the model output labels and the answer, keep the correspondence between the answer and the text paragraph stable, adapt to complex document processing scenarios containing text and tables, and maintain the integrity of semantic association and the accuracy of matching results.

[0026] This invention uses OCR spatial coordinate extraction and original document image positioning to directly align the source tracing results with the specific location on the document page, presenting the paragraph area intuitively in the form of a border. Users can directly check the source of the answer by comparing it with the original text, simplifying the source tracing and verification process, reducing the cost of manual verification, and connecting the identification configuration, verification, matching and positioning links of the entire process to form a complete answer source tracing processing system, improving the intuitiveness and usability of the answer source tracing results. Attached Figure Description

[0027] Figure 1 This is a flowchart illustrating an answer tracing method based on large model paragraph identification and reordering according to the present invention.

[0028] Figure 2 This is an activity diagram of an answer tracing method based on large model paragraph identification and reordering according to the present invention. Detailed Implementation

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

[0030] Please see Figure 1 and Figure 2This invention provides a technical solution: an answer tracing method based on large-scale model paragraph identification and reordering, used to accurately locate document sources, reduce model illusions, and reduce manual verification. The method includes the following steps: performing text segmentation on the original document to obtain text blocks, configuring corresponding file and paragraph identifiers for each text block; inputting all text blocks with configured identifiers into a large language model, which generates corresponding answers based on user input questions and outputs file and paragraph identifiers matching the answers; using a small paragraph detection model trained based on LoRA fine-tuning to perform matching verification between the file and paragraph identifiers output by the large language model and the corresponding answers; when it is determined that the identifiers and answers do not match, starting the reordering model to perform secondary matching processing on all text blocks to obtain the target paragraph content; extracting the spatial coordinate data corresponding to the target paragraph content in the original document based on OCR technology, and determining the border range of the target paragraph content in the original document based on the start and end text of the target paragraph content; converting the original document into an image format and visually locating the target paragraph content based on the border range; finally outputting a tracing result containing the answer, corresponding file identifier, corresponding paragraph identifier, and original document location information.

[0031] It should be further explained that the original document is segmented into text blocks based on its own semantic and formatting boundaries. Each resulting text block is assigned a unique file identifier and paragraph identifier. The file identifier distinguishes the original document to which the text block belongs, while the paragraph identifier distinguishes text blocks located at different positions within the same original document.

[0032] All text blocks with completed identifier configuration are directly input into the large language model without undergoing the vector retrieval process. After receiving the user's input question, the large language model combines the content of all text blocks to generate the corresponding answer, and simultaneously outputs the file identifier and paragraph identifier associated with the answer.

[0033] A small paragraph detection model trained using LoRA fine-tuning is employed to extract the core semantic features of the output answer from the larger language model. Semantic features of the text block corresponding to the output identifier are then extracted. The two types of semantic features are compared to determine the matching status between the identifier and the answer.

[0034] When a mismatch is detected, the re-ranking model is activated to load the text content and semantic features of all text blocks. The semantic features of the user input question are then matched with the semantic features of all text blocks. The re-ranking model sorts all text blocks according to their matching degree, selecting the top-ranked text block as the target paragraph content.

[0035] The original document is processed using OCR technology to obtain the bounding box (bbox) spatial coordinates of the target paragraph content within the original document. Based on the start and end text of the target paragraph content, the maximum closed border area occupied by the paragraph content in the original document is determined.

[0036] The original document is converted into an image file, and the target paragraph content is marked according to the border range in the image file. Finally, the answer, corresponding file identifier, corresponding paragraph identifier, and original document location information are integrated and output to form a complete tracing result.

[0037] The original document contains single documents and combinations of multiple documents. During the text segmentation process, the segmentation operation is performed based on the text semantic boundaries and format boundaries of the document. Each segmented text block carries a unique corresponding file identifier and paragraph identifier. The file identifier is used to distinguish the original document to which the text block belongs, and the paragraph identifier is used to distinguish text blocks in different positions within the same original document. All text blocks are directly input into the large language model without undergoing vector retrieval filtering.

[0038] It should be further clarified that the original documents processed include both single documents and combinations of multiple documents. During text segmentation, text blocks are divided based on the semantic and format boundaries within the original document. Semantic boundaries include paragraph ends and semantic transition nodes, while format boundaries include heading separators, table separators, and page breaks.

[0039] Each text block is assigned a unique file identifier and paragraph identifier. The file identifier is used to distinguish the original document to which the text block belongs, and the paragraph identifier is used to distinguish text blocks at different text positions within the same original document.

[0040] All text blocks that have been segmented and labeled are directly input into the large language model without undergoing vector retrieval filtering or removing any text blocks, and participate in the process of answer generation and label output.

[0041] The training process of the paragraph detection mini-model adopts the LoRA fine-tuning mode, freezes the basic parameters of the large language model, and trains only the low-rank adaptation parameters of paragraph detection. When the paragraph detection mini-model performs verification, it extracts the core semantic features of the answer and extracts the semantic features of the text block corresponding to the label. The two types of semantic features are compared to determine the matching relationship. The verification process covers the correspondence between all output labels and answers.

[0042] It should be further noted that the paragraph detection mini-model is trained using LoRA fine-tuning. During training, the basic parameters of the large language model are kept frozen, and the low-rank adaptation parameters are adjusted only for paragraph detection and matching requirements.

[0043] After training, the small paragraph detection model first extracts core semantic features from the answer output by the large language model when performing matching verification. Then, it retrieves the text block corresponding to the output file identifier and paragraph identifier, and extracts the semantic features of that text block.

[0044] The core semantic features of the answer are compared with the semantic features of the text block dimension by dimension. Based on the comparison results, the matching relationship between file identifiers, paragraph identifiers and answers is determined. The verification operation covers the association relationship between all file identifiers, paragraph identifiers and corresponding answers output by the large language model, ensuring that the corresponding state of each identifier and answer is verified and determined.

[0045] After the reordering model starts, it loads the text content and semantic features of all text blocks, performs association matching between the semantic features of the user input question and the semantic features of all text blocks, sorts the text blocks according to the degree of matching, and selects the first text block in the sorted results as the target paragraph content. When the reordering model performs secondary matching, it does not remove any text blocks and retains the matching eligibility of all text blocks.

[0046] It should be further explained that after receiving the start command, the reordering model loads all text blocks that have been segmented and labeled, and simultaneously loads the text content and semantic features corresponding to each text block. It then extracts the semantic features corresponding to the user input question.

[0047] The semantic features of the question are matched with the semantic features of each text block one by one. The re-ranking model then ranks all text blocks based on the matching results.

[0048] After sorting, the text block at the top and bottom of the sorted results is selected as the target paragraph content. Throughout the entire secondary matching process, the re-sorting model does not remove any text blocks; all text blocks participate in the matching and sorting process, maintaining the participation of all text blocks.

[0049] When OCR technology is performed, it first converts the text content of the original document into recognizable character data and spatial coordinate data. The spatial coordinate data corresponding to the target paragraph content is in bbox format coordinates, and the border range is the largest closed area occupied by the target paragraph content in the original document. After the original document is converted into image format, the border range is marked in the image according to the bbox format coordinates to achieve visual positioning.

[0050] It should be further explained that OCR technology processes the original document, converting the text content into recognizable character data, and extracting the spatial coordinate data of the text content within the original document page. The spatial coordinate data corresponding to the target paragraph content is recorded in bbox format.

[0051] Based on the start and end text positions of the target paragraph, determine the largest closed area occupied by the paragraph content in the original document page, and use this area as the border range of the target paragraph content.

[0052] After converting the original document into an image file, the bounding box range corresponding to the target paragraph content is marked in the image file based on the spatial coordinate data in bbox format, thus completing the visual positioning of the target paragraph content in the original document.

[0053] After the paragraph detection mini-model performs matching verification, it performs secondary verification on the verified identifiers and answers. The secondary verification uses two different mechanisms: semantic consistency verification and text attribution verification. The two verification mechanisms are executed in sequence. The identifiers and answers that fail the secondary verification are re-entered into the re-sorting model for secondary matching processing.

[0054] It should be further explained that after the paragraph detection mini-model completes the matching and verification of file identifiers, paragraph identifiers, and answers, it performs a secondary verification process on the identifiers and corresponding answers that pass the verification. The secondary verification adopts a semantic consistency verification mechanism and a text attribution verification mechanism in sequence.

[0055] The semantic consistency check mechanism compares the semantic match between the answer content and the corresponding text block content. The text attribution check mechanism confirms the original document and paragraph position to which the text block corresponding to the answer content belongs. The two check mechanisms are performed sequentially.

[0056] If the secondary verification result is deemed unsuccessful, the corresponding identifier and answer are re-entered into the re-ranking model. The re-ranking model is then activated to perform secondary matching on the entire text block to obtain the text block content that meets the matching requirements.

[0057] The results of the second verification fail to pass. The feedback results are then fed into the re-sorting model to obtain new matching results, which are then fed into the paragraph detection mini-model for verification. After the feedback process is executed a set number of times, the stable target paragraph content is output. During the loop, the matching data of each iteration is retained for subsequent source tracing and verification.

[0058] It should be further explained that results failing the second verification undergo a loop feedback process. The feedback result is input into the new matching result obtained after re-ranking the model, and then sent to the paragraph detection mini-model for verification. The loop feedback process is executed a set number of times, and after completion, the target paragraph content with a stable state is output.

[0059] The matching data generated by each matching operation is retained during the loop, and the retained matching data can be directly used in subsequent traceability and verification processes. The loop feedback link connects the paragraph detection mini-model and the re-sorting model, forming a continuous verification and matching closed loop.

[0060] The entire text block is included in the matching and verification process without deleting any text block from participating.

[0061] When the large language model outputs the answer and identifier, it binds and associates the file identifier, paragraph identifier and answer. The binding and association format is a fixed structured format, which includes the answer content, file identifier field, paragraph identifier field and original document page number field. The output tracing results directly call this structured format data.

[0062] It should be further explained that during the process of generating answers and outputting corresponding file and paragraph identifiers by the large language model, the file identifiers, paragraph identifiers, and answer content are bound together. This binding is carried out using a fixed structured format.

[0063] This structured format includes fields for answer content, document identifier, paragraph identifier, and original document page number. Each set of answers, along with its corresponding identifier and page number information, is organized and stored according to this fixed structured format.

[0064] The final traceability results directly call the data stored in this structured format, ensuring that the correspondence between answers, identifiers and page number information remains stable, which facilitates the reading and verification of subsequent traceability information.

[0065] When the original document contains both text and table content, the text segmentation process divides the table content into independent text blocks and assigns a unique paragraph identifier to each text block. When the paragraph detection mini-model and the re-ranking model perform matching processing on the text blocks corresponding to the table content, they adapt to the semantic feature extraction rules of the table content.

[0066] It should be further explained that when the original document contains both regular text content and table content, the text segmentation process divides the table content into text blocks as independent units. A unique paragraph identifier is assigned to the text block corresponding to the table content, and this paragraph identifier is distinguished from the paragraph identifier corresponding to the regular text content using a unified encoding rule.

[0067] When the paragraph detection mini-model performs matching verification on the text blocks corresponding to the table content, it calls the semantic feature extraction rules adapted to the table content to extract the cell text, table header information, and row and column corresponding association information in the table to form corresponding semantic features.

[0068] When the reordering model performs secondary matching and sorting on the text blocks corresponding to the table content, it uses the same adaptation rules to complete the semantic association matching between the user question and the table text blocks. This ensures that the table content and regular text content follow a unified processing flow in the stages of segmentation, identifier configuration, validation, and matching.

[0069] The entire text block is involved in the processing operation throughout the entire process.

[0070] After the visualization and location are completed, the location markers are integrated with the image format file of the original document and the source tracing results. The border range of the location markers and the target paragraph content completely overlaps. The integrated output can be directly used to verify the answer and the content of the original document without the need to perform additional text retrieval and location search.

[0071] It should be further explained that after the visual positioning operation is completed, the positioning markers on the page, the original document file converted to image format, and the source results containing the answers and identification information are integrated and output. The outline of the positioning markers completely coincides with the border range corresponding to the target paragraph content, and the positioning markers appear as closed boundaries in the original document in image format.

[0072] The integrated output can be directly used to verify the answer content against the original document content. After retrieving the integrated output, users can directly view the original text by referring to the page area corresponding to the positioning mark, without needing to perform additional text search or page location lookup operations.

[0073] The integrated output connects all the data from the previous segmentation, verification, matching, and coordinate extraction stages, maintaining a stable correspondence between answers, file identifiers, paragraph identifiers, and page positioning information.

[0074] This invention adopts a method of full text block input and explicit paragraph label output to replace the traditional vector retrieval recall mechanism. It can retain the complete information in the document and avoid information loss during the text screening process. At the same time, it combines the paragraph detection small model and the re-ranking model to form a verification matching closed loop, which can correct the problem of mismatch between the model output labels and the answer, keep the correspondence between the answer and the text paragraph stable, adapt to complex document processing scenarios containing text and tables, and maintain the integrity of semantic association and the accuracy of matching results.

[0075] This invention uses OCR spatial coordinate extraction and original document image positioning to directly align the source tracing results with the specific location on the document page, presenting the paragraph area intuitively in the form of a border. Users can directly check the source of the answer by comparing it with the original text, simplifying the source tracing and verification process, reducing the cost of manual verification, and connecting the identification configuration, verification, matching and positioning links of the entire process to form a complete answer source tracing processing system, improving the intuitiveness and usability of the answer source tracing results.

[0076] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover 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 limitations, 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.

[0077] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for tracing answers based on large-scale model paragraph identification and reordering, characterized in that, The method includes the following steps: S1: Perform text chunking on the original document to obtain text chunks, and configure corresponding file identifiers and paragraph identifiers for each text chunk; S2: Input all text blocks with configured identifiers into the large language model. The large language model generates the corresponding answer based on the user's input question and outputs the file identifier and paragraph identifier that match the answer. S3: A small paragraph detection model trained using LoRA fine-tuning is used to perform matching and verification between the file identifier, paragraph identifier, and corresponding answer output by the large language model. S4: When the judgment identifier does not match the answer, start the reordering model to perform secondary matching processing on all text blocks to obtain the target paragraph content; S5: Extract the spatial coordinate data of the target paragraph content in the original document based on OCR technology, and determine the border range of the target paragraph content in the original document based on the start and end text of the target paragraph content; S6: Convert the original document into an image format and visualize the target paragraph content based on the border range; S7: The final output contains the source tracing results, including the answer, the corresponding file identifier, the corresponding paragraph identifier, and the original document location information; The original document includes single documents and combinations of multiple documents. During the text segmentation process, the segmentation operation is performed based on the text semantic boundaries and format boundaries of the document. Each segmented text block carries a unique corresponding file identifier and paragraph identifier. The file identifier is used to distinguish the original document to which the text block belongs, and the paragraph identifier is used to distinguish text blocks in different positions within the same original document. All text blocks are directly input into the large language model without undergoing vector retrieval filtering.

2. The answer tracing method based on large model paragraph identification and reordering according to claim 1, characterized in that: The training process of the paragraph detection mini-model adopts the LoRA fine-tuning mode, freezes the basic parameters of the large language model, and trains only the low-rank adaptation parameters of paragraph detection. When the paragraph detection mini-model performs verification, it extracts the core semantic features of the answer and extracts the semantic features of the text block corresponding to the label. The two types of semantic features are compared to determine the matching relationship. The verification process covers the correspondence between all output labels and answers.

3. The answer tracing method based on large model paragraph identification and reordering according to claim 2, characterized in that: After the reordering model starts, it loads the text content and semantic features of all text blocks, performs association matching between the semantic features of the user input question and the semantic features of all text blocks, sorts the text blocks according to the degree of matching, and selects the first text block in the sorted results as the target paragraph content. When the reordering model performs secondary matching, it does not remove any text blocks and retains the matching eligibility of all text blocks.

4. The answer tracing method based on large model paragraph identification and reordering according to claim 3, characterized in that: When OCR technology is performed, it first converts the text content of the original document into recognizable character data and spatial coordinate data. The spatial coordinate data corresponding to the target paragraph content is in bbox format coordinates, and the border range is the largest closed area occupied by the target paragraph content in the original document. After the original document is converted into image format, the border range is marked in the image according to the bbox format coordinates to achieve visual positioning.

5. The answer tracing method based on large model paragraph identification and reordering according to claim 4, characterized in that: After the paragraph detection mini-model performs matching verification, it performs secondary verification on the verified identifiers and answers. The secondary verification uses two different mechanisms: semantic consistency verification and text attribution verification. The two verification mechanisms are executed in sequence. The identifiers and answers that fail the secondary verification are re-entered into the re-sorting model for secondary matching processing.

6. The answer tracing method based on large model paragraph identification and reordering according to claim 5, characterized in that: The results of the second verification fail to pass. The feedback results are then fed into the re-sorting model to obtain new matching results, which are then fed into the paragraph detection mini-model for verification. After the feedback process is executed a set number of times, the stable target paragraph content is output. During the loop, the matching data of each iteration is retained for subsequent source tracing and verification.

7. The answer tracing method based on large model paragraph identification and reordering according to claim 6, characterized in that: When the large language model outputs the answer and identifier, it binds and associates the file identifier, paragraph identifier and answer. The binding and association format is a fixed structured format, which includes the answer content, file identifier field, paragraph identifier field and original document page number field. The output tracing results directly call this structured format data.

8. The answer tracing method based on large model paragraph identification and reordering according to claim 7, characterized in that: When the original document contains both text and table content, the text segmentation process divides the table content into independent text blocks and assigns a unique paragraph identifier to each text block. When the paragraph detection mini-model and the re-ranking model perform matching processing on the text blocks corresponding to the table content, they adapt to the semantic feature extraction rules of the table content.

9. The answer tracing method based on large model paragraph identification and reordering according to claim 8, characterized in that: After the visualization and location are completed, the location markers are integrated with the image format file of the original document and the source tracing results. The border range of the location markers and the target paragraph content completely overlaps. The integrated output can be directly used to verify the answer and the content of the original document without the need to perform additional text retrieval and location search.

Citation Information

Patent Citations

  • Document question and answer method and system based on large model and genetic algorithm

    CN117453897A

  • Large language model question and answer optimization method and device, electronic equipment and storage medium

    CN117851575A

  • Medical knowledge base question and answer method and system, electronic equipment and storage medium

    CN121543728A