A method and system for extracting key information from financial reports

Through the combination of OCR and deep learning model, the relationship between the header and cell position in the financial report picture is identified, the problem of wrong rows and columns is corrected, and the high-precision extraction of key financial report information is achieved, and the problem of inaccurate financial report picture recognition in the existing technology is solved.

CN120198928BActive Publication Date: 2025-08-19ZHONGQI LIANXIN (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510675374.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-08-19
Estimated Expiration
2045-05-23

AI Technical Summary

Technical Problem

When existing deep learning models deal with financial report pictures with tilt, seal occlusion and imperfect focus, they are prone to problems with wrong rows and columns, resulting in a decrease in the accuracy of extracting key financial report information.

Method used

Optical character recognition technology (OCR) is used to initially process report pictures, identify the table header and cell position relationship of target data, combine with deep learning models to replace and mark the table, correct wrong rows and columns, use the number of text and numeric cells to determine the column type, and match the tag information of the target cell based on the relative position relationship.

Benefits of technology

It improves the accuracy of extracting key financial report information, can accurately match and extract target data in the presence of wrong rows and columns, correct normal identification errors, and ensure the accuracy and reliability of financial report data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120198928B_ABST
    Figure CN120198928B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for extracting key information from financial reports, the method comprising the following steps: obtaining a report image to be identified, processing the report image to be identified into a first table using optical character recognition, performing text recognition on cells in a first area, and performing a first mark or a second mark on a target data column based on the recognition result; traversing each column of the first table, determining whether the column is a text column based on the number of text cells and the number of numeric cells in each column, dividing the second table into multiple areas based on the position of the text column, and determining the positional relationship between a first mark and a second mark for each area; searching for a target cell in the text column of each area, and if the target cell is found, determining at least one numeric column on one side of the column based on the position of the column where the target cell is located, and matching the first mark or the second mark based on the position of the numeric column to determine information corresponding to the first mark or the second mark of the target cell.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method and system for extracting key information from financial reports. Background Art

[0002] With the development of deep learning technology, financial report information extraction has been widely applied in financial report audits. Deep learning plays a crucial role in table extraction, providing strong support for the accurate and efficient extraction of tabular data from complex documents. Deep learning models demonstrate exceptional recognition and comprehension capabilities in table extraction tasks. For extracting table content, deep learning models can be combined with optical character recognition (OCR) technology to accurately identify and extract text within tables. Through training on large-scale datasets, the model learns text characteristics in different fonts, sizes, and layouts, enabling high-precision extraction of complex table content. Deep learning technology also supports end-to-end table extraction, integrating table detection, structure recognition, and content extraction steps into a unified model. This significantly simplifies the process and improves extraction efficiency, providing powerful support for data processing and analysis in numerous fields, including finance, healthcare, and scientific research.

[0003] However, the review process often involves a large number of images, including customer photos, scanned documents, and printouts. These images often include tilted images, images with seals obscuring keywords, and images with imperfect focus. Existing open-source models are not perfect for table structure detection, seal removal, and image dewarping, which can easily lead to misaligned rows and columns, and cause errors in the automated recognition of target information. Summary of the Invention

[0004] In view of this, an embodiment of the present invention provides a method and system for extracting key information from financial reports to eliminate or improve one or more defects in the prior art.

[0005] One aspect of the present invention provides a method for extracting key information from financial reports, the method comprising the following steps:

[0006] Obtaining a report image to be identified, processing the report image to be identified into a first table using optical character recognition, and performing character replacement on a first preset area in the first table to obtain a second table;

[0007] Performing text recognition on cells in the first area of the second table, and performing a first mark or a second mark on the target data column based on the recognition result;

[0008] Traversing each column of the first table, determining whether the column is a text column based on the number of text cells and the number of numeric cells in each column, dividing the second table into multiple regions based on the position of the text columns, and determining the positional relationship between the first marker and the second marker for each region;

[0009] The position of the target cell is queried based on the text in the text column of each area. If the target cell is found in the area, at least one numeric column on the side of the column where the target cell is located is determined based on the position of the column, and the first mark or the second mark is matched based on the position of the numeric column to determine the information of the target cell corresponding to the first mark or the second mark.

[0010] Using the above scheme, this scheme first uses optical character recognition technology (OCR) to perform preliminary recognition of the report image to be recognized, including the report. However, the preliminary results may have certain problems of wrong rows and columns. This scheme further identifies the column position of the target data header and the row position of the target cell. Based on the relative position relationship between the actual data position on one side of the target cell and the column position of the target data header, the data is matched with the header. When wrong rows and columns occur, matching can also be performed based on the relative position relationship to complete data extraction and ensure extraction accuracy.

[0011] In some embodiments of the present invention, in the step of replacing characters in the first preset area in the first table to obtain the second table, the text in each cell in the first preset area is read. If the read text is the text to be replaced, the text is replaced with a preset replacement text.

[0012] In some embodiments of the present invention, in the step of performing text recognition on cells in the first area of the second table and performing a first mark or a second mark on the target data column based on the recognition result, a first recognition is performed on the cells in the first area of the second table to complete preliminary marking, and the cells are marked as a first pre-mark, a second pre-mark or unmarked. For the cells that are first pre-marked and second pre-marked, a second recognition is used to reverse the first pre-marked and second pre-marked cells.

[0013] In some embodiments of the present invention, in the step of performing a reversal determination on the first pre-marked and the second pre-marked cells using the second recognition:

[0014] If the reversal determination of the first pre-marked cell fails, the cell is first marked; if the reversal determination of the first pre-marked cell succeeds, the cell is second marked;

[0015] If the reversal determination of the second pre-marked cell fails, the cell is subjected to the second marking; if the reversal determination of the second pre-marked cell succeeds, the cell is subjected to the first marking.

[0016] In some embodiments of the present invention, the step of traversing each column of the first table and determining whether the column is a text column based on the number of text cells and the number of numeric cells in each column includes:

[0017] For each cell of a column, determine the value of the text variable based on the number of text cells and the value of the numeric variable based on the number of numeric cells.

[0018] Compares text variable values to numeric variable values, and compares text variable values to text variable thresholds to determine whether the column is text.

[0019] In some embodiments of the present invention, in the step of comparing the text variable value with the numeric variable value and comparing the text variable value with the text variable threshold to determine whether the column is a text column, if the text variable value is greater than the numeric variable value and the text variable value is greater than the text variable threshold, then the column is determined to be a text column.

[0020] In some embodiments of the present invention, in the step of dividing the second table into multiple areas based on the position of the text column, the position of the text column is calculated from left to right. If a text column is recognized, it is calculated to the right. If another text column is recognized, the column between the text column and the adjacent text column on the right is regarded as one area; if the table boundary is recognized, the column between the text column and the table boundary is regarded as one area.

[0021] In some embodiments of the present invention, in the step of determining the positional relationship between the first marker and the second marker for each area, the distance between the cell of the first marker and the text column on the left side and the text column or table boundary on the right side of the area is calculated, and the distance between the cell of the second marker and the text column on the left side and the text column or table boundary on the right side of the area is calculated, and the positional relationship between the cell of the first marker and the cell of the second marker is determined by the two distance values.

[0022] In some embodiments of the present invention, the step of searching for the location of a target cell based on the text in the text column of each region, if the target cell is found in the region, determining at least one numeric column adjacent to the column based on the position of the column where the target cell is located, matching a first tag or a second tag based on the position of the numeric column, and determining information corresponding to the first tag or the second tag for the target cell includes:

[0023] Match the target text in the text column of each area. If the target text is matched to the target cell, determine at least one numeric column on the side of the column based on the position of the column where the target cell is located.

[0024] If there are two number columns on one side of the column where the target cell is located, based on the relative positions of the two number columns and the corresponding positional relationship between the cell with the first mark and the cell with the second mark, the number columns corresponding to the first mark and the second mark are determined respectively, and the information corresponding to the first mark and the second mark in the two number columns of the row where the target cell is located is determined.

[0025] In some embodiments of the present invention, if there is a numerical column on one side of the column where the target cell is located, the numerical column is determined to correspond to the first mark or the second mark based on the horizontal position of the numerical column and the horizontal position of the cell with the first mark and the cell with the second mark, and the information that the row where the target cell is located corresponds to the first mark or the second mark in the numerical column is determined.

[0026] In some embodiments of the present invention, if there is a number column on one side of the column where the target cell is located, it is simultaneously determined whether there are at least three number columns in the area adjacent to the area where the target cell is located. If so, a number column close to the current area in the adjacent area is included in the calculation of the current area, and the calculation is performed based on the existence of two number columns on one side of the column where the target cell is located.

[0027] In some embodiments of the present invention, in the step of determining at least one numeric column on one side of the column based on the position of the column where the target cell is located, the cells in a column are determined one by one. If the content of the cell is not 0 and the length of the digits excluding the decimal point is greater than a preset length, a true count is added to the column; if the content of the cell is 0 or not 0, but the length of the digits excluding the decimal point is not greater than a preset length, a false count is added to the column. The true count and the false count in a column are compared to determine whether the column is a numeric column.

[0028] The second aspect of the present invention also provides a financial report key information extraction system, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps implemented by the method described above.

[0029] The third aspect of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps implemented by the aforementioned method for extracting key information from financial reports.

[0030] Additional advantages, objects, and features of the present invention will be described in part in the following description and will become apparent to those skilled in the art after studying the following or may be learned by practice of the present invention. The objects and other advantages of the present invention may be particularly pointed out and attained in the description and drawings.

[0031] Those skilled in the art will understand that the purposes and advantages that can be achieved by the present invention are not limited to the above specific descriptions, and the above and other purposes that can be achieved by the present invention will be more clearly understood based on the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.

[0033] Figure 1 This is a schematic diagram of the first implementation method of the financial report key information extraction method of this scheme;

[0034] Figure 2 This is a schematic diagram of the second implementation method of the financial report key information extraction method of this scheme;

[0035] Figure 3 This is a schematic diagram of the third implementation method of the financial report key information extraction method of this scheme;

[0036] Figure 4 Schematic diagram of an implementation of step S300 of this solution;

[0037] Figure 5 A schematic diagram of the page of the table processed by this solution. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0039] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, the accompanying drawings only show structures and / or processing steps closely related to the solutions according to the present invention, while other details that are not closely related to the present invention are omitted.

