A retrieval enhanced question answering method and system for mixed modality document content

By performing BWT transformation and suffix array processing on mixed-modal documents, combined with Merkle tree and dual encoder techniques, the problem of difficulty in understanding the table structure in mixed-modal documents was solved, achieving efficient and accurate retrieval and question-answering results, and improving the credibility and traceability of the answers.

CN121636682BActive Publication Date: 2026-05-29AGRI INFORMATION INST OF CHINESE ACAD OF AGRI SCI

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AGRI INFORMATION INST OF CHINESE ACAD OF AGRI SCI
Filing Date
2025-12-02
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing intelligent question answering systems cannot effectively understand the row and column structure and semantic relationships within tables when processing mixed modal documents, especially those that combine text and table modalities. This leads to problems such as structural confusion, numerical extraction errors, and misunderstandings of relationships in the search results.

Method used

The method employs BWT transformation and suffix array to identify repeated semantic substrings, segments text and tables into blocks, constructs Merkle trees and generates path confidence through dynamic block aggregation of semantic density, and combines dual encoders and cross encoders for accurate matching to generate answers containing reference tags and related information blocks.

Benefits of technology

It improves the retrieval accuracy of mixed-modal documents, alleviates the relationship loss problem caused by table linearization, enhances the credibility and traceability of answers, and ensures the integrity and verifiability of retrieval results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121636682B_ABST
    Figure CN121636682B_ABST
Patent Text Reader

Abstract

The application discloses a retrieval enhanced question and answer method and system for mixed mode document content, comprising: acquiring a mixed mode document of a target industry, extracting hierarchical text blocks and table information blocks from the mixed mode document, generating a Merkle tree and a vector index library based on semantic feature coding of the text blocks and the table information blocks, performing similarity search in the vector index library according to a query vector of a user question, obtaining a context of the query vector, generating a Merkle path corresponding to the context and a retrieval enhanced generation chain according to the Merkle tree, inputting a prompt template, the Merkle path and the retrieval enhanced generation chain into a preset large language model, and decoding and outputting an answer. The method utilizes BWT transformation, non-standard horizontal table transposition and hierarchical blocking, so that the model can understand structural queries of table type data, the combination of fast recall of a double encoder and fine matching of a cross encoder is used, and the output result is attached with reference marks and a source file list, so that the traceability of the answer is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent question answering technology, and in particular to an enhanced question answering method and system for retrieving mixed-modal document content. Background Technology

[0002] In fields such as government procurement, corporate management, and academic research, knowledge carriers generally exist in the form of mixed-modal documents containing unstructured text and semi-structured tables. The tables in the documents often carry key quantitative data, comparative information, and attribute relationships, while the surrounding text provides contextual descriptions, conclusion analysis, and logical explanations. The two complement each other and together constitute a document with rich form and complete expression. In recent years, intelligent question answering systems based on large models and retrieval-enhanced generative architectures have made significant progress. However, how to accurately and efficiently extract knowledge from such mixed-modal documents has become the core challenge facing the current field of intelligent information retrieval and question answering.

[0003] Existing technologies are relatively mature in plain text scenarios, but when directly applied to documents with mixed text and table modalities, they typically employ a flattened "table-to-text" approach, simply converting tables into paragraphs separated by special symbols. This results in the significant loss of crucial structured information such as the internal row and column structure, and the correspondence between cell values ​​and field names. These factors prevent the system from understanding structural semantics such as "data in a certain column," "entry in a certain row," or "value at the intersection of a row and column." When user queries involve "comparing the values ​​of items A and B in a table" or "listing all data in a certain column," semantic retrieval of plain text fragments struggles to accurately locate the entire table or the correct row and column segments within it, leading to retrieval failures or missing relevant context. Existing segmentation methods... Most existing methods involve a simplistic and mechanical segmentation of documents, potentially splitting descriptive text and its referenced tables into different, even disparate, text fragments. This can lead to the system easily retrieving descriptive text while missing core data tables, or retrieving only isolated data tables without crucial textual explanations. Even when the search results contain fragments of tabular text, the large language model receives only a disorganized linear text, which can easily result in numerical extraction errors and misinterpretations of relationships during the answer generation stage. Therefore, there is an urgent need to develop an intelligent question-answering method that can quickly respond to and accurately interpret mixed-modal document content. This is of great significance for promoting the development and application of comprehensive understanding, retrieval, and question-answering technologies for mixed-modal document content. Summary of the Invention

[0004] The purpose of this invention is to provide a retrieval enhancement question-answering method and system for mixed-modal document content.

[0005] To achieve the above objectives, the present invention is implemented according to the following technical solution:

[0006] The first aspect of this invention provides a retrieval-enhanced question-answering method for mixed-modal document content, comprising:

[0007] A. Obtain a hybrid modal document for the target industry, preprocess the hybrid modal document to obtain text content blocks and table content blocks, wherein the hybrid modal document includes unstructured text and semi-structured tables;

[0008] B. Perform BWT transformation on the string of the text content block, identify repeated semantic substrings through the suffix array according to the transformation sequence, extract the row and column structure of the table content block, and obtain hierarchical text blocks and table information blocks.

[0009] C. Based on the text blocks and table information blocks, perform semantic feature encoding, associate the encoded embedding vector with the metadata hash value of the block, generate a Merkle tree based on the hash value, and obtain a vector index library;

[0010] D. Obtain user questions and encode them into query vectors using a dual encoder. Use the query vectors to perform similarity searches in the vector index library. Match and score similarity search information blocks using a cross encoder, and use the best matching information block as the context of the query vector.

[0011] E. Generate the Merkle path and retrieval enhancement generation chain corresponding to the context based on the Merkle tree, use the context as a prompt template, input the prompt template, Merkle path and retrieval enhancement generation chain into a preset large language model, decode and output the answer containing reference tags and a list of source files with relevant information blocks.

[0012] Furthermore, the method for obtaining the mixed-modal document includes:

[0013] Obtain hybrid modal documents for the target industry. The hybrid modal documents include unstructured text and semi-structured tables. The unstructured text includes paragraph text, annotation text, chapter descriptions, and contextual descriptive content in the document. The semi-structured tables include merged cells, multi-level headers, statistical tables with cross-row and cross-column associations, parameter comparison tables, and data detail tables.

[0014] Remove watermarks, invalid whitespace characters, duplicate page numbers, and headers and footers from mixed-modal documents and convert them into a unified document object model structure. Split the normalized unstructured text based on punctuation marks, paragraph separators, and chapter titles to obtain text content blocks. Label the text content blocks with metadata. If the number of characters in a single semantic unit exceeds 1000, split it into multiple text content blocks according to the boundaries of complete sentences.

