Method and system for identifying financial statement form in PDF (Portable Document Format) document
By combining financial expert knowledge with an AI model in a collaborative recognition mechanism, the system addresses the issues of insufficient stability and interpretability in PDF financial statement recognition. It achieves efficient and accurate financial statement data extraction and a self-improving system that adapts to the differences and complexities in financial statement formats.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAMEN TIANJIAN CAIZHI TECH CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies for recognizing PDF financial statements suffer from insufficient stability and interpretability, high computational costs, and difficulty in handling differences in financial statement formats in complex business scenarios.
By combining financial expert knowledge to build a rule engine and AI model, HTML and JSON data are obtained by parsing PDF documents, multi-dimensional features are extracted, and the collaborative mechanism of expert rule engine and recognition model is used to achieve rapid table matching and manual correction, thus establishing a closed-loop mechanism.
It improves the accuracy and adaptability of financial statement identification, reduces computing costs, supports cross-company and cross-industry financial statement processing, provides a manual correction entry point for self-improvement of the system, and meets the data source verifiability requirements of financial audits.
Smart Images

Figure CN122049933A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data recognition technology, and specifically relates to a method and system for recognizing financial statement tables in PDF documents. Background Technology
[0002] With the rapid development of financial services, data collection for quarterly and annual financial reports has become a core component of financial data services. Currently, PDF (Portable Document Format) files have become the primary medium for publicly disclosed financial statements due to their ability to maintain consistent formatting across different operating systems and devices, their capacity to include various elements such as text, images, hyperlinks, audio, and video, and their support for encryption and digital signatures, ensuring document security and integrity. However, because PDF documents are unstructured or semi-structured, and reports from different companies vary significantly in format, terminology, and structure, efficiently and accurately extracting financial data from massive amounts of PDFs has become a pressing technical challenge for the industry.
[0003] In existing technologies, table recognition in PDF financial statements primarily relies on AI recognition methods based on large models. The specific process involves: first, collecting a large number of PDF financial statement samples; then, manually annotating the tables in these samples with business meaning annotations, and inputting this annotation into an AI model for training to build a preliminary table recognition model. In practical applications, after a user uploads a PDF document, the AI model automatically recognizes the table content. However, due to significant differences in the format, structure, and terminology of financial statements, the AI model often misidentifies or misses entries during the actual recognition process. In such cases, it is necessary for personnel with financial expertise to manually review and supplement the data, manually matching the incorrectly recognized table data to the corresponding business database tables.
[0004] Chinese invention patent application CN109670477A discloses an automatic recognition system and method for PDF tables. The solution involves: scanning PDF reports to identify table content and text content within the PDF file; preserving the original table style completely; parsing the table content according to business needs; adjusting the original table style to obtain a revised table style; automatically recognizing text and headers within the table content; outputting the data in a structured format; filtering the obtained structured data for database entry; filtering invalid information according to business needs; verifying the business balance of data in each subject of the header; obtaining qualified data and entering it into the database; displaying the qualified data according to the original or revised table style; and providing a downloadable table in Excel format.
[0005] Although the above solutions have achieved automated recognition of PDF tables to some extent, they still have the following shortcomings in complex business scenarios: over-reliance on underlying parsing and pure AI models, resulting in insufficient recognition stability and interpretability; low efficiency and high computing power costs when the system processes large-scale data. Summary of the Invention
[0006] This invention provides a method and system for recognizing financial statement tables in PDF documents. By transforming the prior knowledge of financial experts into executable rules and complementing the advantages of AI models, and establishing a closed-loop mechanism for human feedback, it aims to solve the problems of insufficient recognition stability and interpretability, and high computing power costs in existing technologies.
[0007] To address the aforementioned technical problems, this invention proposes a method for recognizing financial statement tables in PDF documents, comprising the following steps: Parse the target PDF document to obtain HTML and JSON data; and obtain the prediction template for the table output in the PDF document by the pre-trained recognition model; Based on the HTML and JSON data, extract multidimensional features for each table to be identified; The multidimensional features are input into an expert rule engine containing collection templates corresponding to multiple business tables; if the features of the table to be identified match the rules of any preset collection template, the business table type is determined according to the preset collection template and the data is entered into the database; if the match fails, it is marked as an unmatched table. For unmatched tables, if the identification model outputs the corresponding prediction collection template for the table, then the corresponding prediction collection template is adopted to determine the business table type and the data is entered into the database. For tables where the expert rule engine fails to match and the recognition model does not output a valid prediction collection template, the tables are transferred to the manual processing module, which receives the business table mapping results input by the user and stores them in the database.
[0008] Preferably, the acquisition of the JSON data further includes: The PDF document is input into the recognition model, which identifies and extracts the table structure in the document and directly outputs structured data containing table headers, table bodies, and row and column relationships as a data source for multidimensional feature extraction.
[0009] Preferably, the method for parsing PDF documents is as follows: The document's text objects and position coordinates are extracted using a PDF parsing library to generate an HTML document that preserves the text position and layout style; combined with an OCR engine to recognize the scanned content, the table is converted into structured JSON data containing table headers, table bodies, and row and column indexes.
[0010] Preferably, the method for converting the table into structured JSON data containing table headers, table bodies, and row and column indices is as follows: Check if the table contains multiple levels of nested headers; if so, concatenate the parent header text with the child header text according to the header hierarchy order, using a preset delimiter, to generate a unique key-value string as the field name of the JSON object; The field values in the JSON object correspond to the cell data in the column containing the lowest-level child table header.
[0011] Preferably, the preset data collection template is configured such that one data collection template corresponds to each business table in the financial statements; All data collection templates include the following rule dimensions: Table of Contents / Chapter Features: Keyword matching based on PDF table of contents or chapter titles; Contextual keyword features: keyword matching in the preceding text paragraphs of the table; Table title characteristics: Direct matching of the title text above the table; Header keyword characteristics: Matching specific subject names contained in the first row or first column of the table; Table body data characteristics: Matching specific business terms or numerical characteristics contained in the table content cells.
[0012] Preferably, the matching logic of the expert rule engine is as follows: For each data collection template, define a rule expression composed of logical operators AND and OR; The rule configuration in the collection template is traversed. When the feature data of the table to be identified meets the logical truth condition of the rule expression, it is determined to be a successful match.
[0013] Preferably, the rule expression is configured with a two-level logical structure, including a rule group level and a rule item level; The data collection template contains one or more rule groups, and the logical decision relationship between the rule groups is an OR relationship. Each rule group contains multiple rule items, and the logical judgment relationship between rule items within the same rule group is an AND relationship; the rule group is judged to be a successful match only when all rule items within the same rule group match successfully. The data structure of the rule item includes: a matching dimension type identifier, a logical matcher, and a matching value.
[0014] Preferably, the data entry operation is recorded using a vertical storage structure at the cell level; Each stored record in the database corresponds to a single cell of data in the identified table, and the data structure of the stored record includes at least the following: Document Identifier: A unique ID associated with the original PDF document; Collection Template Identifier: Associates and identifies the business template ID used to collect this data; Row number and field name: Locate the logical coordinates of this data in the business table; Field value: Stores the specific numerical value or text of this cell.
[0015] Preferably, the processing method of the manual processing module is as follows: The interactive interface displays an unmatched HTML table fragment and receives the target collection template selected by the user for that table fragment. Establish the binding relationship between the table fragment and the target acquisition template, and perform data parsing and data import. Call the rule configuration interface of the target collection template to display the current rule groups and rule items of the template on the interface; Receive user instructions to modify the rule items and update the modified rule parameters to the expert rule engine.
[0016] A second aspect of the present invention also provides a system for recognizing financial statement tables in PDF documents, the system being used to implement the table recognition method as described in the first aspect of the present invention, comprising: The document parsing and preprocessing module is used to parse PDF documents using a parsing engine to obtain HTML and JSON data, and to call a recognition model to obtain the JSON data of the PDF document and a prediction collection template for tables. The feature extraction module extracts multidimensional features for each table to be identified based on HTML and JSON data. An expert rule engine is used to store a preset collection template library containing financial expert knowledge and to receive the multi-dimensional features for rule matching. The identification strategy control module is used to perform hierarchical identification and judgment. First, judge the matching result of the expert rule engine. If the match is successful, determine the business table type. If the rule matching fails, check whether the recognition model outputs a valid prediction collection template. If so, adopt the AI prediction result. If the rule matching fails and the recognition model has no valid output, the table will be transferred to the manual processing module. The manual processing module provides an interactive interface for users to manually judge and input data from the forms that are transferred to it. The data entry module is used to record table data according to the business table type and data source determined by the identification strategy control module.
[0017] Compared with the prior art, the present invention has the following technical effects: 1. The table recognition method proposed in this invention targets a large number of standard financial statements with fixed formats. It quickly matches data using a rule engine built on the knowledge of financial experts. For heterogeneous or long-tailed tables that cannot be covered by the rules, it backtracks and adopts the prediction results of the AI model to fill in the semantic gaps. This collaborative mechanism ensures the accuracy of core business data while also possessing the ability to generalize to handle complex variations.
[0018] 2. The table recognition method proposed in this invention utilizes the HTML structure generated by PDF parsing, introducing structured features such as HTML directory paths and contextual text flows. Combined with the two-layer logical structure of the expert rule engine, the system can flexibly accommodate multiple aliases, different disclosure locations, and variations in the header structure of the same business table, significantly improving its adaptability in cross-company and cross-industry financial reporting.
[0019] 3. The table recognition method proposed in this invention provides a data entry point for manual correction and a visual rule editing interface. User error corrections on the interface are converted into new rule parameters in real time and updated in the engine, enabling the system to continuously improve itself as business data accumulates, without the need for frequent low-level code development or model retraining.
[0020] 4. The table recognition method proposed in this invention uses a vertical storage architecture, replacing the traditional wide table storage. This effectively solves the problem of rigid database table structure caused by frequent changes in financial statement items and numerous non-standard items. Simultaneously, by associating the original document ID and the collection template ID in each cell record, a full-link traceability from a single data point to the original PDF physical file is constructed, meeting the requirements of financial auditing for the verifiability of data sources. Attached Figure Description
[0021] Figure 1 This is a flowchart illustrating the table recognition method described in this invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with specific embodiments of the present application and with reference to the accompanying drawings.
[0023] Example 1 This embodiment describes a method for recognizing financial statement tables in PDF documents, such as... Figure 1 As shown, it includes the following steps one through five: The starting point of this embodiment is the digital parsing and preprocessing of the input financial statement files. Since financial statements (such as prospectuses and annual reports) are typically lengthy and contain complex layouts, a single parsing method cannot simultaneously ensure accuracy and semantic integrity. Therefore, this embodiment employs a strategy of parallel processing of low-level parsing and AI-powered intelligent recognition.
[0024] Specifically, step one: parse the target PDF document to obtain HTML and JSON data; and obtain the prediction template for the table output in the PDF document by the pre-trained recognition model.
[0025] In this step, the document parsing engine is first activated to deconstruct the physical layers of the PDF file. The method for parsing the PDF document is as follows: The document's text objects and position coordinates are extracted using a PDF parsing library to generate an HTML document that preserves the text position and layout style; combined with an OCR engine to recognize the scanned content, the table is converted into structured JSON data containing table headers, table bodies, and row and column indexes.
[0026] In practice, financial statements come from diverse sources, and their file formats may range from standard PDF documents to scanned copies of paper documents or image formats. In implementation, the parsing engine iterates through each page of the PDF document. For text-based PDFs, the engine directly reads the character stream and its bounding box information; for scanned or image-based PDFs, the engine automatically calls the OCR module for optical character recognition. The parsed HTML document constructs a DOM structure with coordinate attributes and hierarchical tags to preserve the document's table of contents and paragraph hierarchy.
[0027] In the process of converting PDF tables to JSON data, to address the issue of duplicate column names caused by multi-level headers (e.g., including amounts and percentages under the year) commonly found in financial statements, this embodiment describes a method for converting tables into structured JSON data containing headers, bodies, and row and column indexes as follows: Check if the table contains multiple levels of nested headers; if so, concatenate the parent header text with the child header text according to the header hierarchy order, using a preset delimiter, to generate a unique key-value string as the field name of the JSON object; The field values in the JSON object correspond to the cell data in the column containing the lowest-level child table header.
[0028] For example, when processing a management expense detail table with two levels of headers, where the first level header is for the year 2024 and the second level header contains the amount and percentage, the parsing engine does not store the two header rows separately when generating JSON data. Instead, it concatenates them using the preset delimiter ">>", generating flattened key values such as "2024 >> Amount" and "2024 >> Percentage". This approach eliminates the ambiguity caused by the header hierarchy, allowing the subsequent rule engine to accurately match the specific column data.
[0029] Meanwhile, to overcome the limitations of traditional parsing engines in handling cross-page tables or borderless tables, this embodiment introduces a recognition model as a parallel auxiliary extraction method. That is, the acquisition of HTML and JSON data also includes: The PDF document is input into the recognition model, which identifies and extracts the table structure in the document and directly outputs structured data containing table headers, table bodies, and row and column relationships as a data source for multidimensional feature extraction.
[0030] Here is an example of HTML data output by a recognition model: VI. Key Financial Data and Indicators of the Issuer during the Reporting Period project June 30, 2025 / January-June 2025 2024.12.31 / 2024 fiscal year December 31, 2023 / 2023 fiscal year December 31, 2022 / 2022 fiscal year … … VII. Key Financial Information and Operating Status of the Issuer After the Audit Cut-off Date of its Financial Reports .
[0031] Here is an example of JSON data output by a recognition model: { "index": 7, "objects": [ { "2022.12.31 / 2022 fiscal year": "339,154.64", "2023.12.31 / 2023 fiscal year": "365,057.68", "2024.12.31 / 2024 fiscal year": "444,586.87", "2025.6.30 / 2025 Jan-Jun": "477,711.54", "Project": "Total Assets (Ten Thousand Yuan)" }, { … }, … ] } This recognition model is integrated via a third-party API call, taking a complete binary stream of a PDF document as input. Trained on a large number of financial statement samples, the model possesses contextual semantic understanding capabilities. It not only outputs the recognized JSON data but also handles cross-page concatenation issues that traditional parsing methods struggle with. Furthermore, it outputs a predictive template based on the semantics of the entire table (e.g., the model predicts a 90% probability that the table is a consolidated profit and loss statement). This prediction serves as a fallback in case of rule matching failures in subsequent steps.
[0032] Step 2: Based on the HTML and JSON data, extract multidimensional features for each table to be identified. These multidimensional features do not refer only to the data within the table, but rather to a comprehensive feature vector that integrates document structure information (HTML source) and table content information (JSON source).
[0033] Specifically, the features extracted in this embodiment cover the following five dimensions to ensure the richness of the features and the accuracy of the judgment: Table of Contents Chapter Features (Based on HTML Document Structure): Although the input is JSON data, the feature extractor traces back to the HTML DOM structure generated in step one. The system obtains the complete directory path of the table to be identified by analyzing the hierarchical nesting relationship of HTML tags. For example, it extracts "Section VI Financial Accounting Information and Management Analysis >> IX. Operating Results Analysis >> (V) Period Expense Analysis" as the directory feature of the table.
[0034] Table context features (based on HTML text flow): The system accurately locates the text region between the table tag to be identified and its corresponding last-level directory node tag within the HTML document flow. This region typically contains introductory descriptions or unit specifications of the table content. The system extracts the text content within this region, such as "During the reporting period, the company's management expenses were composed as follows: Unit: RMB 10,000, %", and extracts contextual keywords such as "management expenses" and "composition".
[0035] Table title characteristics: The system extracts the text paragraph immediately above the table as an explicit table title feature. This feature is used for fuzzy or exact string matching with predefined standard table names in the rule base (such as consolidated balance sheet, cash flow statement).
[0036] Table header keyword features (based on JSON key names): Based on the flattened JSON data processed in step one, the system extracts the keys from the JSON objects, performs word segmentation on these keys, and checks whether they contain specific accounting item names or time stamps. For example, it checks for the presence of key header terms such as "current assets," "non-current liabilities," or "2024 >> percentage."
[0037] Table body data characteristics (based on JSON key-value pairs): To identify tables with generic headers but business-specific content in their bodies, the system scans the Value column of the JSON object, particularly the first column. For example, when identifying a management expense details table, the system checks if the body of the JSON data contains specific expense details such as "employee compensation," "depreciation and amortization," or "office expenses." When identifying a cash flow statement, it checks for key line items such as "net cash flow from operating activities."
[0038] Step 3: The multi-dimensional feature input includes an expert rule engine with multiple business table corresponding collection templates. If the features of the table to be identified match the rules of any preset collection template, the business table type is determined according to the preset collection template, and data is entered into the database. If the matching fails, it is marked as an unmatched table. After the multi-dimensional feature extraction is completed in Step 2, the core judgment and identification stage begins. This step aims to utilize a pre-built financial expert knowledge base to quickly and accurately qualitatively characterize standard or common financial statements.
[0039] In this process, the expert rule engine acts as the first filter. It relies on a large rule knowledge base maintained in the background. The preset collection templates are configured such that each business table in the financial statements corresponds to a collection template; for example, the consolidated balance sheet, the parent company income statement, and the guarantee details table all have independent collection template IDs. Each template defines all the feature conditions required to identify that specific business table.
[0040] To comprehensively capture the characteristics of the tables, all data collection templates include the following rule dimensions: Table of Contents / Chapter Features: Keyword matching based on PDF table of contents or chapter titles; Contextual keyword features: keyword matching in the preceding text paragraphs of the table; Table title characteristics: Direct matching of the title text above the table; Header keyword characteristics: Matching specific subject names contained in the first row or first column of the table; Table body data characteristics: Matching specific business terms or numerical characteristics contained in the table content cells.
[0041] In its implementation, the system does not employ simple linear conditional judgments, but instead designs a flexible logical container. The rule expressions are configured using a two-layer logical structure, including a rule group level and a rule item level. The data collection template contains one or more rule groups, and the logical decision relationship between the rule groups is an OR relationship. Each rule group contains multiple rule items, and the logical judgment relationship between rule items within the same rule group is an AND relationship; the rule group is judged to be a successful match only when all rule items within the same rule group match successfully. The data structure of the rule item includes: a matching dimension type identifier, a logical matcher, and a matching value.
[0042] This design allows a single data collection template to be compatible with multiple heterogeneous formats. For example, for a consolidated balance sheet template, at least three rule groups can be configured: Rule Group A: (Table title includes "Consolidated Balance Sheet") AND (Table body data includes "Current Assets" and "Non-current Assets" and "Current Liabilities" and "Non-current Liabilities") AND (Table body data does not include "Reason for Restriction") AND (Table header does not include "Reason for Restriction"); Rule Group B: (Table title contains "Balance Sheet") AND (Table title does not contain "Parent Company" or "Liquidity Risk") AND (Table body data contains "Minority Interest") AND (Table body data does not contain "Reason for Restriction") AND (Table header does not contain "Reason for Restriction"). Rule Group C: (Table context does not contain "Income Statement" or "Cash Flow Statement" or "Liquidity Risk") AND (Table context does not contain "Parent Company Balance Sheet") AND (Table context contains "Consolidated Balance Sheet") AND (Body data contains "Current Assets" and "Non-current Assets" and "Current Liabilities" and "Non-current Liabilities") AND (Body data does not contain "Reason for Restriction") AND (Header does not contain "Reason for Restriction").
[0043] The table to be identified can be successfully identified as a profit and loss statement as long as it meets any one of the rules group A, rule group B, or rule group C.
[0044] In the underlying rule configuration database, the rule group table includes at least the rule group ID (group_id) and the template ID (template_id) fields; the data structure of the rule item includes: matching dimension type identifier, logical matcher, and matching value.
[0045] item_type (matching dimension): such as "1" for table title, "2" for table header, and "4" for context; Symbol (logical matcher): such as "1" for equal to, "3" for contain, and "4" for not contain; item_val (matching value): such as "consolidated balance sheet".
[0046] As an example, the specific data for rule group A corresponding to a consolidated balance sheet in this embodiment is as follows: [ { "id":"2d03560efd72407ebc1ab5a9dd4e1031", "template_id":"97fe465ba6fa41b6b54399a0cd4321ef", "template_rule_group_id":"477eb36ce1014ca48bbb8762edddb6d0", "item_type":"1", "symbol":"3", "item_val":"Consolidated Balance Sheet" }, { "id":"d3d10f7960d3454995e7ec1080e32159", "template_id":"97fe465ba6fa41b6b54399a0cd4321ef", "template_rule_group_id":"477eb36ce1014ca48bbb8762edddb6d0", "item_type":"3", "symbol":"3", "item_val":"Current assets, Non-current assets, Current liabilities, Non-current liabilities" }, { "id":"e37bb846b5b242e18b2581260f4ddeab", "template_id":"97fe465ba6fa41b6b54399a0cd4321ef", "template_rule_group_id":"477eb36ce1014ca48bbb8762edddb6d0", "item_type":"3", "symbol":"4", "item_val":"Reason for restriction" } ] Among them, the id key is the unique ID of each rule item; the template_id key is the template ID, such as the template ID of the consolidated balance sheet in this example; and the template_rule_group_id key is the ID of the rule group to which this rule item belongs.
[0047] By iterating through the matching process, once the rule engine locks onto a certain collection template, the system immediately performs the data entry operation without the need for secondary judgment by the subsequent recognition model.
[0048] Step Four: For unmatched tables, if the identification model outputs a corresponding prediction and data collection template, the corresponding prediction and data collection template is adopted to determine the business table type and the data is entered into the database. After the expert rule screening in Step Three, most standard-format financial tables have been accurately identified and entered into the database. However, since financial statements often contain a small number of non-standard, obscure, or extremely complex tables, these tables may not match any of the preset hard rules and are therefore marked as unmatched tables. To solve this problem, this embodiment does not immediately switch to manual processing, but instead activates a second safeguard mechanism, namely, retroactively utilizing the prediction results already generated by the identification model in Step One.
[0049] Because the recognition model has already processed the entire document in parallel during the document parsing phase in step one, it is not necessary to re-invoke the recognition model for real-time inference in this step. Instead, the cached output of the recognition model from step one can be directly queried. The recognition model, based on deep learning algorithms, analyzes the semantic content (such as uncommon subject combinations) and contextual implicit information within the table, and outputs a predicted business classification label (i.e., the predicted collection template ID) and the corresponding confidence level.
[0050] The specific execution logic is as follows: The system checks whether the tables marked as unmatched are associated with the prediction results of the identification model. If the identification model outputs a prediction template corresponding to the table, for example, if the identification model determines that the table is a related-party lending table and the confidence level is higher than the system's preset security threshold, the system considers the AI's judgment credible. The template ID predicted by the AI is adopted as the final business type of the table, overriding the previous unmatched status, and the data entry process is triggered.
[0051] Step 5: For tables where the expert rule engine fails to match and the recognition model does not output a valid prediction template, the table is transferred to the manual processing module, which receives the user-input business table mapping results and stores them in the database. Although the expert rule engine and recognition model can cover most financial statement recognition scenarios, in actual business, there are still a small number of tables with extremely non-standard formats, extremely poor scanning quality, or that use non-standard business terminology. To ensure the integrity of data collection, this embodiment includes a manual backup step.
[0052] At this stage, the system marks the unrecognized forms as awaiting manual review and pushes them to a dedicated job queue. The manual processing module handles them as follows: The system displays unmatched HTML table fragments on the interactive interface and receives the target data collection template selected by the user for that fragment. Specifically, the left side of the interface renders the HTML table while retaining its original layout, allowing reviewers to clearly view the table header hierarchy and context. The right side of the interface provides a search box for data collection templates. For example, when the system fails to recognize a guarantee information table, the reviewer can enter "guarantee" in the search box, and the system will list all relevant business templates for selection. The reviewer can then select the correct guarantee details table template based on the actual content of the table on the left.
[0053] After the reviewer confirms that everything is correct, they click the "Save" or "Match" button. The system then establishes a binding relationship between the table fragment and the target data collection template, and performs data parsing and database entry. At this point, the system updates the template ID in the table's JSON data to the manually selected template ID and writes the data into the database. The data collection for this table is now complete.
[0054] After manual data entry and matching are completed in this embodiment, the system automatically, or based on user-triggered optimization mode, calls the rule configuration interface of the target data collection template and displays the current rule groups and rule items of the template on the interface. For example, the system will pop up a window showing that the current matching rule for the guarantee details table is that the title contains "external guarantee". Reviewers find through comparison that the currently unrecognized table title is "Company Guarantee Situation", thus causing the matching failure. Reviewers can directly adjust the rules on the interface, such as changing the rule to "title contains 'guarantee' (relaxed condition)" or adding a new rule group. The system receives the user's modification instructions for the rule items and updates the modified rule parameters to the expert rule engine.
[0055] Traditional financial data storage often uses a wide table model (i.e., one row of records corresponds to one row in the report, and column names correspond to account names). However, this model is difficult to adapt to situations where financial statement accounts change frequently and there are many non-standard accounts. In this embodiment, the data entry operations in steps three, four, and five are recorded using a vertical storage structure at the cell level.
[0056] This storage method breaks down two-dimensional tabular data into atomic data entries. Each stored record in the database corresponds to a single cell of data in the identified table, and the data structure of the stored record includes at least: Document identifier (such as the doc_id or pdf_id field): A unique ID associated with the original PDF document; this identifier is linked as a foreign key to the system's original document information table, through which the storage path, upload time, and file name of the PDF file can be retrieved. This ensures that every piece of financial data entering the database can be accurately located to its physical source file, achieving physical traceability from data to file.
[0057] Template identifier (e.g., template_id field): This identifier is associated with the business template ID used to identify the data; it indicates which business table the data belongs to. Regardless of whether the determination is based on the logical matching of the rule engine, the probability prediction of the identification model, or manual specification, this identifier serves as the final business attribution mark.
[0058] Row number and field name: These determine the logical coordinates of the data within the business table; in the database, they are typically represented as row_no and field_name. row_no is used to re-aggregate scattered cells into a single row in the report; field_name corresponds to the standard account name defined in the data collection template (e.g., monetary_fund corresponds to "monetary funds"). These two fields constitute the coordinate system of the data in the logical two-dimensional table.
[0059] Field value: Stores the specific numerical value or text of the cell; in database fields, it is usually represented as field_value, which is the cleaned actual business data.
[0060] As an example, suppose the system identifies a company's employee structure table from a prospectus, containing a row that reads "Production personnel: 1,757 people." During the data insertion process, the system does not store the entire row; instead, it breaks it down into storage records in the following format: { "id":"unique_record_id_001", "doc_id":"3263b09cade34d08...", / / Link to the original prospectus PDF "storage_table_name":"corp_staff_structure", / / Associated employee structure table template "row_no":"1", / / Data in the first row "field_name":"staff_type", / / Field name: Staff type "field_value":"Production Personnel" / / Field value } And another record on the same line: { "id":"unique_record_id_002", "doc_id":"3263b09cade34d08...", "storage_table_name":"corp_staff_structure", "row_no":"1", / / Also belongs to the first line "field_name":"staff_count", / / Field name: Number of people "field_value":"1,757" / / Field value } This storage structure enhances the flexibility of the database schema, eliminating the need to modify table structures for new accounts in new reports. More importantly, it establishes a sophisticated audit trail. When data users question the value "1,757," the system can quickly verify the data's authenticity simply by retrieving the original PDF using the doc_id.
[0061] Example 2 This embodiment is a system for recognizing financial statement tables in PDF documents. The system is used to implement the table recognition method described in Embodiment 1, including: The document parsing and preprocessing module is used to parse PDF documents using a parsing engine to obtain HTML and JSON data, and to call a recognition model to obtain the JSON data of the PDF document and a prediction collection template for tables. The feature extraction module extracts multidimensional features for each table to be identified based on HTML and JSON data. An expert rule engine is used to store a preset collection template library containing financial expert knowledge and to receive the multi-dimensional features for rule matching. The identification strategy control module is used to perform hierarchical identification and judgment. First, judge the matching result of the expert rule engine. If the match is successful, determine the business table type. If the rule matching fails, check whether the recognition model outputs a valid prediction collection template. If so, adopt the AI prediction result. If the rule matching fails and the recognition model has no valid output, the table will be transferred to the manual processing module. The manual processing module provides an interactive interface for users to manually judge and input data from the forms that are transferred to it. The data entry module is used to record table data according to the business table type and data source determined by the identification strategy control module.
[0062] The above description is only a preferred embodiment of the present invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the protection scope of the present invention.
Claims
1. A method for recognizing financial statement tables in a PDF document, characterized in that, Includes the following steps: Parse the target PDF document to obtain HTML and JSON data; and obtain the prediction template for the table output in the PDF document by the pre-trained recognition model; Based on the HTML and JSON data, extract multidimensional features for each table to be identified; The multidimensional features are input into an expert rule engine that contains collection templates corresponding to multiple business tables; If the features of the table to be identified match the rules of any preset data collection template, the business table type is determined according to the preset data collection template and the data is entered into the database; if the match fails, it is marked as an unmatched table. For unmatched tables, if the identification model outputs the corresponding prediction collection template for the table, then the corresponding prediction collection template is adopted to determine the business table type and the data is entered into the database. For tables where the expert rule engine fails to match and the recognition model does not output a valid prediction collection template, the tables are transferred to the manual processing module, which receives the business table mapping results input by the user and stores them in the database.
2. The method according to claim 1, characterized in that, The acquisition of HTML and JSON data also includes: The PDF document is input into the recognition model to identify and extract the table structure in the document, and the output is structured data containing table headers, table bodies and row and column relationships, which serves as the data source for multidimensional feature extraction.
3. The method according to claim 1, characterized in that, The method for parsing PDF documents is as follows: The document's text objects and position coordinates are extracted using a PDF parsing library to generate an HTML document that preserves the text position and layout style; combined with an OCR engine to recognize the scanned content, the table is converted into structured JSON data containing table headers, table bodies, and row and column indexes.
4. The method according to claim 3, characterized in that, The method for converting a table into structured JSON data containing a header, body, and row and column indices is as follows: Check if the table contains multiple levels of nested headers; if so, concatenate the parent header text with the child header text according to the header hierarchy order, using a preset delimiter, to generate a unique key-value string as the field name of the JSON object; The field values in the JSON object correspond to the cell data in the column containing the lowest-level child table header.
5. The method according to claim 1, characterized in that, The preset data collection template is configured such that one data collection template corresponds to each business table in the financial statements. All data collection templates include the following rule dimensions: Table of Contents / Chapter Features: Keyword matching based on PDF table of contents or chapter titles; Contextual keyword features: keyword matching in the preceding text paragraphs of the table; Table title characteristics: Direct matching of the title text above the table; Header keyword characteristics: Matching specific subject names contained in the first row or first column of the table; Table body data characteristics: Matching specific business terms or numerical characteristics contained in the table content cells.
6. The method according to claim 5, characterized in that, The matching logic of the expert rule engine is as follows: For each data collection template, define a rule expression composed of logical operators AND and OR; The rule configuration in the collection template is traversed. When the feature data of the table to be identified meets the logical truth condition of the rule expression, it is determined to be a successful match.
7. The method according to claim 6, characterized in that, The rule expression is configured using a two-level logical structure, including a rule group level and a rule item level; The data collection template contains one or more rule groups, and the logical decision relationship between the rule groups is an OR relationship. Each rule group contains multiple rule items, and the logical judgment relationship between rule items within the same rule group is an AND relationship; the rule group is judged to be a successful match only when all rule items within the same rule group match successfully. The data structure of the rule item includes: a matching dimension type identifier, a logical matcher, and a matching value.
8. The method according to claim 1, characterized in that, The data entry operation is recorded using a vertical storage structure at the cell level; Each stored record in the database corresponds to a single cell of data in the identified table, and the data structure of the stored record includes at least the following: Document Identifier: A unique ID associated with the original PDF document; Collection Template Identifier: Associates and identifies the business template ID used to collect this data; Row number and field name: Locate the logical coordinates of this data in the business table; Field value: Stores the specific numerical value or text of this cell.
9. The method according to claim 1, characterized in that, The processing method of the manual processing module is as follows: The interactive interface displays an unmatched HTML table fragment and receives the target collection template selected by the user for that table fragment. Establish the binding relationship between the table fragment and the target acquisition template, and perform data parsing and data import. Call the rule configuration interface of the target collection template to display the current rule groups and rule items of the template on the interface; Receive user instructions to modify the rule items and update the modified rule parameters to the expert rule engine.
10. A system for recognizing financial statement tables in PDF documents, characterized in that, The system is used to implement the table recognition method as described in any one of claims 1-9, including: The document parsing and preprocessing module is used to parse PDF documents using a parsing engine to obtain HTML and JSON data, and to call a recognition model to obtain the JSON data of the PDF document and a prediction collection template for tables. The feature extraction module extracts multidimensional features for each table to be identified based on HTML and JSON data. An expert rule engine is used to store a preset collection template library containing financial expert knowledge and to receive the multi-dimensional features for rule matching. The identification strategy control module is used to perform hierarchical identification and judgment. First, judge the matching result of the expert rule engine. If the match is successful, determine the business table type. If the rule matching fails, check whether the recognition model outputs a valid prediction collection template. If so, adopt the AI prediction result. If the rule matching fails and the recognition model has no valid output, the table will be transferred to the manual processing module. The manual processing module provides an interactive interface for users to manually judge and input data from the forms that are transferred to it. The data entry module is used to record table data according to the business table type and data source determined by the identification strategy control module.