[0040] In the existing technology, with the development of deep learning technology, financial report information extraction technology has been widely used in financial report auditing. The audit process often involves a large number of customer photos, scanned documents, printed photos and other pictures, and these pictures often include tilted pictures, pictures with seals blocking keywords, and pictures with imperfect focus.

[0041] However, existing open-source models aren't perfect for table structure detection, stamp removal, and image dewarping. Consequently, even after going through a series of steps, Excel spreadsheets generated from financial reports can still experience issues like incorrect rows and columns, incorrect cell text recognition, and column names and content not being in the same column. Therefore, extracting key or interesting information from such Excel spreadsheets presents significant challenges, with different extraction rules yielding vastly different extraction rates. It's worth noting that OCR recognition has a high accuracy rate for many field values, so extracting key information from irregularly arranged Excel spreadsheets is extremely valuable. A high extraction rate can directly provide data references for businesses and inform their decision-making. Currently, extracting key information from Excel spreadsheets after financial reports is relatively uncommon. Existing algorithms often invest heavily in pre-processing, such as addressing issues like incorrect rows and columns. However, few utilize post-processing algorithms, such as the approach and algorithm in this article, to extract information from existing Excel spreadsheets, potentially offsetting the incorrect rows and columns and OCR recognition issues introduced by pre-processing models.