[0015] The plain text area and the table area are divided based on the table border. Empty cells and invalid placeholder cells in the table are removed. Merged cells and multi-level headers of the semi-structured table in the table area are restored to the standard row and column structure through cell coordinate mapping. Missing row and column indexes are added to the standard row and column structure. The header hierarchy information, cell values ​​and table titles are extracted to obtain the table content blocks. Metadata is marked on the table content blocks.

[0016] Based on the metadata, text content blocks and table content blocks with character recognition error rates and row / column structure missing rates exceeding 5% are removed to obtain a set of text content blocks and a set of table content blocks. The metadata includes document identifier, content block identifier, text start position, character length, chapter, number of table rows and columns, table header type, and data dimension.

[0017] Furthermore, the method for obtaining the repeated semantic substring includes:

[0018] Based on the text content block, a BWT transformation is performed on the string to obtain a cyclic shift sequence of the string. The cyclic shift sequence is sorted lexicographically, and the last column of characters in the sorted sequence is extracted to obtain the BWT transformation sequence. The original string position index is recorded during the transformation process. A suffix array is constructed based on the BWT transformation sequence, and the longest common prefix array is calculated. The repetition degree of the repeating semantic substring is obtained based on the number of longest common prefixes. The repetition degree calculation formula is as follows:

[0019] ;

[0020] in The degree of repetition of the semantic substring. For the suffix array, the first , The length of the longest common prefix of the suffixes. The semantic weights of the substrings are obtained through a pre-trained industry-specific word vector model. This represents the total length of the text content block. The text content block string, The distance attenuation coefficient is obtained through linear regression fitting. This represents the difference in character offsets of the substring within the text content block.

[0021] If the repetition rate is greater than or equal to 0.2, it is determined to be a valid repeated semantic substring, the repeated characters are removed, and the position, repetition frequency and semantic category of the repeated semantic substring are marked to obtain a list of repeated semantic substrings.

[0022] Furthermore, the method for obtaining the text blocks includes:

[0023] Based on text content blocks, text segments containing the same core repetitive semantic substrings are aggregated into first-level blocks. The semantic aggregation weight of the text segments is calculated using the following formula:

[0024] ;

[0025] in For the first The semantic aggregation weights of each level of text chunks are used as input items. No. The degree of repetition of repeated semantic substrings. This represents the total number of repeating semantic substrings. The hierarchical decay coefficient is obtained by fitting the semantic similarity between parent and child blocks. For the first The number of levels in each block, For the first The character length of a repeating semantic substring. For the first The total character length of each level of text block;

[0026] Based on the core repeating substrings and semantic topics of the blocks, the first-level text blocks are split according to the subordinate relationship of the repeating semantic substrings. If there is no subordinate relationship, they are split according to the boundary of the complete semantic sentence. This forms a hierarchical index for the hierarchical text block annotation. The list of repeating semantic substrings and the metadata of the text content blocks are associated to obtain a structured hierarchical set of text blocks.

[0027] Furthermore, the method for obtaining the table information block includes:

[0028] Based on the row and column types of cells within a table content block, it is determined whether it is a standard horizontal table format. If it contains a serial number column, that column is removed. The average semantic similarity of cell content between data rows is calculated, and this average semantic similarity is used as the row semantic similarity. The average semantic similarity of cell content between data columns excluding the header row and the first column is used as the column semantic similarity. The formula for calculating semantic similarity is as follows:

[0029] ;

[0030] ;

[0031] in For line semantic similarity, For cells and The semantic similarity is expressed as cosine similarity. For the first Line number The content of the column cells, For the first Line number The content of the column cells, For cells and semantic similarity, For the first Line number The content of the column cells, For the first Line number The content of the column cells, For the number of rows in the table, For the number of columns in the table, For semantic similarity of columns;

[0032] If the row semantic similarity is less than a preset consistency threshold and the column semantic similarity is greater than or equal to the preset consistency threshold, then the table is a non-standard horizontal table and is transposed. The transposed standard format horizontal table is then evaluated using a row header column recognition algorithm to determine whether it contains a row header column. The formula for this algorithm is as follows:

[0033] ;

[0034] ;

[0035] in For the confidence level of the line, For cell content and the Column Name The semantic similarity function between them For the first Column header, It is a very small positive number. The average row head confidence level of the first column;

[0036] Calculate the row header confidence between the content of the first column cell and the headers of each column. If the average row header confidence of the first column in the entire table is greater than the preset confidence threshold, then the first column is determined to be a row header column. Traverse the table cells. If a row header column is identified, add the row header and column header text content to the cell content. If no row header column is identified, only add the column header text content to obtain the table information block.

[0037] Furthermore, the method for obtaining the vector index library includes:

[0038] Based on hierarchical text segmentation, semantic features are encoded into hierarchical text segments using a pre-trained industry word vector model to obtain fixed-dimensional semantic embedding vectors. Semantic features are encoded into table information blocks using a table pre-trained model, and a FAISS index is generated based on the semantic feature encoding.

[0039] Based on the metadata of text blocks and table information blocks, a block identity is generated using a hash algorithm. The semantic embedding vector and the metadata hash value are used as key-value pairs, which are then used as leaf nodes of a Merkle tree to generate intermediate node hashes. The aggregation formula for these intermediate node hashes is as follows:

[0040] ;

[0041] in The aggregate hash value of the intermediate node in the Merkle tree. For hash algorithms, The hash value of the left child node. This is the hash value of the right child node. Use modal type identifiers to distinguish between text blocks and table information blocks;

[0042] The encoded embedding vectors of semantic features and the Merkle tree are stored in the index library to obtain the vector index library.

[0043] Furthermore, the method for obtaining the similarity search information block includes:

[0044] The user's question text is input into a pre-trained industry-specific word vector model to obtain pure text semantic features. If the question text contains table intent keywords, the question is converted into a table semantic query. The query is then input into a lightweight table encoder to obtain a table semantic perception vector. The two-branch vectors are fused using an intent weight formula to obtain the query vector. The intent weight formula is as follows:

[0045] ;

[0046] in For query vector, Text intent weights, The data is based on pure text semantic features, and is dynamically adjusted according to the text intent probability of these features, with an adjustment range of 0.3-0.7. For L2 normalization, For table semantic awareness vectors, The table intent score is calculated based on the matching degree of the table intent keywords.

