A method, device and electronic equipment for automatically positioning a financial master table
By recognizing textual and tabular information in financial reports and utilizing a financial account database and regular expression matching, the main financial table is automatically located, solving the problems of large computational load, long time consumption, and inaccuracy in existing technologies, and achieving fast and accurate location results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-17
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies are computationally intensive, time-consuming, and inaccurate when locating the main financial table, while manual methods are labor-intensive, and classification model training and computation are also extensive.
By identifying textual and tabular information in financial reports, using a financial subject database and regular expression matching to determine the table type, and statistically aggregating page information, the main financial table can be automatically located.
It enables rapid and accurate location of the main financial table without the need for model training, requires minimal computation, and saves manpower and time.
Smart Images

Figure CN115563946B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automation technology, and in particular to a method, apparatus and electronic device for automatically locating the master financial statement. Background Technology
[0002] Businesses are typically required to submit financial reports periodically, with financial statements being the main component. Financial statements are accounting reports reflecting the financial and profit status of a company or budgetary unit over a specific period, and they adhere to standardized regulations regarding their types, formats, and reporting requirements. Financial statements include main statements, supplementary schedules, and notes. The main statements include the balance sheet, income statement, and cash flow statement. The main statements provide comprehensive and complete accounting information, generally meeting the diverse needs of various information users. Supplementary schedules provide supplementary explanations of important information that cannot be fully or easily reflected in the main statements; examples include profit distribution statements and detailed statements of main business revenue and expenditure. Notes provide explanations and further clarifications of the accounting statement's preparation basis, principles, methods, and key items, enabling users to fully and accurately understand the statements. For example, notes may include aging analysis of accounts receivable, explanations of unusual changes in statement items and their causes, etc. Therefore, the most valuable content in a financial report is the main financial statement, and in some scenarios, it is desirable to quickly locate it within a financial report spanning hundreds of pages.
[0003] However, financial reports are typically in non-editable formats (e.g., PDF), making it impossible to quickly locate the main financial table using automated software. Therefore, existing technologies generally employ two methods to locate the main financial table: 1. Manually locating the page range containing the main financial table and marking this range on the financial report for quick access by users; 2. Inputting the entire financial report into a pre-trained classification model, which identifies which type of report on each page belongs to the main table, calculates the page range containing the main table, and marks this range on the financial report for quick access by users.
[0004] However, the aforementioned manual methods consume a large amount of human resources. The classification model must be labeled for every page of every financial report sample during training, which also requires a large amount of human resources. In addition, the main table positioning method of the classification model has a large amount of computation and takes a long time, and there may be cases of inaccurate classification. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, and electronic device for automatically locating the financial master table, so as to solve the problems of large computational load, long time consumption, and inaccuracy of existing financial master table locating methods.
[0006] To address the aforementioned technical problems, this specification provides a method for automatically locating a financial master table, comprising: acquiring a financial report in a predetermined format; identifying text information and table element information on each page of the financial report; performing the following matching operations on each table and determining the corresponding master table type based on the matching results: matching the text information in each cell of the current table with a financial subject database to obtain the master table type corresponding to each subject in the current table; and / or performing regular expression matching on the text information outside the current table within a predetermined range with the names of each master table type to obtain the matched master table type; statistically analyzing the page numbers of each page in the financial report and the master table types corresponding to the tables on each page; aggregating the statistical results of multiple consecutive pages on the page whose tables correspond to master table types; and determining the page number range of the financial master table based on the aggregation results.
[0007] In some embodiments, before performing a matching operation on each table and determining the corresponding main table type based on the matching results, the method further includes: determining the number of tables on each page; and determining that there is no financial main table on pages with more than 3 tables.
[0008] In some embodiments, matching the text information in each cell of the current table with the financial subject database to obtain the main table type corresponding to each subject in the current table includes: performing the following operations on each cell containing text information in the current table: matching the text information of the current cell with the financial subject database to determine whether there is a target subject in the financial subject database that matches the text information of the current cell; if so, determining the main table type corresponding to the target subject in the financial subject database; using the main table type corresponding to the target subject as the main table type corresponding to the text information in the current cell; counting the number of cells corresponding to each main table type; and using the main table type whose number of corresponding cells is greater than or equal to a predetermined threshold as the main table type corresponding to the current table.
[0009] In some embodiments, after performing each matching operation on each table and failing to determine the main table type corresponding to the table based on the matching result, the method further includes: determining whether the table is the first table on the current page; if so, checking whether the bottom of the previous page is a table; if so, determining the main table type corresponding to the table at the bottom of the previous page as the main table type corresponding to the table at the top of the current page.
[0010] In some embodiments, the method further includes: when the main table type corresponding to the table at the bottom of the previous page cannot be determined, merging the table at the bottom of the previous page and the table at the top of the current page into one table, matching the text information in each cell of the merged table with the financial subject database to obtain the main table type corresponding to each subject in the merged table, and determining the main table type corresponding to the merged table based on the matching result.
[0011] In some embodiments, the method further includes: if the bottom of the previous page is not a table, performing regular expression matching between the text information at the bottom of the previous page and the names of each main table type; and using the matched main table type as the main table type corresponding to the table at the top of the current page.
[0012] In some embodiments, before determining the page range where the financial master table is located based on the aggregation result, the method further includes: performing the following operation on each page range in the aggregation result: determining whether the type of the first master table corresponding to the current page range is a predetermined type; if not, determining that the current page range is not the page range where the financial master table is located.
[0013] In some embodiments, determining the page range where the financial master table is located based on the aggregation results includes: determining the target page range with the most corresponding master table types among the page ranges in the aggregation results; and using the target page range as the page range where the financial master table is located.
[0014] A second aspect of this specification provides an apparatus for automatically locating a financial master table, comprising: an acquisition unit for acquiring a financial report in a predetermined format; an identification unit for identifying text information and table element information on each page of the financial report; a first matching unit for performing the following matching operations on each table and determining the master table type corresponding to the table based on the matching results: matching the text information in each cell of the current table with a financial subject database to obtain the master table type corresponding to each subject in the current table; and / or performing regular expression matching on the text information outside the current table within a predetermined range with the name of each master table type to obtain the matched master table type; a statistics unit for statistics on the page numbers of each page of the financial report and the master table types corresponding to the tables on each page; an aggregation unit for aggregating the statistical results of multiple consecutive pages on the page whose tables correspond to master table types; and a first determination unit for determining the page number range of the financial master table based on the aggregation results.
[0015] In some embodiments, the apparatus further includes: a second determining unit for determining the number of tables on each page; and a second determining unit for determining that there is no main financial table on pages with more than 3 tables.
[0016] In some embodiments, the first matching unit includes: a processing subunit, configured to perform the following operations on each cell containing text information in the current table: matching the text information of the current cell with a financial subject database to determine whether there is a target subject in the financial subject database that matches the text information of the current cell; if so, determining the main table type corresponding to the target subject in the financial subject database; using the main table type corresponding to the target subject as the main table type corresponding to the text information in the current cell; a statistics subunit, configured to count the number of cells corresponding to each main table type; and a first determining subunit, configured to use the main table type whose corresponding cell count is greater than or equal to a predetermined threshold as the main table type corresponding to the current table.
[0017] In some embodiments, the apparatus further includes: a third determining unit, configured to determine whether the table is the first table on the current page; a searching unit, configured to, if so, search whether the bottom of the previous page is a table; and a fourth determining unit, configured to, if so, determine the main table type corresponding to the table at the bottom of the previous page as the main table type corresponding to the table at the top of the current page.
[0018] In some embodiments, the apparatus further includes: a processing unit, configured to, when the main table type corresponding to the table at the bottom of the previous page cannot be determined, merge the table at the bottom of the previous page and the table at the top of the current page into one table, match the text information in each cell of the merged table with the financial subject database to obtain the main table type corresponding to each subject in the merged table, and determine the main table type corresponding to the merged table based on the matching result.
[0019] In some embodiments, the apparatus further includes: a second matching unit, configured to perform regular expression matching between the text information at the bottom of the previous page and the names of each main table type if the bottom of the previous page is not a table; and a fifth determining unit, configured to use the matched main table type as the main table type corresponding to the table at the top of the current page.
[0020] In some embodiments, the apparatus further includes an exclusion unit, configured to perform the following operation on each page range in the aggregation result: determine whether the type of the first main table corresponding to the current page range is a predetermined type; if not, determine that the current page range is not the page range where the financial main table is located.
[0021] In some embodiments, the first determining unit includes: a second determining subunit, configured to determine the target page range with the most corresponding main table types among the page ranges in the aggregation result; and a third determining subunit, configured to use the target page range as the page range where the financial main table is located.
[0022] A third aspect of this specification provides an electronic device, comprising: a memory and a processor, wherein the processor and the memory are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to implement the steps of the method described in any of the first aspects.
[0023] A fourth aspect of this specification provides a computer storage medium storing computer program instructions that, when executed by a processor, implement the steps of the method described in any of the first aspects.
[0024] The fifth aspect of this specification provides a computer program product comprising a computer program that, when executed by a processor, implements the steps of the method described in any of the first aspects.
[0025] The method, apparatus, and electronic equipment for automatically locating the main financial table provided in this manual first identify the textual information and table element information on each page of the financial report. Then, it determines the main table type corresponding to each table. Next, it statistically analyzes the page numbers of each page in the financial report and the main table types corresponding to the tables on each page. The statistical results of multiple consecutive pages with tables corresponding to the main table type are aggregated, and the page number range of the main financial table is determined based on the aggregation result. This solution automatically locates the main financial table based on its own characteristics and its role in the financial report, using matching and statistical methods. It requires no model training, has a low computational load, and offers fast and highly accurate location. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0027] Figure 1 This specification shows a flowchart of a method for automatically locating the main financial table.
[0028] Figure 2 and Figure 3 A schematic diagram of a balance sheet is shown;
[0029] Figure 4 This document illustrates a flowchart of another method for automatically locating the financial master table provided in this specification;
[0030] Figure 5 This shows a schematic diagram of table pagination;
[0031] Figure 6 A schematic diagram of a notes table is shown;
[0032] Figure 7 This specification shows a schematic block diagram of a device for automatically locating the master financial statement.
[0033] Figure 8 A schematic block diagram of an electronic device provided in this specification is shown. Detailed Implementation
[0034] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0035] This manual provides a method for automatically locating the main financial table, such as... Figure 1 As shown, the method includes the following steps:
[0036] S10: Obtain a financial report in a predefined format.
[0037] Financial reports typically contain multiple seals and signatures. They are usually prepared by computer, including text and tables, printed as paper documents, then stamped or signed by relevant individuals. The paper documents are then scanned to create a PDF or photographed using a digital camera. The predefined format in S10 can be either PDF or image format.
[0038] In this manual, "financial report" refers to documents that companies are required to submit periodically. A financial report includes multiple financial statements and other company information. Financial statements include a main statement, supplementary statements, and notes; please refer to the background section for details.
[0039] S20: Identify textual and tabular information on each page of a financial report.
[0040] The content in financial reports cannot be directly recognized by computers. S20 can use OCR (optical character recognition) to recognize the character shapes in PDFs or images, and then translate the character shapes into characters that computers can directly recognize.
[0041] When the financial report is a PDF file, the area of a virtual sheet corresponding to a page number in the file is considered as one page; when the financial report is an image file, each image is considered as one page.
[0042] Table element information may include the number of tables on the page (e.g., 0, 1, 3), the pixel coordinates of each cell in the table (e.g., the pixel coordinates of the cell center point, the length and width of the cell in pixels), the content of the cell (i.e. what content is recorded in the cell), and the row and column information of the cell (i.e., how many rows and columns the cell is located in the table).
[0043] Text information can include text information outside the table or text information within the table. In addition to text information and table element information, S20 can also recognize other character information during recognition.
[0044] It should be noted that there are various types of tables in financial reports, which may be main financial statements, supplementary tables, or other types.
[0045] S30: Perform the following matching operations on each table and determine the corresponding main table type for each table based on the matching results: match the text information in each cell of the current table with the financial subject database to obtain the main table type corresponding to each subject in the current table; and / or, perform regular expression matching on the text information outside the current table within a predetermined range with the name of each main table type to obtain the matched main table type.
[0046] A financial account library can be a pre-defined list of account names included in a master financial statement, along with the corresponding master statement type for each account. A master financial statement can contain hundreds of accounts. Table 1 below shows one representation of a financial account library, where 1 in the master statement type represents the balance sheet, 2 represents the income statement, and 3 represents the cash flow statement.
[0047] Table 1
[0048] Subject Name Main table type Cash and cash equivalents balance at the end of the period 3 Net cash received from reinsurance business 3 Net cash received from disposal of subsidiaries and other business units 3 Operating costs 2 advance payments 1 accounts payable 1 Earnings per share: 2 Operating profit 2 I. Operating Revenue 2 Dividends Payable 1
[0049] S30 includes the following two matching operations: 1. Matching text information with the financial subject database: This involves matching the text information in each cell of the current table with the financial subject database to obtain the main table type corresponding to each subject in the current table, and then determining the main table type corresponding to the current table based on the main table type corresponding to each subject; 2. Regular expression matching: This involves performing regular expression matching on the text information within a predetermined range outside the current table with the names of each main table type to obtain the matched main table type, and then determining the main table type corresponding to the current table based on the main table type obtained from the regular expression matching operation. S30 can perform only the first matching operation, only the second matching operation, or both matching operations.
[0050] If S30 only performs the first matching operation, S30 can use the main table type with the most corresponding cells as the main table type corresponding to the current table. Accordingly, S30 may include the following steps A1, A2, and A3.
[0051] A1: For each cell in the current table that contains text information, perform the following operations: match the text information of the current cell with the financial subject database to determine whether there is a target subject in the financial subject database that matches the text information of the current cell; if so, determine the main table type corresponding to the target subject in the financial subject database; use the main table type corresponding to the target subject as the main table type corresponding to the text information in the current cell.
[0052] A2: Count the number of cells corresponding to each type in the main table.
[0053] A3: Use the main table type corresponding to the current table as the main table type if the number of corresponding cells is greater than or equal to the predetermined threshold.
[0054] For example, in a table, if the text information in 3 cells corresponds to the main table type of Balance Sheet, the text information in 5 cells corresponds to the main table type of Income Statement, and the text information in 2 cells corresponds to the main table type of Cash Flow Statement, and a predetermined threshold of 5 is set, then it can be determined that the main table type corresponding to this table is Income Statement.
[0055] If only the second matching operation is performed in S30, the matched main table type can be used as the main table type corresponding to the current table.
[0056] If S30 performs both a matching operation and a second matching operation, the above method can be used to determine the main table type corresponding to the current table based on the two matching results. Only if the results of the two methods are the same will the main table type corresponding to the current table be officially determined. If the results of the two methods are different, the main table type corresponding to the current table will be marked as pending.
[0057] When performing regular expression matching, only text information outside the current table within a "predefined range" is matched against the names of each main table. This predetermined range can be text information within a predetermined number of rows above or below the table, such as text information within the top five rows of the table. Typically, the main table will have its type name indicated within N rows above it, for example, Figure 2 and Figure 3 In the consolidated balance sheet shown, the text "Consolidated Balance Sheet" is located approximately on the third line above the table. By setting the range of regular expression matching, we can reduce the amount of calculation and more accurately identify the type of the main table to which the table corresponds.
[0058] In some financial reports, the term "balance sheet" in the main table may be written as: "asset statement", "liability statement", "asset.liability.statement" (where "." represents any single character), "asset balance sheet", "asset and liability", etc. When these terms are matched, it indicates that the matched main table type is a balance sheet.
[0059] In some financial reports, the "profit and loss statement" in the main table may be written as: "profit.{1,2} statement" (where .{1,2} represents one or two arbitrary characters), "profit", "wang" (the character "run" is often recognized as "wang" by OCR due to being covered by a stamp), "profit and profit distribution statement", "profit", etc. When these words are matched, it means that the matched main table type is a profit and loss statement.
[0060] In some financial reports, the "cash flow statement" in the main table may be written as: "cash.flow.statement", "cash.{1,2}statement" (where .{1,2} represents one or two arbitrary characters), "cash flow", etc. When these words are matched, it means that the matched main table type is a cash flow statement.
[0061] In some embodiments, such as Figure 4 As shown, performing either of the above two matching operations on each table fails to determine the corresponding main table type based on the matching results. This may be because the tables are displayed across multiple pages, for example... Figure 5 The profit and loss statement shown, Figure 1 and Figure 2 The balance sheet shown is provided. In this case, steps S71 to S76 can be performed after the matching operation.
[0062] S10: Obtain a financial report in a predefined format.
[0063] S20: Identify textual and tabular information on each page of a financial report.
[0064] S31: Perform the following matching operation on each table and determine the main table type corresponding to each table based on the matching results: Match the text information in each cell of the current table with the financial subject database to obtain the main table type corresponding to each subject in the current table.
[0065] S32: Perform the following matching operation on each table and determine the corresponding main table type based on the matching results: perform regular expression matching between the text information outside the current table within a predetermined range and the name of each main table type to obtain the matched main table type.
[0066] S71: Determine if the table is the first table on the current page. If yes, proceed to S72.
[0067] S72: Check if the bottom of the previous page is a table. If yes, proceed to S73; otherwise, proceed to S74 and S75.
[0068] S73: Determine the main table type corresponding to the table at the bottom of the previous page as the main table type corresponding to the table at the top of the current page.
[0069] S74: Perform regular expression matching between the text information at the bottom of the previous page and the names of each main table type.
[0070] S75: Use the matched main table type as the main table type corresponding to the table at the top of the current page.
[0071] If the type of the main table corresponding to the table at the bottom of the previous page cannot be determined, you can execute the following S76.
[0072] S76: Merge the table at the bottom of the previous page with the table at the top of the current page into one table, and match the text information in each cell of the merged table with the financial subject database to obtain the main table type corresponding to each subject in the merged table. Determine the main table type corresponding to the merged table based on the matching results.
[0073] In some embodiments, the notes table may also be determined as the main table type using the method described above. For example, Figure 6The table shown is a footnote table. The entries "Short-term Loans," "Notes Payable," "Accounts Payable," "Other Payables," "Long-term Payables," and "Net Assets" in the table correspond to the "Balance Sheet" main table type in the financial account database. Therefore, using the above method would misclassify this footnote table as a balance sheet. Based on this, this manual uses a statistical page number range method to further determine whether each page contains the main financial table. Specifically, steps S40, S50, and S60 are as follows.
[0074] S40: Page numbers of each page in the statistical financial report, and the main table type corresponding to the tables on each page.
[0075] For example, the statistical results can be shown in Table 2 below, where the results on pages 10-134 are omitted.
[0076] Table 2
[0077] page number Corresponding main table type 1 No main table 2 No main table 3 Balance Sheet 4 Income Statement 5 Income Statement 6 Income Statement 7 Cash Flow Statement 8 Cash Flow Statement 9 No main table … 135 Balance Sheet 136 No main table 137 Cash Flow Statement 138 No main table
[0078] S50: Aggregate the statistical results of multiple consecutive pages on the page that correspond to the main table type.
[0079] For example, the statistical results shown in Table 2 can be aggregated into Table 3 below, where 1 in the main table type represents the balance sheet, 2 represents the income statement, and 3 represents the cash flow statement.
[0080] Table 3
[0081] Page range 3-8 … 135 137 The main table type corresponding to the page 1,2,2,2,3,3 … 1 3
[0082] S60: Based on the aggregation results, determine the page range where the main financial table is located.
[0083] In some embodiments, S60 can first determine the target page range with the most corresponding main table types among the page ranges in the aggregation results, and use the target page range as the page range where the financial main table is located. For example, according to the aggregation results shown in Table 3, pages 3-8 can be used as the page range where the financial main table is located.
[0084] The inventors discovered that in financial reports, the first main table appearing within the page range containing the main financial table is usually the balance sheet. Based on this, in some embodiments, before S60, the following operation can be performed on each page range in the aggregation result: determine whether the type of the first main table corresponding to the current page range is a predetermined type; if not, determine that the current page range is not the page range containing the main financial table.
[0085] The predetermined type can be the balance sheet mentioned above. If the requirements for preparing financial reports change, requiring the income statement to be the first main statement to appear, then the predetermined type can also be the income statement. In other words, the predetermined type can be determined according to the requirements for preparing financial reports.
[0086] By checking whether the type of the first main table corresponding to the page range in the aggregation results is a predetermined type, some page ranges can be excluded in advance, thus improving the accuracy of the financial main table location results.
[0087] The inventors discovered that in financial reports, the main table is usually quite long, generally taking up one or more pages. Even the shortest main table takes up nearly half the paper. There is no situation where more than three main tables are arranged on one page. If more than three tables are arranged on one page, these tables are usually supplementary tables or appendices.
[0088] Based on this, in some embodiments, such as Figure 4 As shown, before S20, the steps S81 and S82 are also included.
[0089] S81: Determine the number of tables on each page.
[0090] S82: Determine if there is no financial master table on pages with more than 3 tables.
[0091] By pre-excluding pages without a main financial table based on the number of tables on the page, the amount of calculation required for subsequent operations can be reduced, and the speed of locating the main table can be improved.
[0092] The method, apparatus, and electronic equipment for automatically locating the main financial table provided in this manual first identify the textual information and table element information on each page of the financial report. Then, it determines the main table type corresponding to each table. Next, it statistically analyzes the page numbers of each page in the financial report and the main table types corresponding to the tables on each page. The statistical results of multiple consecutive pages with tables corresponding to the main table type are aggregated, and the page number range of the main financial table is determined based on the aggregation result. This solution automatically locates the main financial table based on its own characteristics and its role in the financial report, using matching and statistical methods. It requires no model training, has a low computational load, and offers fast and highly accurate location.
[0093] This manual provides a device for automatically locating the master financial table, which can be used to achieve... Figure 1 The method shown is for automatically locating the main financial table. For example... Figure 7 As shown, the device includes an acquisition unit 10, an identification unit 20, a first matching unit 30, a statistics unit 40, an aggregation unit 50, and a first determination unit 60.
[0094] The acquisition unit 10 is used to acquire financial reports in a predetermined format.
[0095] The identification unit 20 is used to identify text information and table element information on each page of the financial report.
[0096] The first matching unit 30 is used to perform the following matching operations on each table and determine the corresponding main table type based on the matching results: matching the text information in each cell of the current table with the financial subject database to obtain the main table type corresponding to each subject in the current table; and / or, performing regular expression matching on the text information outside the current table within a predetermined range with the name of each main table type to obtain the matched main table type.
[0097] The statistics unit 40 is used to count the page number of each page in the financial report and the main table type corresponding to the tables on each page.
[0098] Aggregation unit 50 is used to aggregate the statistical results of multiple consecutive pages on the page that correspond to the main table type.
[0099] The first determining unit 60 is used to determine the page range of the main financial table based on the aggregation results.
[0100] In some embodiments, the apparatus further includes: a second determining unit for determining the number of tables on each page; and a second determining unit for determining that there is no main financial table on pages with more than 3 tables.
[0101] In some embodiments, the first matching unit includes: a processing subunit, configured to perform the following operations on each cell containing text information in the current table: matching the text information of the current cell with a financial subject database to determine whether there is a target subject in the financial subject database that matches the text information of the current cell; if so, determining the main table type corresponding to the target subject in the financial subject database; using the main table type corresponding to the target subject as the main table type corresponding to the text information in the current cell; a statistics subunit, configured to count the number of cells corresponding to each main table type; and a first determining subunit, configured to use the main table type whose corresponding cell count is greater than or equal to a predetermined threshold as the main table type corresponding to the current table.
[0102] In some embodiments, the apparatus further includes: a third determining unit, configured to determine whether the table is the first table on the current page; a searching unit, configured to, if so, search whether the bottom of the previous page is a table; and a fourth determining unit, configured to, if so, determine the main table type corresponding to the table at the bottom of the previous page as the main table type corresponding to the table at the top of the current page.
[0103] In some embodiments, the apparatus further includes: a processing unit, configured to, when the main table type corresponding to the table at the bottom of the previous page cannot be determined, merge the table at the bottom of the previous page and the table at the top of the current page into one table, match the text information in each cell of the merged table with the financial subject database to obtain the main table type corresponding to each subject in the merged table, and determine the main table type corresponding to the merged table based on the matching result.
[0104] In some embodiments, the apparatus further includes: a second matching unit, configured to perform regular expression matching between the text information at the bottom of the previous page and the names of each main table type if the bottom of the previous page is not a table; and a fifth determining unit, configured to use the matched main table type as the main table type corresponding to the table at the top of the current page.
[0105] In some embodiments, the apparatus further includes an exclusion unit, configured to perform the following operation on each page range in the aggregation result: determine whether the type of the first main table corresponding to the current page range is a predetermined type; if not, determine that the current page range is not the page range where the financial main table is located.
[0106] In some embodiments, the first determining unit includes: a second determining subunit, configured to determine the target page range with the most corresponding main table types among the page ranges in the aggregation result; and a third determining subunit, configured to use the target page range as the page range where the financial main table is located.
[0107] The description and beneficial effects of the above-mentioned device for automatically locating the financial master table can be found in the description and beneficial effects of the method section, and will not be repeated here.
[0108] This invention also provides an electronic device, such as... Figure 8 As shown, the electronic device may include a processor 801 and a memory 802, wherein the processor 801 and the memory 802 may be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.
[0109] Processor 801 can be a Central Processing Unit (CPU). Processor 801 can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.
[0110] Memory 802, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the method for automatically locating the financial master table in this embodiment of the invention (e.g., Figure 7 The acquisition unit 10, identification unit 20, first matching unit 30, statistics unit 40, aggregation unit 50, and first determination unit 60 are shown. The processor 801 executes various functional applications and data classification by running non-transitory software programs, instructions, and modules stored in the memory 802, thereby realizing the method of automatically locating the financial master table in the above method embodiment.
[0111] The memory 802 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor 801, etc. Furthermore, the memory 802 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 802 may optionally include memory remotely located relative to the processor 801, and these remote memories may be connected to the processor 801 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0112] The one or more modules are stored in the memory 802, and when executed by the processor 801, the above-described method for automatically locating the financial master table is performed.
[0113] For details regarding the electronic device described above, please refer to the relevant descriptions and effects in the above embodiments for further understanding; they will not be repeated here.
[0114] This specification provides a computer storage medium storing computer program instructions that, when executed by a processor, implement the steps of the above-described method for automatically locating the financial master table.
[0115] This specification provides a computer program product comprising a computer program that, when executed by a processor, implements the steps of the above-described method for automatically locating the main financial table.
[0116] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.
[0117] The various embodiments in this specification are described in a progressive manner. For the same or similar parts between the various embodiments, please refer to each other. The focus of each embodiment is to describe the differences from other embodiments.
[0118] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions.
[0119] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0120] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute certain parts of the methods of various embodiments of this application.
[0121] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0122] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0123] Although this application has been described through embodiments, those skilled in the art will know that this application has many modifications and variations without departing from the spirit of this application, and it is intended that the appended claims cover such modifications and variations without departing from the spirit of this application.
Claims
1. A method of automatically locating a financial master sheet, characterized by, The method comprises: acquiring a financial report in a predetermined format; identifying text information and table element information on each page of the financial report; performing the following matching operations on each table, and determining the main table type corresponding to the table according to the matching results: matching the text information in each cell of the current table with a financial subject library to obtain the main table type corresponding to each subject in the current table; and / or performing regular matching of the text information in a predetermined range outside the current table with the names of each main table type to obtain the matched main table type; counting the page numbers of each page of the financial report, and the main table types corresponding to the tables on each page; aggregating the counting results of a plurality of continuous pages on which the tables correspond to the main table types; determining the page number range in which the financial main table is located according to the aggregation results; after each matching operation on each table fails to determine the main table type corresponding to the table according to the matching results, the method further comprises: determining whether the table is the first table on the current page; if so, checking whether the bottom of the previous page is a table; if so, determining the main table type corresponding to the table at the bottom of the previous page as the main table type corresponding to the table at the top of the current page; The method further comprises: in the case where the main table type corresponding to the table at the bottom of the previous page cannot be determined, merging the table at the bottom of the previous page and the table at the top of the current page into one table, and matching the text information in each cell of the merged table with the financial subject library to obtain the main table type corresponding to each subject in the merged table, and determining the main table type corresponding to the merged table according to the matching results.
2. The method of claim 1, wherein, Before performing the matching operation on each table and determining the main table type corresponding to the table according to the matching results, the method further comprises: determining the number of tables on each page; determining that there is no financial main table on the page on which the number of tables is greater than 3.
3. The method of claim 1, wherein, Matching the text information in each cell of the current table with the financial subject library to obtain the main table type corresponding to each subject in the current table comprises: performing the following operations on each cell containing text information in the current table: matching the text information in the current cell with the financial subject library to determine whether there is a target subject in the financial subject library that is consistent with the text information in the current cell; in the case where there is, determining the main table type corresponding to the target subject in the financial subject library; and taking the main table type corresponding to the target subject as the main table type corresponding to the text information in the current cell; counting the number of cells corresponding to each main table type; taking the main table type corresponding to the number of cells greater than or equal to a predetermined threshold as the main table type corresponding to the current table.
4. The method of claim 1, wherein, The method further comprises: if the bottom of the previous page is not a table, performing regular matching of the text information at the bottom of the previous page with the names of each main table type; taking the matched main table type as the main table type corresponding to the table at the top of the current page.
5. The method of claim 1, wherein, Before determining the page number range in which the financial main table is located according to the aggregation results, the method further comprises: performing the following operations on each page number range in the aggregation results: determining whether the type of the first main table corresponding to the current page number range is a predetermined type; if not, determining that the current page number range is not the page number range in which the financial main table is located.
6. The method of claim 1, wherein, According to the aggregation result, a page number range in which the financial master table is located is determined, including: determining a target page number range in which a master table type corresponding to the target page number range is the most in the aggregation result; taking the target page number range as the page number range in which the financial master table is located.
7. An apparatus for automatically locating a financial master sheet, characterized by including: an acquisition unit configured to acquire a financial report in a predetermined format; an identification unit configured to identify text information and table element information on each page of the financial report; a first matching unit configured to perform the following matching operations on each table and determine a master table type corresponding to the table according to a matching result: matching the text information in each cell in the current table with a financial subject library to obtain a master table type corresponding to each subject in the current table; and / or performing regular matching of the text information within a predetermined range outside the current table with the names of each master table type to obtain a matched master table type; a statistics unit configured to count the page numbers of each page of the financial report and the master table types corresponding to the tables on each page; an aggregation unit configured to aggregate the statistics of a plurality of continuous pages on which the tables correspond to the master table types; a first determination unit configured to determine a page number range in which the financial master table is located according to an aggregation result; The device further includes: a third determination unit configured to determine whether the table is the first table on the current page; a search unit configured to search whether the bottom of the previous page is a table if the answer is yes; a fourth determination unit configured to determine the master table type corresponding to the table at the bottom of the previous page as the master table type corresponding to the table at the top of the current page if the answer is yes; The device further includes: a processing unit configured to merge the table at the bottom of the previous page and the table at the top of the current page into one table and match the text information in each cell in the merged table with the financial subject library to obtain the master table type corresponding to each subject in the merged table in the case that the master table type corresponding to the table at the bottom of the previous page cannot be determined, and determine the master table type corresponding to the merged table according to the matching result.
8. An electronic device, comprising: including: a memory and a processor, which are in communication connection with each other, the memory stores computer instructions, and the processor implements the steps of the method of any one of claims 1 to 6 by executing the computer instructions.
9. A computer storage medium, characterized in that The computer storage medium stores computer program instructions, and the computer program instructions are executed by the processor to implement the steps of the method of any one of claims 1 to 6.
10. A computer program product, characterised in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.
Citation Information
Patent Citations
OCR-based financial statement information rapid extraction method and system
CN110929580A
Financial statement processing method and device and computer readable storage medium
CN113158988A