[0042] like Figure 1 and 5 As shown, the present invention proposes a method for extracting key information from financial reports, the method comprising the following steps:

[0043] Step S100: obtaining a report image to be recognized, processing the report image to be recognized into a first table using optical character recognition, performing character replacement on a first preset area in the first table to obtain a second table;

[0044] In a specific implementation, the report in the report image to be identified may refer to a company's financial report, which mainly includes an income statement, a cash flow statement, and a balance sheet. These reports are regularly published by companies or organizations to reflect their financial status, operating results, and cash flow.

[0045] In the specific implementation process, optical character recognition is used to process the report image to be recognized into the first table. Optical character recognition (OCR) technology mainly converts the text in the image into a computer-readable text format. The working principle involves image processing technologies such as binarization, noise removal, and character segmentation to accurately recognize the text in the image. OCR is commonly used to process unstructured image data such as scanned documents, text in photos, and screenshots.

[0046] In the specific implementation process, in the step of using optical character recognition to process the report image to be identified into the first table, OCR is combined with a deep learning model. Specifically, the deep learning model can be NLP. The combination of OCR+NLP is applied to the field of information extraction, such as automatically extracting required information from documents such as bills and contracts. OCR is responsible for converting document images into text, and NLP is responsible for parsing these texts and extracting useful data.