[0047] The cosine similarity between the query vector and the encoded embedding vector is calculated based on the vector index library. Candidate information blocks are extracted using nearest neighbor search based on the cosine similarity. The cosine similarity formula is:

[0048] ;

[0049] in query vector With information block cosine similarity, For the first The encoded embedding vector of each information block, The strength of the association between hashes and semantic vectors in an information block;

[0050] The Merkel path confidence score of the candidate information block is calculated using the following formula:

[0051] ;

[0052] in For information blocks Merkel path confidence For the first The hash consistency score of the Merkel path for each information block is 1 when it is completely consistent. This is the path level length. The attenuation coefficient is... Confidence level of search results;

[0053] Candidate information blocks with a confidence level greater than 0.85 in the Merkel path are used as similarity search information blocks.

[0054] Furthermore, the method for obtaining the context includes:

[0055] The text input sequence, consisting of user questions, text chunk content, and chunk metadata, is constructed based on similarity search information blocks and input into the BERT-TAPAS cross-encoder. The output is a basic text matching score, which is then corrected using a text chunk weighting formula. The text chunk weighting formula is as follows:

[0056] ;

[0057] in Score the text corrections. For the first text block The degree of repetition of repeated semantic substrings. To determine the effective number of repeating substrings, Hierarchical attenuation factor;

[0058] Based on similarity search information blocks, a table input sequence consisting of user questions, row headers, column headers, cells, and metadata is constructed. A basic table matching score is output using a BERT-TAPAS cross-encoder. The column semantic similarity of key columns is multiplied by the basic table matching score, and the product is used as the table correction score. A hybrid relevance reshuffling is performed on the text correction score and the table correction score of the similarity search information blocks. The scoring formula for this hybrid relevance reshuffling is as follows:

[0059] ;

[0060] in To score for rearrangement, The weighting coefficients are obtained based on the proportion of modal data. query vector With information block cosine similarity, The corrected score for the corresponding modal data;

[0061] The best matching information block is used as the context of the query vector based on the rearrangement score.

[0062] Furthermore, the methods for obtaining the answer include:

[0063] Based on the context, the corresponding leaf node in the Merkle tree is located according to the metadata hash value. Then, the root node of the Merkle tree is traced back sequentially from the leaf node to obtain the hash value of the intermediate node in the backtracking path, the block identifier associated with the node, and the modality type identifier, thereby generating the Merkle path.

[0064] The context encoding embedding vector is used as the semantic layer of the retrieval enhancement generation chain, the hash sequence of the Merkel path and the metadata are used as the verification layer of the retrieval enhancement generation chain, and the document identifier corresponding to the context information block is used as the association layer of the retrieval enhancement generation chain to obtain the retrieval enhancement generation chain.

[0065] Based on the context, a structured prompt template containing instruction descriptions, context placeholders, and question placeholders is constructed. The prompt template containing instructions and placeholders, Merkel paths, and retrieval enhancement generation chains are input into a preset large language model, and the decoded output contains the answer containing reference tags and a list of source files for related information blocks.

[0066] A second aspect of the present invention provides an enhanced question-answering system for retrieval of mixed-modal document content, comprising:

[0067] Data acquisition module: used to acquire mixed-modal documents of the target industry, preprocess the mixed-modal documents to obtain text content blocks and table content blocks, the mixed-modal documents include unstructured text and semi-structured tables;

[0068] Data partitioning module: used to perform BWT transformation on the strings of the text content block, identify repeated semantic substrings through the suffix array according to the transformation sequence, extract the row and column structure of the table content block, and obtain hierarchical text blocks and table information blocks;

[0069] Index library construction module: used to encode semantic features based on the text blocks and table information blocks, associate the encoded embedding vector with the metadata hash value of the block, generate a Merkle tree based on the hash value, and obtain a vector index library;

[0070] The retrieval module is used to obtain user questions and encode them into query vectors using a dual encoder. The query vectors are then used to perform similarity searches in the vector index. Similarity search information blocks are matched and scored using a cross encoder, and the best matching information block is used as the context of the query vector.

[0071] Answer generation module: Used to generate Merkle paths and retrieval enhancement generation chains corresponding to the context based on the Merkle tree, use the context as a prompt template, input the prompt template, Merkle paths and retrieval enhancement generation chains into a preset large language model, decode and output the answer containing reference tags and a list of source files with relevant information blocks.

[0072] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects:

[0073] This invention utilizes BWT transformation and suffix array identification to segment text and tables in mixed-modal documents. Dynamic segmentation based on semantic density aggregates recurring terminology definition paragraphs, reducing the possibility of key information being fragmented and improving recall accuracy. For table structures, it automatically identifies row headers and non-standard transposes by calculating row and column semantic similarity, preserving the original table structure information. This allows the model to understand structured queries such as those involving a specific column of data, mitigating the relationship loss problem caused by table linearization. By constructing a Merkle tree and generating path confidence, data integrity verification is shifted from post-filtering to pre-ranking weights, prioritizing low-risk blocks that have passed cryptographic verification, enhancing answer credibility. The combination of dual encoders for fast recall and cross-encoder for fine-grained matching achieves a partial balance between computational efficiency and semantic depth. Furthermore, an intent-aware query mechanism includes citation tags and a list of source files in the output, enhancing the traceability and verifiability of the answers. Attached Figure Description

[0074] Figure 1 This is a flowchart illustrating the steps of a retrieval enhancement question-answering method for mixed-modal document content in an embodiment of the present invention. Detailed Implementation

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

[0076] Reference Figure 1 As shown, this invention provides an enhanced question-answering method for retrieval of mixed-modal document content, including:

[0077] A. Obtain a hybrid modal document for the target industry, preprocess the hybrid modal document to obtain text content blocks and table content blocks, wherein the hybrid modal document includes unstructured text and semi-structured tables;

[0078] In the actual evaluation, the PDF document related to the 2024 centralized bulk procurement configuration standards for computers was selected. This document contained unstructured text including revenue analysis paragraphs, chapter descriptions, and annotations, totaling approximately 82,000 characters. The semi-structured tables included four quarterly configuration detail tables with merged cells, third-level headers, and revenue data linked across rows and columns. The minerU parsing command was used to convert the data to Markdown format. Conversion errors were corrected, headers, footers, and noise were removed, watermarks were removed, and duplicate headers on pages 10-12 were corrected. Invalid whitespace characters were removed, and the document was converted into a unified DOM structure. The text was split based on punctuation marks, chapter titles such as government procurement and enterprise operation, and metadata was labeled. The document was identified as 2024-GP-001, and the content blocks were identified as T1-001 to TB1-003. The "government procurement" text segment had 1200 characters and was split into two text content blocks according to the complete sentence boundary: T1-018, with 650 characters, and T1-019, with 550 characters. The T1-021 text block with a character recognition error rate of 6% was removed.

