RAG-based cross-document table generation system and method
Through the RAG-based cross-document table generation system, the problems of low efficiency and accuracy in table generation for multi-source heterogeneous financial data are solved, and efficient and accurate financial data integration and table generation are achieved to meet the complex scenario requirements in the financial field.
Patent Information
- Application Number
- CN202510630160.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-09-16
AI Technical Summary
In the financial field of multi-source heterogeneous data, existing technologies have low table generation efficiency and are difficult to meet the accuracy requirements of complex scenarios. In particular, when building knowledge graphs, the computing resources and time costs are high, and system development and maintenance are difficult.
A RAG-based cross-document table generation system is adopted, including a cross-document information retrieval and fusion module, an intermediate Json Schema construction module and a large language model. Through multiple rounds of query generation mechanism and Json Schema optimization, customized tables that comply with financial regulations are generated.
It has achieved efficient integration of multi-source heterogeneous financial data and rapid generation of structured tables, significantly improving the efficiency and accuracy of financial data processing, reducing the cost of data integration and report generation, and improving the efficiency of financial business data analysis and decision-making.
Smart Images

Figure CN120654672A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of financial data integration, and in particular to a cross-document table generation system based on RAG. Background Art
[0002] In the existing financial field, there are pain points such as difficulty in integrating multi-source heterogeneous data, low efficiency in financial report generation, and complex relationship verification.
[0003] A common approach in existing technologies is to extract tables from text using triples (subject, predicate, object). This approach uses natural language processing techniques to identify entities and relationships in text and convert them into structured triples. However, this approach relies on predefined rules or templates, which limits its ability to extract information from complex documents. This is particularly true when dealing with multi-source, heterogeneous data, where efficiency and accuracy decline significantly.
[0004] One existing technology is to generate a knowledge graph from text and then generate a table through a hybrid indexing method. This method first uses natural language processing technology to convert unstructured text into a structured knowledge graph, and then combines the node and edge information in the graph to generate the target table using a hybrid indexing algorithm. Compared with the triple method, this method can better capture the semantic relationships in the text and is suitable for more complex scenarios. However, this method also has some problems. First, the process of building a knowledge graph requires high computing resources and time costs, especially when processing large-scale documents, the efficiency is low. Second, the generation of the knowledge graph depends on high-quality training data and predefined ontology models, which increases the difficulty of system development and maintenance. Therefore, in practical applications, the promotion of this method is subject to certain limitations. Summary of the Invention
[0005] The technical problem to be solved by the embodiments of the present invention is to provide a cross-document table generation system and method based on RAG, so as to achieve efficient generation and precise optimization of tables in the financial field.
[0006] In order to solve the above technical problems, the embodiment of the present invention proposes a cross-document table generation system based on RAG, which includes a cross-document information retrieval and fusion module, an intermediate Json Schema construction module, and a large language model for generating customized tables in the financial field, wherein: The cross-document information retrieval and fusion module initially retrieves the corresponding semantic information from the financial documents for the table to be generated. Based on the retrieval results and user feedback, it uses a multi-round query generation mechanism to dynamically generate new query statements, searches the financial documents again, sorts and filters the results of the two retrievals, and then integrates them to form structured input data. The intermediate Json Schema construction module builds the Json Schema format suitable for table generation; The large language model generates customized tables based on the input data.
[0007] Accordingly, an embodiment of the present invention further provides a method for generating a cross-document table based on RAG, comprising: Model building steps: Build a large language model for generating customized tables in the financial field; Cross-document information retrieval and fusion steps: Initially retrieve the corresponding semantic information from the financial documents for the table to be generated. Based on the retrieval results and user feedback, a multi-round query generation mechanism is used to dynamically generate new query statements. The financial documents are searched again. The results of the two searches are sorted and filtered, and then integrated to form structured input data. Intermediate Json Schema construction step: Construct a Json Schema format suitable for table generation; Table generation step: Input data into the large language model to generate a customized table.
[0008] The beneficial effects of the present invention are: it can efficiently integrate multi-source heterogeneous financial data and quickly generate structured financial tables, such as financial statements, risk assessment tables, and investment analysis tables, significantly improving the efficiency of financial data processing. By constructing a financial semantic retrieval network and a dedicated table modeling mechanism, the present invention accurately extracts key information from financial documents and generates tables that comply with financial standards. This reduces the cost of data integration and report generation, improves the efficiency of financial business data analysis and decision-making, and helps financial institutions achieve intelligent data management and business innovation. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 4 is a schematic structural diagram of a cross-document table generation system based on RAG according to an embodiment of the present invention. DETAILED DESCRIPTION
[0010] It should be noted that, unless there is a conflict, the embodiments in this application and the features in the embodiments can be combined with each other. The present invention is further described in detail below with reference to the drawings and specific embodiments.
[0011] In the embodiments of the present invention, if there are directional indications (such as up, down, left, right, front, back, etc.), they are only used to explain the relative position relationship and movement status of the various components under a specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0012] In addition, the terms "first," "second," and so on, used in this disclosure are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Therefore, features specified as "first" or "second" may explicitly or implicitly include at least one of these features.
[0013] Please refer to Figure 1 The cross-document table generation system based on RAG (Retrieval-Augmented Generation; RAG combines the retrieval module with the generation module to achieve collaborative optimization of information retrieval and semantic generation) in an embodiment of the present invention includes a data processing module, a cross-document information retrieval and fusion module, an intermediate Json Schema (a specification for describing and validating JSON data structures. It defines the format, type, attributes, and constraints of JSON data to ensure that the data meets the expected standards and facilitates data exchange and processing) construction module, a customized table generation module, a table generation post-processing and optimization module, and a large language model for generating customized tables in the financial field.
[0014] The large language model can use the open source model of the Qwen series. The large language model generates a customized table based on the input data.
[0015] The data processing module collects financial documents in the financial field, annotates them, formats them, removes noise data, performs semantic segmentation, constructs a task training set, and trains a large language model based on the data in the task training set. As an implementation method, the data processing module includes: Data Collection: Build high-quality cross-document table data sets in the financial field, capture financial reports from financial websites, obtain announcements from stock exchanges, collect research reports from financial research institutions, and other multi-source financial documents, covering multiple financial sub-sectors such as banking, securities, and insurance, to ensure data diversity and richness.
[0016] Data annotation: Collected financial documents are annotated, marking table fields such as financial indicators, company names, and transaction dates, clarifying their row and column positions within the table and their semantic relationships with other fields. For example, in financial report documents, fields such as total assets, total liabilities, and net profit are annotated, along with their specific locations and relationships within the balance sheet and income statement, to generate annotated data for training.
[0017] Data preprocessing: Format financial document data and convert documents of different formats into a unified text format, such as converting PDF financial reports into editable text files; remove noise data, including irrelevant advertising information, incorrect character encoding, etc.; perform semantic segmentation and divide financial documents into different paragraphs according to chapters (such as balance sheets, income statements, cash flow statements, etc.) to better understand and process them, ensure data quality and consistency, and provide high-quality input data for subsequent model training.
[0018] This paper constructs a high-quality, cross-document financial dataset covering multiple financial sub-sectors, including banking, securities, and insurance, providing a rich and multidimensional corpus foundation for model evaluation. This helps the model accurately learn the characteristic patterns of the financial sector and significantly improves its generalization ability in this field.
[0019] The cross-document information retrieval and fusion module preliminarily retrieves the corresponding semantic information from the financial documents of the table to be generated. Based on the retrieval results and user feedback, it uses a multi-round query generation mechanism to dynamically generate new query statements, searches again from the financial documents, sorts and filters the results of the two retrievals, and then integrates them to form structured input data.
[0020] As an implementation method, the cross-document information retrieval and fusion module includes: Semantic Retrieval Module Development: Based on the Qwen open-source model, a financial semantic retrieval module was developed. By fine-tuning the model, it can understand the semantic information of financial documents and, based on the input query, retrieve semantic information related to the target table from large-scale financial document datasets. For example, when querying a company's financial status, key information from the company's financial reports at different time points can be retrieved.
[0021] Multi-round query generation mechanism: A multi-round query generation mechanism is designed to dynamically generate new query statements based on initial query results and user feedback, further extracting cross-document semantic information. If the initial query results are not accurate or comprehensive enough, the system generates more specific or broader query statements based on existing information and user needs, such as "What are the specific items of current assets in a company's balance sheet over the past three years?" to obtain more precise semantic information and improve the quality and relevance of search results.
[0022] Search result sorting and filtering: Retrieval results are sorted and filtered based on factors such as semantic relevance and information authority, prioritizing high-quality contextual information and filtering out irrelevant or low-quality information. For example, when generating financial analysis spreadsheets, financial data from authoritative financial websites is prioritized, while unofficial or inaccurate financial interpretations are filtered out to ensure the high quality and reliability of the contextual information input into the model.
[0023] Information Fusion: Integrate retrieved information from multiple documents to form a structured generation mechanism. By fusing and summarizing relevant information from different financial documents, key semantic information and data are extracted, providing high-quality input for subsequent form generation. When generating investment analysis forms in the financial sector, relevant content from multiple research reports is integrated to extract key information such as fundamental analysis, technical analysis, and risk assessment of the investment target. This structured input data is then used to generate accurate and complete investment analysis forms.
[0024] This invention efficiently extracts semantic information related to the target table through cross-document information retrieval and fusion, and adopts a multi-round query generation mechanism and sorting and filtering to ensure high-quality context input, so that the model has accurate information support when generating financial tables.
[0025] The intermediate Json Schema construction module constructs a Json Schema format suitable for table generation. As an embodiment, the intermediate Json Schema construction module includes: Json Schema Construction: Following the cross-document information retrieval and fusion module, the intermediate Json Schema construction module is introduced. This module further organizes and normalizes the fused information, constructing a Json Schema format suitable for table generation. Json Schema defines the data structure and constraints required for table generation, including field names, data types, and relationships between fields. For example, in the financial sector, when generating financial statements, the Json Schema can define total assets as a numeric type, with a cross-reference relationship between total liabilities and total owner's equity.
[0026] JSON Schema Optimization: We optimize the JSON Schema based on the professional requirements and standards of the financial field and the knowledge base of financial experts. For example, we ensure that the field order in the JSON Schema conforms to the standard format of financial reports, that the data types are consistent with the characteristics of financial data, and that the constraints between fields are accurate. This optimization provides more precise and standardized guidance for subsequent table generation.
[0027] As an implementation method, the customized table generation module includes: Large language model fine-tuning: Large language models (such as the Qwen series) are fine-tuned to adapt them for table generation tasks in the financial sector. During fine-tuning, high-quality annotated data covering financial sub-sectors such as banking, securities, and insurance is used to enable the model to learn the structural and semantic characteristics of tables in different financial sectors and generate customized tables that conform to logical and structural standards. For example, the model can generate financial statements that comply with accounting standards and risk reports that meet financial regulatory requirements.
[0028] Table-structured modeling mechanism: This introduces a table-structured modeling mechanism, modeling the logical relationships between rows and columns through an attention mechanism. When generating balance sheets in the financial sector, the model uses this attention mechanism to understand the logical relationships between columns such as assets, liabilities, and owner's equity, as well as the order and relevance of items. Table generation constraints are designed based on financial domain expertise and intermediate JSON schemas. For example, in financial statement tables, the order and data type specifications for asset, liability, and owner's equity items are specified to ensure that the generated tables meet professional financial requirements and standards.
[0029] User-customized control: This feature allows users to customize the structure and content of a table based on their needs. Users can enter commands to specify table fields, row and column order, data format, and other requirements, and the system will generate the corresponding table based on the user's customized requirements. For example, when generating financial analysis tables in the financial sector, users can customize the financial indicators, data sources, time range, and other aspects of the table based on their analysis needs.
[0030] The present invention can customize the table structure content according to the needs of financial professionals, provide real-time feedback optimization, and meet personalized needs.
[0031] As an implementation method, the table generation post-processing and optimization module includes: Consistency Verification: Develop a consistency verification algorithm to compare the generated table with the original document content. Verify that the information in the generated table is consistent with the original document through field matching and data verification. If there is an inconsistency, handle it according to the inconsistency: 1. Minor inconsistencies: When there are minor inconsistencies in data format, capitalization, punctuation, etc., they can be handled through automatic conversion or correction.
[0032] 2. Missing or redundant data: If you find missing or redundant data in the generated table, you need to further analyze the cause. For missing data, you can try to extract and supplement it from the original document; for redundant data, you can delete or retain it according to business rules.
[0033] 3. Severe inconsistency (less likely): When serious inconsistencies occur, such as data logic errors or data type mismatches, manual intervention is required. The inconsistencies are marked and the extraction process is repeated.
[0034] Format Optimization: Optimizes the row and column layout of generated tables, automatically adjusting the order and proportion of rows and columns based on the table content and semantic logic, making the table layout more reasonable and clear. Optimize field alignment to ensure that data in different rows of the same field is aligned, improving table readability.
[0035] Structural optimization: Further improve the structuring of the table by standardizing the hierarchical relationship of the table, merging cells, and other operations to make the table structure clearer and more standardized.
[0036] This invention verifies the consistency of generated tables with the original document, optimizes format layout and structure, and ensures that the tables are both aesthetically pleasing and practical while complying with financial regulations. This technology promotes the application of innovative technologies, provides a powerful driving force for efficient and accurate table processing in the financial sector, enhances the industry's intelligence level, and facilitates the efficient utilization and management of financial document information.
[0037] The present invention can better meet the actual needs of financial companies in terms of data processing efficiency and generation quality. When processing complex financial document structures or cross-document associations, traditional semantic retrieval models may not be able to fully capture the deep-level logical relationships, especially when faced with multiple nested fields or implicit associations, resulting in inconsistent or missing results. In specific implementations, a collaborative framework based on LLM (Large Language Model) and Agent can also be introduced. Specifically, the Agent can be responsible for task decomposition and coordination, breaking down complex table generation tasks into multiple subtasks and calling the LLM to perform specific semantic analysis, field extraction, and structure optimization. In addition, by introducing external tools (such as knowledge graphs or visual models), the processing capabilities of unstructured data can be further enhanced, thereby improving the accuracy and completeness of the generated results.
[0038] By directly utilizing the trained semantic retrieval model and table generation module, the present invention can reduce time and economic costs while still providing high generation quality and confidence, and is therefore more suitable for current actual financial application scenarios.
[0039] The RAG-based cross-document table generation method of an embodiment of the present invention includes: Model building steps: Build a large language model for generating customized tables in the financial field; Cross-document information retrieval and fusion steps: Initially retrieve the corresponding semantic information from the financial documents for the table to be generated. Based on the retrieval results and user feedback, a multi-round query generation mechanism is used to dynamically generate new query statements. The financial documents are searched again. The results of the two searches are sorted and filtered, and then integrated to form structured input data. Intermediate Json Schema construction step: Construct a Json Schema format suitable for table generation; Table generation step: Input data into the large language model to generate a customized table.
[0040] As an implementation method, the table generation step also includes a table generation post-processing and optimization step: comparing the generated customized table content with the financial document content, optimizing the row and column layout of the generated customized table, further improving the table's structuring level, and making the table structure clearer and more standardized.
[0041] As an implementation method, the model building step also includes a data processing step: collecting financial documents in the financial field, annotating the collected financial documents, formatting them, removing noise data, and semantic segmenting them, building a task training set, and training a large language model based on the data in the task training set.
[0042] As an implementation method, the table generation step also includes a customized table generation step before the step: fine-tuning the large language model; introducing a table structured modeling mechanism, and modeling the logical relationship between rows and columns through the attention mechanism; generating a corresponding table according to the user's customized needs.
[0043] This invention addresses the complexity of generating tables in cross-document scenarios in the financial sector. Compared to traditional methods that typically rely on extracting content from a single document or predefined templates and struggle to address the diverse needs of the financial sector, this invention leverages efficient information retrieval and semantic modeling, combined with the powerful generation capabilities of large language models, to generate logically clear, structured, and well-defined tables that meet the needs of the financial sector.
[0044] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A cross-document table generation system based on RAG, characterized in that: It includes a cross-document information retrieval and fusion module, an intermediate Json Schema construction module, and a large language model for generating customized tables in the financial field. The cross-document information retrieval and fusion module initially retrieves the corresponding semantic information from the financial documents for the table to be generated. Based on the retrieval results and user feedback, it uses a multi-round query generation mechanism to dynamically generate new query statements, searches the financial documents again, sorts and filters the results of the two retrievals, and then integrates them to form structured input data. The intermediate Json Schema construction module builds the Json Schema format suitable for table generation; The large language model generates customized tables based on the input data.
2. The RAG-based cross-document table generation system according to claim 1, wherein: It also includes a table generation post-processing and optimization module, which compares the generated customized table content with the financial document content, optimizes the row and column layout of the generated customized table, further improves the table's structuring level, and makes the table structure clearer and more standardized.
3. The RAG-based cross-document table generation system according to claim 1, wherein: It also includes a data processing module, which collects financial documents in the financial field, annotates the collected financial documents, formats them, removes noise data, performs semantic segmentation, constructs a task training set, and trains a large language model based on the data in the task training set.
4. The RAG-based cross-document table generation system according to claim 1, wherein: It also includes a customized table generation module, which fine-tunes the large language model; introduces a table structured modeling mechanism, models the logical relationship between rows and columns through the attention mechanism; and generates corresponding tables according to the user's customized needs.
5. A cross-document table generation method based on RAG, characterized in that: include: Model building steps: Build a large language model for generating customized tables in the financial field; Cross-document information retrieval and fusion steps: Initially retrieve the corresponding semantic information from the financial documents for the table to be generated. Based on the retrieval results and user feedback, a multi-round query generation mechanism is used to dynamically generate new query statements. The financial documents are searched again. The results of the two searches are sorted and filtered, and then integrated to form structured input data. Intermediate Json Schema construction step: Construct a Json Schema format suitable for table generation; Table generation step: Input data into the large language model to generate a customized table.
6. The RAG-based cross-document table generation method according to claim 5, wherein: The table generation step also includes a table generation post-processing and optimization step: comparing the generated customized table content with the financial document content, optimizing the row and column layout of the generated customized table, further improving the table's structuring level, and making the table structure clearer and more standardized.
7. The RAG-based cross-document table generation method according to claim 5, wherein: The model building step also includes a data processing step: collecting financial documents in the financial field, annotating the collected financial documents, formatting them, removing noise data, and semantic segmentation, building a task training set, and training a large language model based on the data in the task training set.
8. The RAG-based cross-document table generation method according to claim 5, wherein: The table generation step also includes a customized table generation step: fine-tuning the large language model; introducing a table structured modeling mechanism, modeling the logical relationship between rows and columns through the attention mechanism; and generating corresponding tables according to the user's customized needs.
Citation Information
Cited By
Electric power information query method and device based on knowledge graph, equipment, medium and product
CN121255735A