[0047] In the specific implementation process, deep learning methods include the following technologies: (1) Artificial Neural Networks (ANN): including Multilayer Perceptrons (MLP), Convolutional Neural Networks (CNN), Recurrent Neural Networks (RNN), etc. ANN is the foundation of deep learning and is used to simulate and learn complex nonlinear relationships. (2) Convolution operation: The core operation used in convolutional neural networks to extract features from the input image. The convolution kernel (filter) slides across the image and performs feature extraction on the local area. (3) Pooling: An operation used in convolutional neural networks to reduce the size of feature maps, extract key features, and reduce computational complexity, such as maximum pooling and average pooling. (4) Recurrent Neural Networks (RNN): Used to process sequential data (such as text and speech), it has memory capabilities and can consider information from previous time steps. (5) Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU): variants of RNNs designed to address the long-term dependency issues faced by traditional RNNs and are particularly suitable for processing long sequence data. (6) Generative Adversarial Networks (GANs): adversarial models consisting of generators and discriminators used to generate realistic new data samples, such as images and audio. (7) Autoencoders: an unsupervised learning method for learning effective representations of data, including sparse autoencoders and variational autoencoders. (8) Deep Reinforcement Learning (DRL): a combination of deep learning and reinforcement learning used to solve tasks that require long-term decision-making and environment interaction, such as game play optimization and robot control. (9) Transfer Learning: using pre-trained models to adjust them on new tasks to speed up training and improve performance. (10) Batch Normalization: A technique used to accelerate the neural network training process and enhance the model's generalization ability. (11) Optimization algorithms: Such as Stochastic Gradient Descent (SGD) and its variants (such as Adam and RMSProp), which are used to adjust the weights and biases of the neural network to minimize the loss function.(12) Regularization techniques: such as Dropout, L1 and L2 regularization, are used to prevent neural networks from overfitting and improve generalization capabilities.

[0048] Step S200 , performing text recognition on cells in the first area of the second table, and performing a first mark or a second mark on a target data column based on the recognition result;

[0049] Step S300, traversing each column of the first table, determining whether the column is a text column based on the number of text cells and the number of numeric cells in each column, dividing the second table into multiple regions based on the position of the text columns, and determining the positional relationship between the first marker and the second marker for each region;

[0050] In step S400, the position of the target cell is searched based on the text in the text column of each area. If the target cell is found in the area, at least one numeric column on the side of the column where the target cell is located is determined based on the position of the column where the target cell is located, and the first mark or the second mark is matched based on the position of the numeric column to determine the information of the target cell corresponding to the first mark or the second mark.

[0051] Using the above scheme, this scheme first uses optical character recognition technology (OCR) to perform preliminary recognition of the report image to be recognized, including the report. However, the preliminary results may have certain problems of wrong rows and columns. This scheme further identifies the column position of the target data header and the row position of the target cell. Based on the relative position relationship between the actual data position on one side of the target cell and the column position of the target data header, the data is matched with the header. When wrong rows and columns occur, matching can also be performed based on the relative position relationship to complete data extraction and ensure extraction accuracy.

[0052] In some embodiments of the present invention, in the step of replacing characters in the first preset area in the first table to obtain the second table, the text in each cell in the first preset area is read. If the read text is the text to be replaced, the text is replaced with a preset replacement text.