[0079] The table area was divided based on the table borders. Three invalid placeholder cells in the revenue details table were removed. The "Core Products" column of the merged cells was merged and restored to a standard row and column structure through coordinate mapping. The final table has 12 rows and 8 columns. Row and column indexes were added and metadata was labeled. The table is identified as TB2-001, with 12 rows and 8 columns. The table header type is a three-level header. The TB2-003 table block with a 7% missing row and column structure rate was removed. The character recognition error rate of the remaining blocks is less than 5%, and the missing row and column structure rate of the corresponding table is less than 3%.

[0080] B. Perform BWT transformation on the string of the text content block, identify repeated semantic substrings through the suffix array according to the transformation sequence, extract the row and column structure of the table content block, and obtain hierarchical text blocks and table information blocks.

[0081] In the actual evaluation, the strings such as "2.1・Desktop Computer Procurement Requirements Standard" in the T1-018 text block were subjected to BWT transformation to obtain a cyclic shift sequence and construct a suffix array. The LCP of the longest common prefix array was calculated to be 10, and the repetition rate was calculated to be 0.22, which was determined to be a valid repetitive semantic substring. A list was generated, in which the substring position is the 20th-32nd character, the repetition frequency is 2 times, the semantic category is procurement data, and the semantic weight of the substring is 0.95, which was obtained by the industry word vector model based on "core product procurement". The total length of the text content block is 650, and the distance decay coefficient is 0.02. ;

[0082] For table TB2-001, row and column semantic similarity are calculated. Rows 3 and 4 have a row semantic similarity of 0.72, below the preset threshold of 0.8. Cols 2 and 3 have a column semantic similarity of 0.91, greater than or equal to the preset threshold of 0.8. Therefore, they are classified as non-standard horizontal tables and transposed. The average row header confidence score calculated using the row header and column header recognition algorithm is 0.88, greater than or equal to the preset confidence threshold of 0.85. Therefore, the first column is identified as the row header column. Row and column header text is added to the cells. Cell C(1,2) contains 5000, with the row header "Configuration 1" and the column header "Budget Limit". The text description is "Budget Limit of Configuration 1". The text description, limited to 5000, is converted into a table information block with the corresponding metadata format {"title":"Table 2-1: Configuration Standard for Centralized Procurement of Desktop Computers","item":"Configuration 1","key":"Budget Limit","source":"2024 Computer Centralized Procurement Configuration Standard.pdf","publish_date":"2024-04-28"}. The text description "Budget Limit of Configuration 1" is generated, and the repeated semantic substring "Configuration 1" is associated. Finally, all generated text blocks and table information blocks are saved to a JSON format file.

[0083] C. Based on the text blocks and table information blocks, perform semantic feature encoding, associate the encoded embedding vector with the metadata hash value of the block, generate a Merkle tree based on the hash value, and obtain a vector index library;

[0084] In the actual evaluation, bge-large-zh-v1.5 was used to encode text blocks and table information blocks into 1024-dimensional vectors, where... An IVF index is constructed based on FAISS, with 100 clusters. SHA-256 hash values ​​are calculated for the metadata of text blocks and table information blocks, where the T1-018 hash value is 7e8d9f7a8b7c6d5e. The embedding vectors and hash values ​​are used as leaf nodes, and intermediate node hashes are generated according to the aggregation formula. Finally, a Merkle tree is generated. The semantic embedding vectors and Merkle tree are stored in the FAISS index library to form a vector index library, which contains vector and hash data of 42 text blocks and 3 table information blocks.

[0085] D. Obtain user questions and encode them into query vectors using a dual encoder. Use the query vectors to perform similarity searches in the vector index library. Match and score similarity search information blocks using a cross encoder, and use the best matching information block as the context of the query vector.

[0086] In actual evaluation, the user question "If both desktop and laptop computers are configured with configuration 5, which has a higher budget limit?" is input into the bge-large-zh-v1.5 model to obtain pure text semantic features. Because the question contains table intent keywords such as "budget" and "configuration," it is converted into a table semantic query and then input into a lightweight table encoder. The query is then fused according to the intent weight formula, where the text intent weight is 0.6 and the table intent matching degree is 0.88, generating a query vector. Based on the nearest neighbor search capability of the FAISS index, the basic cosine similarity is calculated, and the score is calculated using bge-reranker-large. The top-5 candidate information blocks C1, C2, C3, C4, and C5 are selected. Among them, C2 contains "...portable computer configuration 5...budget limit is 7000 yuan...". The Merkel path confidence of the candidate information blocks is verified in parallel. The confidence of T1-018 is 0.92 and that of TB2-001 is 0.91, both greater than 0.85. The candidate information block is retained. The candidate is input into the bge-reranker-large cross encoder, and the text correction score is calculated to be 0.17 and the table correction score is 0.80. After mixed relevance rearrangement, C1 and C2 are the best matching information blocks and are determined as context.

[0087] E. Generate the Merkle path and retrieval enhancement generation chain corresponding to the context based on the Merkle tree, use the context as a prompt template, input the prompt template, Merkle path and retrieval enhancement generation chain into a preset large language model, decode and output the answer containing reference tags and a list of source files with relevant information blocks.

[0088] In the actual evaluation, Merkel leaf node was located based on the hash value of TB2-001, the generation path was traced back, and a retrieval enhancement generation chain was constructed. The context semantic layer is an embedded vector plus a corrected score, the data verification layer is a hash sequence plus metadata error rate of 0.02, and the source file association layer is a document identifier 2024-Fin-001 plus a table identifier TB2-001. The Prompt prompt template was designed based on the context returned by the user query question Q and step D, and the RAG sequential execution chain was reconstructed. The basic large model Qwen2.5 was selected to receive input information, guide the large model to give the thinking and reasoning process, and generate the final answer based on the factual information block. The Prompt prompt template is "You are an expert assistant familiar with government procurement policies and business. Help the user understand the information by showing your thinking process and providing clear, cited answers."

[0089] You have now received a user question and need to design a draft answer that already includes references, taking into account the original context of the question.

[0090] Your task is to perform the following two steps:

[0091] 1. **Thinking Process**: First, please explain step by step how you will use the provided context and draft answer to construct a final, comprehensive answer. Please describe your reasoning process.