[0053] In the specific implementation process, for the text in the cells such as the fields of 'year-end balance', 'beginning balance', 'year-end number' and 'beginning-of-year number'. If the core words observed in this solution are 'end' and 'beginning'. That is, if 'end' or 'beginning' appears in the field, it corresponds to 'year-end balance' and 'beginning balance'. Therefore, if OCR misidentifies 'end' or 'beginning', it may have a greater impact; this solution needs to analyze the scenarios where 'end' and 'beginning' may be misidentified by OCR. Specifically, the common misidentifications of 'end', such as the words to be replaced for 'this', 'water', 'come', 'not', 'technique' and 'Zhu' can all be replaced with the replacement word 'end'; the common misidentifications of 'beginning', such as the words to be replaced for 'cut','repair', 'lining','shirt' and 'clothes' can all be replaced with the replacement word 'beginning'.

[0054] Adopting the above solution can correct the common misidentifications of recognized words.

[0055] Such as Figure 2 As shown, in some embodiments of the present invention, in the step of performing text recognition on the cells in the first area of the second table and performing the first marking or the second marking on the target data column based on the recognition result, it includes step S210 of performing the first recognition on the cells in the first area of the second table to complete the preliminary marking, and marking the cells as the first pre-marking, the second pre-marking or non-marking. For the cells with the first pre-marking and the second pre-marking, in step S220, use the second recognition to perform a reverse determination on the cells with the first pre-marking and the second pre-marking.

[0056] In some embodiments of the present invention, in the step of performing the first recognition on the cells in the first area of the second table to complete the preliminary marking and marking the cells as the first pre-marking, the second pre-marking or non-marking, since 'beginning' often corresponds to the cell being 'beginning-of-year XX' and 'end' often corresponds to the cell being 'year-end XX', the first pre-marking is the 'beginning' marking, the second pre-marking is the 'end' marking, and the non-marking is the marking that is marked as neither 'beginning' nor 'end'.

[0057] After analyzing multiple sample data, it is not feasible to identify only through 'end' and 'beginning' because sometimes due to problems such as blurry focus and seal covering in the picture quality, this keyword may not be recognized. Therefore, a more stringent field recognition method, that is, combined recognition, is required.

[0058] For fields containing the word "chu," different companies may also include words like "previous year" and "last year." Therefore, we first filter for "shang," "qu," and "chu"; then, filter for "qibeginning." We then filter for fields beginning with "shang" and ending with "e," fields beginning with "qu" and ending with "e," fields beginning with "nian" and ending with "e," fields beginning with "nian" and ending with "e," fields beginning with "nian" and ending with "shu," and fields beginning with "nian" and ending with "yu." For fields containing the word "mo," we supplement recognition with "qimo" to maintain accuracy. We then filter for fields beginning with "qi" and ending with "e," fields beginning with "qi" and ending with "yu," and fields beginning with "qi" and ending with "shu." The same process is performed for the key fields to be extracted.

[0059] Specifically, the first mark corresponds to the balance at the beginning of the year, and the second mark corresponds to the balance at the end of the year.

[0060] For example, since the end of the previous year is the beginning of this year, if 'end' is identified, it cannot be directly equated to the end of this year. If 'last year' or 'the year before last' is determined at the same time, then the end of last year or the end of the year before last is equivalent to the beginning of this year. In this case, the original corresponding 'end' mark is reversed to the 'beginning' mark, so that the corresponding final first mark is the balance at the beginning of the year; the same applies when 'beginning' is identified.

[0061] like Figure 3 As shown, in some embodiments of the present invention, the step of using the second identification to perform reversal determination on the first pre-marked and the second pre-marked cells includes:

[0062] Step S221: if the reversal determination of the first pre-marked cell fails, the cell is first marked; if the reversal determination of the first pre-marked cell succeeds, the cell is second marked;

[0063] Step S222: if the reversal determination of the second pre-marked cell fails, the cell is subjected to the second marking; if the reversal determination of the second pre-marked cell succeeds, the cell is subjected to the first marking.