[0092] 2. **Final Answer**: Next, based on your thought process, generate a polished and easy-to-read final answer. Rewrite the draft answer into a smooth and coherent text. Convert inline citations `[source:policy file name, chunk:information block title]` into numbered footnotes (e.g., `[1]`, `[2]`). At the end of your answer, list all sources corresponding to the numbers.

[0093] The following information is provided to you:

[0094] **Original Context:**

[0095] {context}

[0096] **User Issues:**

[0097] {question}

[0098] Now, please provide your answer following the two-step structure described above (thought process and final answer). If the context is insufficient to answer, please say "I cannot answer based on the information available."

[0099] The context refers to the relevant policy guidelines, and the question is the user's query. For example, if both the desktop computer and the laptop computer are configured with configuration 5, which one has a higher budget limit?

[0100] The decoded output answer is that the budget limit for a portable computer with configuration 5 is 7000 yuan. [1] The budget limit for a desktop computer with configuration 5 is 5000 yuan. [2] Therefore, under the same configuration, the budget limit for portable computers is higher. [1]: Annex 2 Portable Computer Bulk Centralized Procurement Configuration Standard (2024 Edition), Information Block ID: C2 (TB1-002) Merkel Path: Leaf-8 (8f7e6d5c...) → 7a6b5c4d... → 9d8c7b6a..., [2]: Annex 1 Desktop Computer Bulk Centralized Procurement Configuration Standard - 2024 Edition, Information Block ID: C1 (T1-002) Merkel Path: Leaf-5 (6a5b4c3d...) → 6f5e4d3c... → 9d8c7b6a....

[0101] In this embodiment, the method for obtaining the mixed-modal document includes:

[0102] Obtain hybrid modal documents for the target industry. The hybrid modal documents include unstructured text and semi-structured tables. The unstructured text includes paragraph text, annotation text, chapter descriptions, and contextual descriptive content in the document. The semi-structured tables include merged cells, multi-level headers, statistical tables with cross-row and cross-column associations, parameter comparison tables, and data detail tables.

[0103] Remove watermarks, invalid whitespace characters, duplicate page numbers, and headers and footers from mixed-modal documents and convert them into a unified document object model structure. Split the normalized unstructured text based on punctuation marks, paragraph separators, and chapter titles to obtain text content blocks. Label the text content blocks with metadata. If the number of characters in a single semantic unit exceeds 1000, split it into multiple text content blocks according to the boundaries of complete sentences.

[0104] The plain text area and the table area are divided based on the table border. Empty cells and invalid placeholder cells in the table are removed. Merged cells and multi-level headers of the semi-structured table in the table area are restored to the standard row and column structure through cell coordinate mapping. Missing row and column indexes are added to the standard row and column structure. The header hierarchy information, cell values ​​and table titles are extracted to obtain the table content blocks. Metadata is marked on the table content blocks.

[0105] Based on the metadata, text content blocks and table content blocks with character recognition error rates and row / column structure missing rates exceeding 5% are removed to obtain a set of text content blocks and a set of table content blocks. The metadata includes document identifier, content block identifier, text start position, character length, chapter, number of table rows and columns, table header type, and data dimension.

[0106] In this embodiment, the method for obtaining the repeated semantic substring includes:

[0107] Based on the text content block, a BWT transformation is performed on the string to obtain a cyclic shift sequence of the string. The cyclic shift sequence is sorted lexicographically, and the last column of characters in the sorted sequence is extracted to obtain the BWT transformation sequence. The original string position index is recorded during the transformation process. A suffix array is constructed based on the BWT transformation sequence, and the longest common prefix array is calculated. The repetition degree of the repeating semantic substring is obtained based on the number of longest common prefixes. The repetition degree calculation formula is as follows:

[0108] ;

[0109] in The degree of repetition of the semantic substring. For the suffix array, the first , The length of the longest common prefix of the suffixes. The semantic weights of the substrings are obtained through a pre-trained industry-specific word vector model. This represents the total length of the text content block. The text content block string, The distance attenuation coefficient is obtained through linear regression fitting. This represents the difference in character offsets of the substring within the text content block.

[0110] If the repetition rate is greater than or equal to 0.2, it is determined to be a valid repeated semantic substring, the repeated characters are removed, and the position, repetition frequency and semantic category of the repeated semantic substring are marked to obtain a list of repeated semantic substrings.

[0111] In this embodiment, the method for obtaining the text blocks includes:

[0112] Based on text content blocks, text segments containing the same core repetitive semantic substrings are aggregated into first-level blocks. The semantic aggregation weight of the text segments is calculated using the following formula:

[0113] ;

[0114] in For the first The semantic aggregation weights of each level of text chunks are used as input items. No. The degree of repetition of repeated semantic substrings. This represents the total number of repeating semantic substrings. The hierarchical decay coefficient is obtained by fitting the semantic similarity between parent and child blocks. For the first The number of levels in each block, For the first The character length of a repeating semantic substring. For the first The total character length of each level of text block;

[0115] Based on the core repeating substrings and semantic topics of the blocks, the first-level text blocks are split according to the subordinate relationship of the repeating semantic substrings. If there is no subordinate relationship, they are split according to the boundary of the complete semantic sentence. This forms a hierarchical index for the hierarchical text block annotation. The list of repeating semantic substrings and the metadata of the text content blocks are associated to obtain a structured hierarchical set of text blocks.

[0116] In this embodiment, the method for obtaining the table information block includes:

[0117] Based on the row and column types of cells within a table content block, it is determined whether it is a standard horizontal table format. If it contains a serial number column, that column is removed. The average semantic similarity of cell content between data rows is calculated, and this average semantic similarity is used as the row semantic similarity. The average semantic similarity of cell content between data columns excluding the header row and the first column is used as the column semantic similarity. The formula for calculating semantic similarity is as follows:

[0118] ;

[0119] ;

[0120] in For line semantic similarity, For cells and The semantic similarity is expressed as cosine similarity. For the first Line number The content of the column cells, For the first Line number The content of the column cells, For cells and semantic similarity, For the first Line number The content of the column cells, For the first Line number The content of the column cells, The number of rows in the table. For the number of columns in the table, For column semantic similarity;

[0121] If the row semantic similarity is less than a preset consistency threshold and the column semantic similarity is greater than or equal to the preset consistency threshold, then the table is a non-standard horizontal table and is transposed. The transposed standard format horizontal table is then evaluated using a row header column recognition algorithm to determine whether it contains a row header column. The formula for this algorithm is as follows:

[0122] ;

[0123] ;

[0124] in For the confidence level of the line, For cell content and the Column Name The semantic similarity function between them For the first Column header, It is a very small positive number. The average row head confidence level of the first column;

[0125] Calculate the row header confidence between the content of the first column cell and the headers of each column. If the average row header confidence of the first column in the entire table is greater than the preset confidence threshold, then the first column is determined to be a row header column. Traverse the table cells. If a row header column is identified, add the row header and column header text content to the cell content. If no row header column is identified, only add the column header text content to obtain the table information block.

[0126] In this embodiment, the method for obtaining the vector index library includes:

[0127] Based on hierarchical text segmentation, semantic features are encoded into hierarchical text segments using a pre-trained industry word vector model to obtain fixed-dimensional semantic embedding vectors. Semantic features are encoded into table information blocks using a table pre-trained model, and a FAISS index is generated based on the semantic feature encoding.

[0128] Based on the metadata of text blocks and table information blocks, a block identity is generated using a hash algorithm. The semantic embedding vector and the metadata hash value are used as key-value pairs, which are then used as leaf nodes of a Merkle tree to generate intermediate node hashes. The aggregation formula for these intermediate node hashes is as follows:

[0129] ;

[0130] in The aggregate hash value of the intermediate node in the Merkle tree. For hash algorithms, The hash value of the left child node. This is the hash value of the right child node. Use modal type identifiers to distinguish between text blocks and table information blocks;

[0131] The encoded embedding vectors of semantic features and the Merkle tree are stored in the index library to obtain the vector index library.

[0132] In this embodiment, the method for obtaining the similarity search information block includes:

[0133] The user's question text is input into a pre-trained industry-specific word vector model to obtain pure text semantic features. If the question text contains table intent keywords, the question is converted into a table semantic query. The query is then input into a lightweight table encoder to obtain a table semantic perception vector. The two-branch vectors are fused using an intent weight formula to obtain the query vector. The intent weight formula is as follows:

[0134] ;

[0135] in For query vector, Text intent weights, The data is based on pure text semantic features, and is dynamically adjusted according to the text intent probability of these features, with an adjustment range of 0.3-0.7. For L2 normalization, For table semantic awareness vectors, The table intent score is calculated based on the matching degree of the table intent keywords.

[0136] The cosine similarity between the query vector and the encoded embedding vector is calculated based on the vector index library. Candidate information blocks are extracted using nearest neighbor search based on the cosine similarity. The cosine similarity formula is:

[0137] ;

[0138] in query vector With information block cosine similarity, For the first The encoded embedding vector of each information block, The strength of the association between hashes and semantic vectors in an information block;

[0139] The Merkel path confidence score of the candidate information block is calculated using the following formula:

[0140] ;

[0141] in For information blocks Merkel path confidence For the first The hash consistency score of the Merkel path for each information block is 1 when it is completely consistent. This is the path level length. The attenuation coefficient is... Confidence level of search results;

[0142] Candidate information blocks with a confidence level greater than 0.85 in the Merkel path are used as similarity search information blocks.

[0143] In this embodiment, the method for obtaining the context includes:

[0144] The text input sequence, consisting of user questions, text chunk content, and chunk metadata, is constructed based on similarity search information blocks and input into the BERT-TAPAS cross-encoder. The output is a basic text matching score, which is then corrected using a text chunk weighting formula. The text chunk weighting formula is as follows:

[0145] ;

[0146] in Score the text corrections. For the first text block The degree of repetition of repeated semantic substrings. To determine the effective number of repeating substrings, Hierarchical attenuation factor;

[0147] Based on similarity search information blocks, a table input sequence consisting of user questions, row headers, column headers, cells, and metadata is constructed. A basic table matching score is output using a BERT-TAPAS cross-encoder. The column semantic similarity of key columns is multiplied by the basic table matching score, and the product is used as the table correction score. A hybrid relevance reshuffling is performed on the text correction score and the table correction score of the similarity search information blocks. The scoring formula for this hybrid relevance reshuffling is as follows:

[0148] ;

[0149] in To score for rearrangement, The weighting coefficients are obtained based on the proportion of modal data. query vector With information block cosine similarity, The corrected score for the corresponding modal data;

[0150] The best matching information block is used as the context of the query vector based on the reordering score.

[0151] In this embodiment, the method for obtaining the answer includes:

[0152] Based on the context, the corresponding leaf node in the Merkle tree is located according to the metadata hash value. Then, the root node of the Merkle tree is traced back sequentially from the leaf node to obtain the hash value of the intermediate node in the backtracking path, the block identifier associated with the node, and the modality type identifier, thereby generating the Merkle path.

[0153] The context encoding embedding vector is used as the semantic layer of the retrieval enhancement generation chain, the hash sequence of the Merkel path and the metadata are used as the verification layer of the retrieval enhancement generation chain, and the document identifier corresponding to the context information block is used as the association layer of the retrieval enhancement generation chain to obtain the retrieval enhancement generation chain.

[0154] Based on the context, a structured prompt template containing instruction descriptions, context placeholders, and question placeholders is constructed. The prompt template containing instructions and placeholders, Merkel paths, and retrieval enhancement generation chains are input into a preset large language model, and the decoded output contains the answer containing reference tags and a list of source files for related information blocks.

[0155] A second aspect of the present invention also provides an enhanced question-answering system for retrieval of mixed-modal document content, comprising:

[0156] Data acquisition module: used to acquire mixed-modal documents of the target industry, preprocess the mixed-modal documents to obtain text content blocks and table content blocks, the mixed-modal documents include unstructured text and semi-structured tables;

[0157] Data partitioning module: used to perform BWT transformation on the strings of the text content block, identify repeated semantic substrings through the suffix array according to the transformation sequence, extract the row and column structure of the table content block, and obtain hierarchical text blocks and table information blocks;

[0158] Index library construction module: used to encode semantic features based on the text blocks and table information blocks, associate the encoded embedding vector with the metadata hash value of the block, generate a Merkle tree based on the hash value, and obtain a vector index library;

[0159] The retrieval module is used to obtain user questions and encode them into query vectors using a dual encoder. The query vectors are then used to perform similarity searches in the vector index. Similarity search information blocks are matched and scored using a cross encoder, and the best matching information block is used as the context of the query vector.

[0160] Answer generation module: Used to generate Merkle paths and retrieval enhancement generation chains corresponding to the context based on the Merkle tree, use the context as a prompt template, input the prompt template, Merkle paths and retrieval enhancement generation chains into a preset large language model, decode and output the answer containing reference tags and a list of source files with relevant information blocks.