[0064] Using the above scheme, this scheme needs to ensure that the first mark and the second mark correspond to the header phrase, such as the correspondence between "year-end balance". Therefore, this scheme first uses a single word for judgment, such as constructing a preliminary correspondence through the correspondence between the end and "year-end balance", and further corrects the original correspondence error through reversal judgment to ensure recognition accuracy.

[0065] like Figure 4As shown, in some embodiments of the present invention, the step of traversing each column of the first table and determining whether the column is a text column based on the number of text cells and the number of numeric cells in each column includes:

[0066] Step S310 , determining each cell of a column one by one, determining the value of a text variable based on the number of text cells, and determining the value of a numeric variable based on the number of numeric cells;

[0067] Step S320 , comparing the text variable value with the numeric variable value, and comparing the text variable value with the text variable threshold value to determine whether the column is a text column.

[0068] In the specific implementation process, the number of numeric cells is the numeric variable value, and the number of text cells is the text variable value.

[0069] In some embodiments of the present invention, in the step of comparing the text variable value with the numeric variable value and comparing the text variable value with the text variable threshold to determine whether the column is a text column, if the text variable value is greater than the numeric variable value and the text variable value is greater than the text variable threshold, then the column is determined to be a text column.

[0070] In the specific implementation process, the text variable threshold is 4. In the step of comparing the text variable value with the digital variable value, and comparing the text variable value with the text variable threshold to determine whether the column is a text column, if the text variable value is greater than the digital variable value, and the text variable value is greater than 4, then the column is determined to be a text column.

[0071] In some embodiments of the present invention, the step of dividing the second table into multiple areas based on the position of the text column includes, in step S330, calculating from left to right based on the position of the text column, if a text column is recognized, calculating to the right, if another text column is recognized, then the column between the text column and another text column adjacent to the right is regarded as one area; if a table boundary is recognized, then the column between the text column and the table boundary is regarded as one area.

[0072] In some embodiments of the present invention, the step of determining the positional relationship between the first marker and the second marker for each area includes, step S340, calculating the distance between the cell of the first marker and the text column on the left side and the text column or table boundary on the right side of the area, calculating the distance between the cell of the second marker and the text column on the left side and the text column or table boundary on the right side of the area, and determining the positional relationship between the cell of the first marker and the cell of the second marker through the two distance values.

[0073] In the specific implementation process, in the step of determining the positional relationship between the first marked cell and the second marked cell by two distance values, both distance values are horizontal distances, and the positional relationship between the first marked cell and the second marked cell is a horizontal positional relationship, that is, the first marked cell is on the right or left side of the second marked cell.

[0074] In some embodiments of the present invention, the step of searching for the location of a target cell based on the text in the text column of each region, if the target cell is found in the region, determining at least one numeric column adjacent to the column based on the position of the column where the target cell is located, matching a first tag or a second tag based on the position of the numeric column, and determining information corresponding to the first tag or the second tag for the target cell includes:

[0075] Match the target text in the text column of each area. If the target text is matched to the target cell, determine at least one numeric column on the side of the column based on the position of the column where the target cell is located.

[0076] If there are two number columns on one side of the column where the target cell is located, based on the relative positions of the two number columns and the corresponding positional relationship between the cell with the first mark and the cell with the second mark, the number columns corresponding to the first mark and the second mark are determined respectively, and the information corresponding to the first mark and the second mark in the two number columns of the row where the target cell is located is determined.

[0077] Using the above scheme, if the positional relationship between the cell with the first mark and the cell with the second mark is that the cell with the first mark is to the left of the cell with the second mark, then based on the left-right positional relationship of the two number columns, the number column on the left corresponds to the first mark, and the number column on the right corresponds to the second mark; even if there is a certain misalignment between the two number columns, the correspondence can be completed based on the relative relationship, that is, for the columns required by this scheme, which are the year-end balance and the beginning-of-the-year balance, the above steps can ensure that the data in the two columns correspond, thereby improving the recognition accuracy.

[0078] In the specific implementation process, in the step of matching the target text in the text column of each area, the text column of each area is replaced. For example, if the target text is "notes receivable", it is necessary to recognize that the "ticket" in "notes receivable" may be recognized as "period", so "payable period" must be mapped to "notes payable".

[0079] In some embodiments of the present invention, if there is a numerical column on one side of the column where the target cell is located, the numerical column is determined to correspond to the first mark or the second mark based on the horizontal position of the numerical column and the horizontal position of the cell with the first mark and the cell with the second mark, and the information that the row where the target cell is located corresponds to the first mark or the second mark in the numerical column is determined.

[0080] Using the above solution, even if there is only one digital column, the corresponding first marker or second marker is determined based on the distance between the digital column and the columns where the first marker and the second marker are located. Specifically, the columns where the first marker and the second marker are located that are closer in distance are used as the corresponding first marker or second marker.

[0081] In some embodiments of the present invention, if there is a number column on one side of the column where the target cell is located, it is simultaneously determined whether there are at least three number columns in the area adjacent to the area where the target cell is located. If so, a number column close to the current area in the adjacent area is included in the calculation of the current area, and the calculation is performed based on the existence of two number columns on one side of the column where the target cell is located.

[0082] With the above solution, when there is only one digital column, there may be a situation where the column is offset to other areas. Including adjacent areas in the calculation can further correct the offset of the column.

[0083] In some embodiments of the present invention, if a region includes at least three digital columns, and at least one of the digital columns is included in the calculation of the adjacent region, the remaining digital columns are calculated for the region. While resolving the column offset, the amount of calculation for the region with multiple digital columns is reduced, and the calculation accuracy of the region with multiple digital columns can also be guaranteed at the same time.

[0084] In some embodiments of the present invention, in the step of determining at least one numeric column on one side of the column based on the position of the column where the target cell is located, the cells in a column are determined one by one. If the content of the cell is not 0 and the length of the digits excluding the decimal point is greater than a preset length, a true count is added to the column; if the content of the cell is 0 or not 0, but the length of the digits excluding the decimal point is not greater than a preset length, a false count is added to the column. The true count and the false count in a column are compared to determine whether the column is a numeric column.

[0085] In a specific implementation process, the preset length is 6.

[0086] The beneficial effects of this solution include: its logical operations are purely rule-based and require very limited computing resources; it can tolerate problems caused by a certain range of misaligned columns and OCR column name errors; it applies rule experience brought by a large number of diverse data sets; it has limited computer running resource overhead; it is highly flexible and can quickly modify and optimize the solution to extract key information for new situations; for different key information, this solution only needs to modify the font mapping rules, and does not need to modify the extraction logic and methods.

[0087] In summary, this solution uses a post-processing algorithm to extract key information from Excel files after financial report recognition. This addresses OCR issues and misaligned rows and columns caused by seals. For Excel files generated after financial report recognition and affected by seals, this solution provides logic and methods for extracting information from the table structure. This invention provides a solution for addressing the impact of seals on OCR recognition of certain locations, particularly column names. This invention also addresses misaligned columns in table structure detection caused by image distortion, tilt, and other factors.

[0088] An embodiment of the present invention also provides a financial report key information extraction system, which includes a computer device, the computer device including a processor and a memory, the memory storing computer instructions, the processor being used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the system implements the steps implemented by the method described above.

[0089] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program implements the steps of the aforementioned method for extracting key information from financial reports. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, floppy disk, hard disk, removable storage disk, CD-ROM, or any other form of storage medium known in the art.

[0090] It should be understood by those skilled in the art that the various exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether to implement the system in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention. When implemented in hardware, it may be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via a data signal carried in a carrier wave.

[0091] It should be understood that the present invention is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted. In the above embodiments, several specific steps are described and illustrated as examples. However, the method of the present invention is not limited to the specific steps described and illustrated. Those skilled in the art may make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present invention.

[0092] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or replace features of other embodiments.