[0161] The above description is merely an example and illustration of the structure of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described, or use similar methods to replace them, as long as they do not deviate from the structure of the invention or exceed the scope defined in the claims, all of which should fall within the protection scope of the present invention.

Claims

1. A retrieval enhancement question-answering method for mixed-modal document content, characterized in that, Includes the following steps: A. Obtain a hybrid modal document for the target industry, preprocess the hybrid modal document to obtain text content blocks and table content blocks, wherein the hybrid modal document includes unstructured text and semi-structured tables; B. Perform BWT transformation on the string of the text content block, identify repeated semantic substrings through the suffix array according to the transformation sequence, extract the row and column structure of the table content block, and obtain hierarchical text blocks and table information blocks. C. Based on the text blocks and table information blocks, perform semantic feature encoding, associate the encoded embedding vector with the metadata hash value of the block, generate a Merkle tree based on the hash value, and obtain a vector index library; D. Obtain user questions and encode them into query vectors using a dual encoder. Use the query vectors to perform similarity searches in the vector index library. Match and score similarity search information blocks using a cross encoder, and use the best matching information block as the context of the query vector. E. Generate the Merkle path and retrieval enhancement generation chain corresponding to the context based on the Merkle tree, use the context as a prompt template, input the prompt template, Merkle path and retrieval enhancement generation chain into a preset large language model, decode and output the answer containing reference tags and a list of source files with relevant information blocks.

2. The retrieval enhancement question-answering method for mixed-modal document content according to claim 1, characterized in that, The method for obtaining the mixed-modal document includes: Obtain hybrid modal documents for the target industry. The hybrid modal documents include unstructured text and semi-structured tables. The unstructured text includes paragraph text, annotation text, chapter descriptions, and contextual descriptive content in the document. The semi-structured tables include merged cells, multi-level headers, statistical tables with cross-row and cross-column associations, parameter comparison tables, and data detail tables. Remove watermarks, invalid whitespace characters, duplicate page numbers, and headers and footers from mixed-modal documents and convert them into a unified document object model structure. Split the normalized unstructured text based on punctuation marks, paragraph separators, and chapter titles to obtain text content blocks. Label the text content blocks with metadata. If the number of characters in a single semantic unit exceeds 1000, split it into multiple text content blocks according to the boundaries of complete sentences. The plain text area and the table area are divided based on the table border. Empty cells and invalid placeholder cells in the table are removed. Merged cells and multi-level headers of the semi-structured table in the table area are restored to the standard row and column structure through cell coordinate mapping. Missing row and column indexes are added to the standard row and column structure. The header hierarchy information, cell values ​​and table titles are extracted to obtain the table content blocks. Metadata is marked on the table content blocks. Based on the metadata, text content blocks and table content blocks with character recognition error rates and row / column structure missing rates exceeding 5% are removed to obtain a set of text content blocks and a set of table content blocks. The metadata includes document identifier, content block identifier, text start position, character length, chapter, number of table rows and columns, table header type, and data dimension.

3. The retrieval enhancement question-answering method for mixed-modal document content according to claim 1, characterized in that, The method for obtaining the repeated semantic substring includes: Based on the text content block, a BWT transformation is performed on the string to obtain a cyclic shift sequence of the string. The cyclic shift sequence is sorted lexicographically, and the last column of characters in the sorted sequence is extracted to obtain the BWT transformation sequence. The original string position index is recorded during the transformation process. A suffix array is constructed based on the BWT transformation sequence, and the longest common prefix array is calculated. The repetition degree of the repeating semantic substring is obtained based on the number of longest common prefixes. The repetition degree calculation formula is as follows: ; in The degree of repetition of the semantic substring. For the suffix array, the first , The length of the longest common prefix of the suffixes. The semantic weights of the substrings are obtained through a pre-trained industry-specific word vector model. This represents the total length of the text content block. The text content block string, The distance attenuation coefficient is obtained through linear regression fitting. This represents the difference in character offsets of the substring within the text content block. If the repetition rate is greater than or equal to 0.2, it is determined to be a valid repeated semantic substring, the repeated characters are removed, and the position, repetition frequency and semantic category of the repeated semantic substring are marked to obtain a list of repeated semantic substrings.

4. The retrieval enhancement question-answering method for mixed-modal document content according to claim 1, characterized in that, The method for obtaining the text blocks includes: Based on text content blocks, text segments containing the same core repetitive semantic substrings are aggregated into first-level blocks. The semantic aggregation weight of the text segments is calculated using the following formula: ; in For the first The semantic aggregation weights of each level of text chunks are used as input items. No. The degree of repetition of repeated semantic substrings. This represents the total number of repeating semantic substrings. The hierarchical decay coefficient is obtained by fitting the semantic similarity between parent and child blocks. For the first The number of levels in each block, For the first The character length of a repeating semantic substring. For the first The total character length of each level of text block; Based on the core repeating substrings and semantic topics of the blocks, the first-level text blocks are split according to the subordinate relationship of the repeating semantic substrings. If there is no subordinate relationship, they are split according to the boundary of the complete semantic sentence. This forms a hierarchical index for the hierarchical text block annotation. The list of repeating semantic substrings and the metadata of the text content blocks are associated to obtain a structured hierarchical set of text blocks.

5. The retrieval enhancement question-answering method for mixed-modal document content according to claim 1, characterized in that, The method for obtaining the table information block includes: Based on the row and column types of cells within a table content block, it is determined whether it is a standard horizontal table format. If it contains a serial number column, that column is removed. The average semantic similarity of cell content between data rows is calculated, and this average semantic similarity is used as the row semantic similarity. The average semantic similarity of cell content between data columns excluding the header row and the first column is used as the column semantic similarity. The formula for calculating semantic similarity is as follows: ; ; in For line semantic similarity, For cells and The semantic similarity is expressed as cosine similarity. For the first Line number The content of the column cells, For the first Line number The content of the column cells, For cells and semantic similarity, For the first Line number The content of the column cells, For the first Line number The content of the column cells, For the number of rows in the table, For the number of columns in the table, For semantic similarity of columns; If the row semantic similarity is less than a preset consistency threshold and the column semantic similarity is greater than or equal to the preset consistency threshold, then the table is a non-standard horizontal table and is transposed. The transposed standard format horizontal table is then evaluated using a row header column recognition algorithm to determine whether it contains a row header column. The formula for this algorithm is as follows: ; ; in For the confidence level of the line, For cell content and the Column Name The semantic similarity function between them For the first Column header, It is a very small positive number. The average row head confidence level of the first column; Calculate the row header confidence between the content of the first column cell and the headers of each column. If the average row header confidence of the first column in the entire table is greater than the preset confidence threshold, then the first column is determined to be a row header column. Traverse the table cells. If a row header column is identified, add the row header and column header text content to the cell content. If no row header column is identified, only add the column header text content to obtain the table information block.