[0093] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations to the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A method for extracting key information from financial reports, characterized in that: The steps of the method include: Obtaining a report image to be identified, processing the report image to be identified into a first table using optical character recognition, and performing character replacement on a first preset area in the first table to obtain a second table; Performing text recognition on cells in the first area of the second table, and performing a first mark or a second mark on the target data column based on the recognition result; Traversing each column of the first table, determining whether the column is a text column based on the number of text cells and the number of numeric cells in each column, dividing the second table into multiple regions based on the positions of the text columns, determining the positional relationship between a first marker and a second marker for each region, calculating the distance between the first-marked cell and the text column to the left and the text column to the right of the region or the table boundary, calculating the distance between the second-marked cell and the text column to the left and the text column to the right of the region or the table boundary, and determining the positional relationship between the first-marked cell and the second-marked cell based on the two distance values; The position of the target cell is queried based on the text in the text column of each area. If the target cell is found in the area, at least one digital column of the column on one side of the column is determined based on the position of the column where the target cell is located, and the first mark or the second mark is matched based on the position of the digital column to determine the information that the target cell corresponds to the first mark or the second mark. The position of the target cell is queried based on the text in the text column of each area. If the target cell is found in the area, the target text is matched in the text column of each area. If the target cell where the target text is located is matched, at least one digital column of the column on one side of the column is determined based on the position of the column where the target cell is located; if there are two digital columns on one side of the column where the target cell is located, based on the relative position of the two digital columns corresponding to the positional relationship between the cell with the first mark and the cell with the second mark, the digital columns corresponding to the first mark and the second mark are respectively determined, and the information that the row where the target cell is located corresponds to the first mark and the second mark in the two digital columns is determined.

2. The method for extracting key information from financial reports according to claim 1, characterized in that: In the step of replacing characters in the first preset area in the first table to obtain the second table, the text in each cell in the first preset area is read. If the read text is the text to be replaced, the text is replaced with a preset replacement text.

3. The method for extracting key information from financial reports according to claim 1, wherein: In the step of performing text recognition on the cells in the first area of the second table and performing a first mark or a second mark on the target data column based on the recognition result, the cells in the first area of the second table are first recognized to complete preliminary marking, and the cells are marked as first pre-marked, second pre-marked, or unmarked. For the cells that are subjected to the first pre-marking and the second pre-marking; Performing a reversal determination on the first pre-marked and second pre-marked cells using a second recognition method, and if the reversal determination on the first pre-marked cell fails, performing a first marking on the cell; If the reversal determination of the first pre-marked cell is successful, the cell is subjected to a second marking; If the reversal determination of the second pre-marked cell fails, the cell is subjected to a second marking; If the reversal determination of the second pre-marked cell is successful, the cell is subjected to the first marking.

4. The method for extracting key information from financial reports according to claim 1, wherein: The step of traversing each column of the first table and determining whether the column is a text column based on the number of text cells and the number of numeric cells in each column includes: For each cell of a column, determine the value of the text variable based on the number of text cells and the value of the numeric variable based on the number of numeric cells. Compares text variable values to numeric variable values, and compares text variable values to text variable thresholds to determine whether the column is text.

5. The method for extracting key information from financial reports according to claim 4, characterized in that: In the step of comparing the text variable value with the numeric variable value and comparing the text variable value with the text variable threshold to determine whether the column is a text column, if the text variable value is greater than the numeric variable value and the text variable value is greater than the text variable threshold, then the column is determined to be a text column.

6. The method for extracting key information from financial reports according to claim 1, characterized in that: In the step of dividing the second table into a plurality of regions based on the position of the character string, the position of the character string is deduced from left to right. If a character string is recognized, the position is deduced to the right. If another character string is recognized, the columns between the character string and the adjacent character string on the right are considered as one region. If the table boundary is recognized, the columns between the text column and the table boundary are regarded as a region.

7. The method for extracting key information from financial reports according to claim 1, characterized in that: In the step of determining at least one numeric column on one side of the column based on the position of the column where the target cell is located, the cells in a column are determined one by one. If the content of the cell is not 0 and the length of the digits excluding the decimal point is greater than a preset length, a true count is added to the column; if the content of the cell is 0 or not 0, but the length of the digits excluding the decimal point is not greater than a preset length, a false count is added to the column. The true count and the false count in a column are compared to determine whether the column is a numeric column.

8. A financial report key information extraction system, characterized by: The system includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps implemented by the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Report processing method and device

    CN113177551A

  • Financial statement processing method and device

    CN115457578A