6. The retrieval enhancement question-answering method for mixed-modal document content according to claim 1, characterized in that, The method for obtaining the vector index library includes: Based on hierarchical text segmentation, semantic features are encoded into hierarchical text segments using a pre-trained industry word vector model to obtain fixed-dimensional semantic embedding vectors. Semantic features are encoded into table information blocks using a table pre-trained model, and a FAISS index is generated based on the semantic feature encoding. Based on the metadata of text blocks and table information blocks, a block identity is generated using a hash algorithm. The semantic embedding vector and the metadata hash value are used as key-value pairs, which are then used as leaf nodes of a Merkle tree to generate intermediate node hashes. The aggregation formula for these intermediate node hashes is as follows: ; in The aggregate hash value of the intermediate node in the Merkle tree. For hash algorithms, The hash value of the left child node. This is the hash value of the right child node. Use modal type identifiers to distinguish between text blocks and table information blocks; The encoded embedding vectors of semantic features and the Merkle tree are stored in the index library to obtain the vector index library.

7. The retrieval enhancement question-answering method for mixed-modal document content according to claim 1, characterized in that, The method for obtaining the similarity search information block includes: The user's question text is input into a pre-trained industry-specific word vector model to obtain pure text semantic features. If the question text contains table intent keywords, the question is converted into a table semantic query. The query is then input into a lightweight table encoder to obtain a table semantic perception vector. The two-branch vectors are fused using an intent weight formula to obtain the query vector. The intent weight formula is as follows: ; in For query vector, Text intent weights, The data is based on pure text semantic features, and is dynamically adjusted according to the text intent probability of these features, with an adjustment range of 0.3-0.

7. For L2 normalization, For table semantic awareness vectors, The table intent score is calculated based on the matching degree of the table intent keywords. The cosine similarity between the query vector and the encoded embedding vector is calculated based on the vector index library. Candidate information blocks are extracted using nearest neighbor search based on the cosine similarity. The cosine similarity formula is: ; in query vector With information block cosine similarity, For the first The encoded embedding vector of each information block, The strength of the association between hashes and semantic vectors in an information block; The Merkel path confidence score of the candidate information block is calculated using the following formula: ; in For information blocks Merkel path confidence For the first The hash consistency score of the Merkel path for each information block is 1 when it is completely consistent. This is the path level length. The attenuation coefficient is... Confidence level of search results; Candidate information blocks with a confidence level greater than 0.85 in the Merkel path are used as similarity search information blocks.

8. The retrieval enhancement question-answering method for mixed-modal document content according to claim 1, characterized in that, The method for obtaining the context includes: The text input sequence, consisting of user questions, text chunk content, and chunk metadata, is constructed based on similarity search information blocks and input into the BERT-TAPAS cross-encoder. The output is a basic text matching score, which is then corrected using a text chunk weighting formula. The text chunk weighting formula is as follows: ; in Score the text corrections. For the first text block The degree of repetition of repeated semantic substrings. To determine the effective number of repeating substrings, Hierarchical attenuation factor; Based on similarity search information blocks, a table input sequence consisting of user questions, row headers, column headers, cells, and metadata is constructed. A basic table matching score is output using a BERT-TAPAS cross-encoder. The column semantic similarity of key columns is multiplied by the basic table matching score, and the product is used as the table correction score. A hybrid relevance reshuffling is performed on the text correction score and the table correction score of the similarity search information blocks. The scoring formula for this hybrid relevance reshuffling is as follows: ; in To score for rearrangement, The weighting coefficients are obtained based on the proportion of modal data. query vector With information block cosine similarity, The corrected score for the corresponding modal data; The best matching information block is used as the context of the query vector based on the reordering score.

9. The retrieval enhancement question-answering method for mixed-modal document content according to claim 1, characterized in that, Methods for obtaining the answer include: Based on the context, the corresponding leaf node in the Merkle tree is located according to the metadata hash value. Then, the root node of the Merkle tree is traced back sequentially from the leaf node to obtain the hash value of the intermediate node in the backtracking path, the block identifier associated with the node, and the modality type identifier, thereby generating the Merkle path. The context encoding embedding vector is used as the semantic layer of the retrieval enhancement generation chain, the hash sequence of the Merkel path and the metadata are used as the verification layer of the retrieval enhancement generation chain, and the document identifier corresponding to the context information block is used as the association layer of the retrieval enhancement generation chain to obtain the retrieval enhancement generation chain. Based on the context, a structured prompt template containing instruction descriptions, context placeholders, and question placeholders is constructed. The prompt template containing instructions and placeholders, Merkel paths, and retrieval enhancement generation chains are input into a preset large language model, and the decoded output contains the answer containing reference tags and a list of source files for related information blocks.

10. A retrieval enhancement question-answering system for mixed-modal document content, used to execute the retrieval enhancement question-answering method for mixed-modal document content as described in any one of claims 1 to 9, characterized in that, The system includes: Data acquisition module: used to acquire mixed-modal documents of the target industry, preprocess the mixed-modal documents to obtain text content blocks and table content blocks, the mixed-modal documents include unstructured text and semi-structured tables; Data partitioning module: used to perform BWT transformation on the strings of the text content block, identify repeated semantic substrings through the suffix array according to the transformation sequence, extract the row and column structure of the table content block, and obtain hierarchical text blocks and table information blocks; Index library construction module: used to encode semantic features based on the text blocks and table information blocks, associate the encoded embedding vector with the metadata hash value of the block, generate a Merkle tree based on the hash value, and obtain a vector index library; The retrieval module is used to obtain user questions and encode them into query vectors using a dual encoder. The query vectors are then used to perform similarity searches in the vector index. Similarity search information blocks are matched and scored using a cross encoder, and the best matching information block is used as the context of the query vector. Answer generation module: Used to generate Merkle paths and retrieval enhancement generation chains corresponding to the context based on the Merkle tree, use the context as a prompt template, input the prompt template, Merkle paths and retrieval enhancement generation chains into a preset large language model, decode and output the answer containing reference tags and a list of source files with relevant information blocks.