Document key information extraction method and information identification system
Patent Information
- Application Number
- CN202410829903.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-09-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the existing technology processes tabular documents, the identification and splicing of automatic line wrapping fields are inaccurate, resulting in deviations in the extraction and matching of key information in the financial field, affecting the accuracy and completeness of the data.
A method for extracting key document information is proposed, including obtaining text detection results and table cell position information, obtaining text collections through clipping and recognition, generating a collection of information to be matched according to preset arrangement rules, and matching it with the original text images. The target text information and coordinate position are identified, the Cycle-CenterNet and DBNet algorithms are used for table detection and text recognition, and the Gaussian filter and SVTR algorithm are combined to deal with noise and text clipping.
It achieves accurate extraction and matching of key information in table documents, improves data processing efficiency and analysis capabilities, enhances user experience, ensures data accuracy and completeness, and supports digital transformation and intelligent development in the financial field.
Smart Images

Figure CN118629059A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent information recognition, and in particular to a document key information extraction method and an information recognition system. Background Art
[0002] Existing document information extraction technologies mainly rely on OCR algorithms to detect and recognize text. Such technologies usually detect and recognize text in "rows"; however, such technologies have defects when processing long fields that automatically wrap. Since the text in a "table document" may span multiple cells, existing technologies cannot accurately splice these cross-row fields, resulting in deviations when matching key information or inability to find complete field information.
[0003] In the financial field, data accuracy and completeness are critical for information cross-checking and matching. For example, when processing portfolio data, the unique identifier of each project, such as the project number, must be matched accurately to ensure the correct allocation of funds and the effectiveness of investment decisions. In the prior art, especially in cases involving table documents, automatic line break fields often lead to the breakage of text information, which in turn affects the accurate extraction and matching of key information; in addition, in a large number of table documents, it is inevitable that there will be documents with irregular border lines. Different categories of information content in such documents are aggregated in the same cell area, which not only affects the accuracy of text recognition in subsequent work, but also affects the experience of other members of the team reading the table. Summary of the invention
[0004] The technical problem to be solved by the present invention is: how to design a method for extracting key information from documents, which can achieve accurate extraction when processing table documents in the financial field, especially solve the problem of inaccurate recognition and splicing of automatic line break fields.
[0005] In a first aspect, the present invention proposes a method for extracting key information from a document, the method comprising: S1, obtaining text detection result information and table cell position information based on an original text image to be matched; S2, clipping and identifying the matching results of the text detection result information and the table cell position information to obtain text clipping results and a text set; S3, arranging the text set according to a preset arrangement rule to generate an information set to be matched; S4, matching the information set to be matched with the original text image, and identifying the target text information and the corresponding coordinate position corresponding to the information set to be matched from the original text image.
[0006] Its further technical solution is that S1, based on the original text image to be matched, obtains text detection result information and table cell position information, including: S101, obtains the original text image to be matched, wherein the original text image contains at least one area of table text; S102, performs preprocessing, cell detection and text detection on the original text image to be matched in sequence, and obtains text detection result information and table cell position information.
[0007] Its further technical solution is that the S2, clipping and identifying the matching results of the text detection result information and the table cell position information, obtaining the text clipping results and the text set, includes: S103, calculating the matching degree between the text detection result information and the table cell position information, obtaining the text box cell matching results within the boundary range of the table cell; S104, performing cell text clipping on the text box cell matching results, obtaining the text clipping results; S105, performing text recognition on the text clipping results obtained by cell clipping, and obtaining the text set.
[0008] Its further technical solution is that, in S102, the original text image to be matched is preprocessed, cell detected and text detected in sequence to obtain text detection result information and table cell position information, including: S201, using a Gaussian filter to smooth the image of the original text image to be matched to reduce noise and obtain a denoised image; S202, using the Cycle-CenterNet table detection algorithm to process the denoised image, detecting the center line of the table through cycle consistency to detect the rows and columns of the table, detecting the rows and columns of the table according to the prediction results of the center to vertex branch, the prediction results of the vertex to center branch, and the calculation results of the pairing distance, and determining the position of each cell; S203, in the image area containing the table, using the DBNet text detection algorithm to locate the exact position of the text, so as to accurately locate the text in the image area.
[0009] Its further technical solution is to obtain the prediction results of the center-to-vertex branch, including: given the feature map F obtained from the MobileNet-V3 backbone network, the center-to-vertex branch aims to predict the offset from the center of each cell to its four vertices, defined as:
[0010] Δx cik =x Ci -x Vik , Δy Cik =y Ci -y vik , i=1:N C , k = 1:4
[0011] Among them, N Cis the number of all cell centers; (x Ci ,y Ci ) are the coordinates of the cell center; (x Vik ,y Vik ) are the coordinates of the corresponding vertex; Δx Cik and Δy Cik They are the offsets from the center point to the vertex on the x-axis and y-axis respectively.
[0012] The prediction results of the vertex-to-center branch are obtained, including: the vertex-to-center branch predicts the offset of the center of the cell around the shared vertex, expressed as:
[0013] Δx Vik =x Vi -x Cik , Δy Vik =y Vi -y Cik , i=1:N V , k = 1:4
[0014] Among them, N V represents the number of all shared vertices; (x Vi ,y Vi ) are vertex coordinates; (x Cik ,y Cik ) are the coordinates of the center of the surrounding cells; Δx Vik and Δy Vik is the offset from the vertex to the center point.
[0015] In the above scheme, the MobileNet-V3 backbone network is a deep learning model used to extract features from the input image; the feature map F is the result obtained after the backbone network processes the image, representing the two-dimensional output of the features of each area of the image.
[0016] A further technical solution is that the calculation result of the pairing distance is obtained, including: in order to evaluate the matching quality of each center-vertex pair, a pairing distance Dcv is introduced, which is defined as:
[0017]
[0018] in, is the regression value from the center to the vertex, is the ideal center-to-vertex vector, is the magnitude of the vector. D CV measures the deviation of the actual prediction from the ideal situation. A value close to 0 indicates a perfect match, while a value greater than 1 indicates no intersection, which means that special attention needs to be paid to learning.
[0019] Its further technical solution is that the S103 calculates the matching degree between the text detection result information and the table cell position information, and obtains the text box cell matching result within the boundary range of the table cell, including: using the intersection-and-union method to calculate the matching degree between the text detection result information and the table cell position information to ensure that the text in each cell can be correctly corresponded, and the calculation formula is: IOU = intersection area / union area; wherein, the intersection area refers to the area of the overlapping part of two geometric shapes, such as the first rectangle detected by the text and the second rectangle corresponding to the table cell. If the first rectangle and the second rectangle do not overlap, the intersection area is zero. The union area is the sum of the areas of the two geometric shapes minus their intersection area; that is, all areas covered by the first rectangle and the second rectangle, including the overlapping part.
[0020] Its further technical solution is that S104 performs cell text clipping on the text box cell matching result to obtain the text clipping result, including: based on the text box cell matching result, the text in each cell is clipped by fusing the bounding box interception and pixel-level mask image processing technology to remove unnecessary interfering background and obtain the text clipping result.
[0021] A further technical solution is that, in S105, the text clipping result obtained by cell clipping is subjected to text recognition to obtain a text set, including: using an SVTR text recognition algorithm to perform text recognition on the clipped single-line text in the cell. Furthermore, a high-precision SVTR text recognition algorithm is used to perform text recognition.
[0022] A further technical solution is that the S3 arranges the text set according to a preset arrangement rule to generate a set of information to be matched, including: arranging the recognized text according to the format of the original table to restore the table structure. This includes correctly placing the recognized text in its corresponding cell and reorganizing the rows and columns of the table. The definition of restoring the table structure is to determine the position of each cell of the table and the specific text information in the corresponding cell, which is consistent with the original table.
[0023] A further technical solution is that, in S4, the information set to be matched is matched with the original text image, and the target text information and the corresponding coordinate position corresponding to the information set to be matched are identified from the original text image, including: from the original text image, the identified text is matched with the cell area in the original image, and the accurate coordinate position of each character in the image is returned. The implementation of this step can help users accurately locate the identified text in the original image and realize more accurate information extraction.
[0024] Its further technical solution is that after matching the information set to be matched with the original text image and identifying the target text information corresponding to the information set to be matched and the corresponding coordinate position from the original text image, the method also includes: S5, identifying the outer boundary line of the table in the original text image based on the original text image and the position information of the table cell; S6, based on the original text image and the outer boundary line, constructing a grayscale table boundary line connected to the outer boundary line in some table cells in the original text image; S7, using the image after adding the grayscale table boundary line to the original text image as an archived text image for storage and backup.
[0025] Its further technical solution is that, based on the original text image and the external boundary line, in some table cells in the original text image, grayscale table boundaries connected to the external boundary line are constructed, including: S601, content cleaning processing is performed on the area covered by the external boundary line in the original text image to obtain a to-be-processed interface containing identifiable information; S602, information recognition of the to-be-processed interface is realized based on a data training classification model, and at least three information categories are obtained; S603, the to-be-processed cells containing at least three information categories are identified in the table cells of the to-be-processed interface, and the to-be-processed cells are connected to the grayscale table boundaries by the external boundary line, and the number of grayscale table boundaries in the entire original text image is at least ten; After identifying the cells to be processed that contain at least three information categories among the table cells of the interface to be processed, and dividing the cells to be processed into at least two parts by connecting the gray table dividing lines with the outer boundary lines, the method further includes: S701, judging whether the directions of at least ten gray table dividing lines are horizontal; S702, keeping the contents of the table cells whose gray table dividing lines are horizontal unchanged; S703, identifying the table cells whose gray table dividing lines are not horizontal, adjusting the gray table dividing lines to the horizontal direction, and then adjusting the position of the text information in the table cells within the range of the original information category according to the horizontal gray table dividing lines, so that the direction of the text information is horizontal. The cell is divided into at least two parts.
[0026] In a second aspect, the present invention provides an information recognition system, the information recognition system comprising a unit for executing the method as described in the first aspect. The information recognition system can achieve accurate extraction in the financial field when processing table documents, especially solving the problem of inaccurate recognition and splicing of automatic line break fields.
[0027] Compared with the prior art, the advantages of the solution of the present invention include:
[0028] First, improve data processing efficiency: By automatically identifying and splicing fields in tables, this solution reduces the need for manual intervention and improves data processing efficiency. Financial institutions process a large number of documents, such as bills, reports, etc. The traditional manual processing method is time-consuming and labor-intensive, and prone to errors. This solution can complete the extraction and matching of key information in documents in a relatively short time, greatly improving processing efficiency.
[0029] Second, enhance data analysis capabilities: By ensuring the accuracy and completeness of key information in documents, this solution improves the ability of financial institutions to conduct data analysis; the accurate data support in this solution can help institutions better understand customer needs and market trends and make more reasonable business decisions; for example, based on accurate portfolio data analysis, risks and returns can be assessed more accurately, investment strategies can be optimized, and the return on investment can be improved.
[0030] Third, improve user experience: This solution can improve the user experience of using financial services. When customers open accounts and handle business, they need to fill in and check a lot of document information, which often contains a lot of form data. By implementing this solution, financial institutions can process these documents faster and more accurately, reduce customer waiting time, improve service efficiency, and increase user satisfaction.
[0031] To sum up, the technical solution of the present invention has broad application prospects in the financial field, can effectively improve the accuracy, efficiency and user experience of information processing, and provide important support for the digital transformation and intelligent development of the financial field.
[0032] In the financial field, the accuracy and completeness of data are crucial for information cross-checking and matching. For example, when processing investment portfolio data, the unique identifier of each project, such as the project number, must be matched accurately to ensure the correct allocation of funds and the effectiveness of investment decisions. In the prior art, especially in the case of table documents, automatic line break fields often lead to the breakage of text information, which in turn affects the accurate extraction and matching of key information; the present application solves the above technical problems and can achieve accurate extraction in the financial field when processing table documents, especially solving the problem of inaccurate recognition and splicing of automatic line break fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0035] Figure 1 A flowchart of a method for extracting key information from a document provided by an embodiment of the present invention.
[0036] Figure 2 Another flowchart of the method for extracting key information from a document provided by an embodiment of the present invention.
[0037] Figure 3 Another flowchart of the method for extracting key information from a document provided by an embodiment of the present invention.
[0038] Figure 4 A block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or other features, integers, steps, operations, elements, components and / or combinations thereof.
[0041] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0042] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to one or any combination and all possible combinations of the associated listed items, and includes these combinations.
[0043] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0044] Example 1
[0045] See also Figures 1 to 3 ,in Figure 1 A flowchart of a method for extracting key information from a document provided by an embodiment of the present invention. The present invention provides a method for extracting key information from a document, which is used for cross-checking and matching information in the financial field to improve the accuracy and completeness of data. The method for extracting key information from a document includes:
[0046] S1, obtaining text detection result information and table cell position information according to the original text image to be matched.
[0047] S2, cutting and identifying the matching results of the text detection result information and the table cell position information, and obtaining the text cutting results and the text set.
[0048] S3, arranging the text set according to a preset arrangement rule to generate a set of information to be matched.
[0049] S4, determining whether the parameter indicators of the plurality of terminal devices meet the preset conditions.
[0050] In the above scheme, the function of arranging the text set according to the preset arrangement rules and generating the information set to be matched is to determine which cell area the detected text box belongs to. According to the original text image to be matched, the text detection result information and the table cell position information are obtained, wherein the text detection result information can be the text in the PDF file, and the table cell position information can be the actual position of the table in the PDF file. In one embodiment, the target text information and the corresponding coordinate position corresponding to the information set to be matched are identified from the original text image, wherein the original text image corresponds to the original PDF file, and the information set to be matched corresponds to the generated result, and the generated result ultimately still needs to correspond to the original PDF file, that is, it still needs to correspond to the original text image.
[0051] In one embodiment, the step S1, obtaining text detection result information and table cell position information according to the original text image to be matched, includes:
[0052] S101, obtaining an original text image to be matched, wherein the original text image contains at least one area of table text.
[0053] S102, performing preprocessing, cell detection and text detection on the original text image to be matched in sequence, and obtaining text detection result information and table cell position information.
[0054] In one embodiment, the step S2, clipping and identifying the matching results of the text detection result information and the table cell position information to obtain the text clipping results and the text set, includes:
[0055] S103, calculating the matching degree between the text detection result information and the table cell position information, and obtaining the text box cell matching result within the boundary range of the table cell.
[0056] S104, performing cell text clipping on the text box cell matching result to obtain the text clipping result.
[0057] S105, performing text recognition on the text clipping results obtained by clipping the cells to obtain a text set.
[0058] In the above scheme, the table cell position information is converted based on the table cell. The table cell is obtained in that after the image passes through the table recognition algorithm, the four vertex coordinates of the cell and the cell type are obtained, thereby determining the position of the cell in the table area; wherein the table cell corresponding to the table cell position information can be a standard cell or an irregular cell.
[0059] In one embodiment, the S102, sequentially performing preprocessing, cell detection, and text detection on the original text image to be matched, and obtaining text detection result information and table cell position information, includes:
[0060] S201, using a Gaussian filter to smooth the original text image to be matched to reduce noise, and obtain a denoised image;
[0061] S202, using the Cycle-CenterNet table detection algorithm, the denoised image is processed, the center line of the table is detected by cycle consistency to detect the rows and columns of the table, and the rows and columns of the table are detected according to the prediction results of the center-to-vertex branch, the prediction results of the vertex-to-center branch, and the calculation results of the pairing distance, to determine the position of each cell.
[0062] S203, using the DBNet text detection algorithm to locate the exact position of the text in the image region containing the table, so as to accurately locate the text in the image region.
[0063] In the above scheme, a Gaussian filter is used to smooth the original text image to be matched to reduce noise and obtain a denoised image, wherein the Gaussian filter is implemented by applying a weighted average of a Gaussian function around each pixel.
[0064] In the above scheme, the DBNet text detection algorithm is used to locate the exact position of the text in the image area containing the table, so as to accurately locate the text in the image area. The result is the coordinates of the four vertices of the text area, including all the text positions in the table, with the cell as the perspective.
[0065] In one embodiment, the acquisition of the prediction result of the center-to-vertex branch includes: given a feature map F obtained from the MobileNet-V3 backbone network, the center-to-vertex branch aims to predict the offset from the center of each cell to its four vertices, which is defined as:
[0066] Ax Cik =x Ci -x Vik , Δy Cik =y Ci -y Vik , i=1:N C , k = 1:4
[0067] Among them, N C is the number of all cell centers; (z Ci ,y Ci ) are the coordinates of the cell center; (x Vi k,y Vik ) are the coordinates of the corresponding vertex; Δx Cik and Δy Cik They are the offsets from the center point to the vertex on the x-axis and y-axis respectively.
[0068] The prediction results of the vertex-to-center branch are obtained, including: the vertex-to-center branch predicts the offset of the center of the cell around the shared vertex, expressed as:
[0069] Ax Vik =x Vi -x Cik , Δy Vik =y Vi -y Cik , i=1:N V , k = 1:4
[0070] Among them, N V represents the number of all shared vertices; (x Vi ,y Vi ) are vertex coordinates; (x Cik ,y Cik) are the coordinates of the center of the surrounding cells; Δx Vik and Δy Vik is the offset from the vertex to the center point.
[0071] In the above scheme, the MobileNet-V3 backbone network is a deep learning model used to extract features from the input image; the feature map F is the result obtained after the backbone network processes the image, representing the two-dimensional output of the features of each area of the image.
[0072] In one embodiment, the calculation result of the pairing distance is obtained, including: in order to evaluate the matching quality of each center-vertex pair, a pairing distance Dcv is introduced, which is defined as:
[0073]
[0074] in, is the regression value from the center to the vertex, is the ideal center-to-vertex vector, is the magnitude of the vector. D CV measures the deviation of the actual prediction from the ideal situation. A value close to 0 indicates a perfect match, while a value greater than 1 indicates no intersection, which means that special attention needs to be paid to learning.
[0075] In one embodiment, the step S103 of calculating the matching degree between the text detection result information and the table cell position information, and obtaining the text box cell matching result within the boundary range of the table cell, includes:
[0076] The intersection-over-union method is used to calculate the matching degree between the text detection result information and the table cell position information to ensure that the text in each cell can correspond correctly. The calculation formula is:
[0077] IOU = Area of Intersection / Area of Union.
[0078] The intersection area refers to the area of the overlapping part of two geometric shapes, such as the first rectangle detected by text and the second rectangle corresponding to the table cell. If the first rectangle and the second rectangle do not overlap, the intersection area is zero. The union area is the sum of the areas of the two geometric shapes minus their intersection area; that is, all the areas covered by the first rectangle and the second rectangle, including the overlapping parts.
[0079] In one embodiment, the step S104 of performing cell text clipping on the text box cell matching result to obtain the text clipping result includes:
[0080] According to the text box cell matching results, the text in each cell is cropped by integrating the bounding box interception and pixel-level mask image processing technology to remove unnecessary interfering background and obtain the text cropping result.
[0081] In one embodiment, the step S105 of performing text recognition on the text clipping result obtained by clipping the cell to obtain a text set includes:
[0082] The SVTR text recognition algorithm is used to perform text recognition on the cropped single-line text in the cell. Furthermore, the high-precision SVTR text recognition algorithm is used to perform text recognition.
[0083] In one embodiment, the step S3 arranges the text set according to a preset arrangement rule to generate a set of information to be matched, including:
[0084] Arrange the recognized text according to the format of the original table and restore the table structure. This includes correctly placing the recognized text in its corresponding cell and reorganizing the rows and columns of the table. The definition of restoring the table structure is to determine the position of each cell of the table and the specific text information in the corresponding cell, which is consistent with the original table.
[0085] In one embodiment, the step S4, matching the information set to be matched with the original text image, and identifying the target text information and the corresponding coordinate position corresponding to the information set to be matched from the original text image, includes:
[0086] From the original text image, the recognized text is matched with the cell area in the original image, and the exact coordinate position of each character in the image is returned. The implementation of this step can help users accurately locate the recognized text in the original image and achieve more accurate information extraction.
[0087] In one embodiment, after matching the information set to be matched with the original text image and identifying the target text information and the corresponding coordinate position corresponding to the information set to be matched from the original text image, the method further includes:
[0088] S5, identifying the outer boundary line of the table in the original text image according to the original text image and the position information of the table cells.
[0089] S6, based on the original text image and the external boundary line, constructing a grayscale table boundary line connected to the external boundary line in some table cells in the original text image.
[0090] S7, adding the grayscale table dividing line to the original text image as the archived text image for storage backup.
[0091] In the above scheme, the outer boundary line wraps the table cell, and the specific outer boundary line and the specific table cell can be identified and recognized by those skilled in the art. According to the original text image and the table cell position information, the outer boundary line of the table in the original text image is identified, wherein the outer boundary line of the table includes the border / border line of the entire table, and the detailed border / border line other than the border of the entire table. The table in the original text image includes a plurality of table cells, and the boundary lines of the table cells themselves are black, or other dark colors. If it is black, the corresponding grayscale table dividing line is gray, and if it is other dark colors, the corresponding grayscale table dividing line is a color similar to other dark colors and lighter in color. The specific degree shall be determined by the ability of the engineer or reader to distinguish.
[0092] In one embodiment, based on the original text image and the external boundary line, constructing a grayscale table boundary line interconnected with the external boundary line in some table cells in the original text image includes:
[0093] S601, performing content cleaning processing on the area covered by the outer boundary line in the original text image to obtain an interface to be processed containing recognizable information.
[0094] S602, identifying information of the interface to be processed based on a data training classification model, and obtaining at least three information categories.
[0095] S603, identifying cells to be processed that contain at least three information categories among the table cells of the interface to be processed, and dividing the cells to be processed into at least two parts by connecting the grayscale table dividing lines with external boundary lines.
[0096] In the above scheme, the area covered by the outer boundary line in the original text image is cleaned to obtain an interface to be processed containing identifiable information, wherein the identifiable information may include conventional text information, image information, and unconventional information. Depending on the specific situation, the image information and unconventional information can be cleaned, that is, noise information is removed. The information recognition of the interface to be processed is realized based on the data training classification model, that is, the information recognition of the identifiable information of the interface to be processed is realized based on the data training classification model. The cells to be processed are cells with more information categories, that is, cells that need to invest resources for processing.
[0097] Furthermore, based on the data training classification model, information recognition of the interface to be processed is realized to obtain at least three information categories, which can be Chinese characters and numbers, or Chinese characters, ID card numbers, and telephone number numbers, or four or five types. The specific types can be defined by technical personnel in this field according to actual conditions.
[0098] Furthermore, among the table cells of the interface to be processed, the cells to be processed that contain at least three information categories are identified, and the cells to be processed are divided into at least two parts by connecting the grayscale table dividing line with an external boundary line; the three information categories may not all exist in the same cell to be processed, and it is also possible that only two information categories are contained, and therefore divided into at least two parts, that is, three parts.
[0099] In one embodiment, the number of grayscale table dividing lines in the entire original text image is at least ten; among the table cells of the interface to be processed, the cells to be processed of at least three information categories are identified, and after the cells to be processed are divided into at least two parts by connecting the grayscale table dividing lines with external boundaries, the method further includes:
[0100] S701, determining whether directions of at least ten grayscale table boundary lines are horizontal.
[0101] S702, keeping the contents of the table cells whose grayscale table boundary lines are in the horizontal direction unchanged.
[0102] S703, identifying table cells whose grayscale table boundary line is not in the horizontal direction, adjusting the grayscale table boundary line to the horizontal direction, and then adjusting the position of the text information in the table cell within the range of the original information category according to the horizontal grayscale table boundary line so that the direction of the text information is horizontal.
[0103] In the above scheme, the horizontal direction is the direction that conforms to the writing and reading habits; the content of the table cell whose grayscale table dividing line is in the horizontal direction is kept unchanged, corresponding to the case where the grayscale table dividing line itself is a straight line. According to the grayscale table dividing line in the horizontal direction, the position of the text information in the table cell is adjusted within the scope of the original information category so that the direction of the text information is in the horizontal direction. The adjustment within the scope of the original information category means that the position of the text information will not be disordered.
[0104] In the financial field, among the massive amount of table documents, it is inevitable that there will be documents with irregular border lines. Different categories of information content in such documents are aggregated in the same cell area, which not only affects the accuracy of text recognition in subsequent work, but also affects the experience of other members of the team reading the table. The embodiment of the present application solves the above problem. For documents with irregular border lines, the text information can be readjusted through the grayscale table dividing line to solve the problem of different categories of information content being aggregated in the same cell area, thereby enhancing the accuracy of text recognition in subsequent work and improving the experience of other members of the team reading the table.
[0105] Example 2
[0106] See also Figure 4 , Figure 4 This is a block diagram of an electronic device provided by the present invention. The electronic device can be a terminal or a server, wherein the terminal can be an electronic device with communication functions such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The server can be an independent server or a server cluster composed of servers.
[0107] It includes a processor 111 , a communication interface 112 , a memory 113 , and a communication bus 114 , wherein the processor 111 , the communication interface 112 , and the memory 113 communicate with each other via the communication bus 114 .
[0108] The memory 113 is used to store computer programs.
[0109] In one embodiment of the present invention, the processor 111 is used to implement the method provided by any one of the above method embodiments when executing the program stored in the memory 113.
[0110] It should be understood that in the embodiment of the present application, the processor 111 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0111] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0112] Therefore, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method provided in any one of the aforementioned method embodiments are implemented.
[0113] The storage medium is a physical, non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk, or an optical disk, etc., which can store program codes. The computer-readable storage medium can be non-volatile or volatile.
[0114] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions, but such implementation should not be considered to be beyond the scope of the present invention.
[0115] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0116] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0117] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0118] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0119] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
[0120] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for extracting key information from a document, characterized in that: The method comprises: S1, obtaining text detection result information and table cell position information according to the original text image to be matched; S2, cutting and identifying the matching results of the text detection result information and the table cell position information to obtain the text cutting results and the text set; S3, arranging the text set according to a preset arrangement rule to generate a set of information to be matched; S4, matching the information set to be matched with the original text image, and identifying the target text information and the corresponding coordinate position corresponding to the information set to be matched from the original text image.
2. The method for extracting key information from a document according to claim 1, characterized in that: The step S1, obtaining text detection result information and table cell position information according to the original text image to be matched, includes: S101, obtaining an original text image to be matched, wherein the original text image contains at least one area of table text; S102, performing preprocessing, cell detection and text detection on the original text image to be matched in sequence, and obtaining text detection result information and table cell position information.
3. The method for extracting key information from a document according to claim 2, characterized in that: The step S2, clipping and identifying the matching results of the text detection result information and the table cell position information, and obtaining the text clipping results and the text set, includes: S103, calculating the matching degree between the text detection result information and the table cell position information, and obtaining the text box cell matching result within the boundary range of the table cell; S104, performing cell text clipping on the text box cell matching result to obtain a text clipping result; S105, performing text recognition on the text clipping results obtained by clipping the cells to obtain a text set.
4. The method for extracting key information from a document according to claim 3, characterized in that: The step S102, performing preprocessing, cell detection and text detection on the original text image to be matched in sequence, and obtaining text detection result information and table cell position information, includes: Use a Gaussian filter to smooth the original text image to reduce noise and obtain a denoised image; The denoised image is processed using the Cycle-CenterNet table detection algorithm, and the center line of the table is detected by cycle consistency to detect the rows and columns of the table. The rows and columns of the table are detected according to the prediction results of the center-to-vertex branch, the prediction results of the vertex-to-center branch, and the calculation results of the pairing distance, so as to determine the position of each cell; In the image area containing the table, the DBNet text detection algorithm is used to locate the exact position of the text, so as to accurately locate the text in the image area.
5. The method for extracting key information from a document according to claim 4, characterized in that: The acquisition of the prediction results of the center-to-vertex branch includes: given the feature map F obtained from the MobileNet-V3 backbone network, the center-to-vertex branch aims to predict the offset of each cell center to its four vertices, defined as: Δx Cik =x Ci -x Vik ,Δy Cik =y Ci -y Vik ,i=1:N C ,k=1:4 Among them, N C is the number of all cell centers; (x Ci ,y Ci ) are the coordinates of the cell center; (x Vik ,y Vik ) are the coordinates of the corresponding vertex; Δx Cik and Δy Cik They are the offsets from the center point to the vertex on the x-axis and y-axis respectively. The prediction results of the vertex-to-center branch are obtained, including: the vertex-to-center branch predicts the offset of the center of the cell around the shared vertex, expressed as: Δx Vik =x Vi -x Cik ,Δy Vik =y Vi -y Cik ,i=1:N v ,k=1:4 Among them, N V represents the number of all shared vertices; (x Vi ,y Vi ) are vertex coordinates; (x Cik ,y Cik ) are the coordinates of the center of the surrounding cells; Δx Vik and Δy Vik is the offset from the vertex to the center point.
6. The method for extracting key information from a document according to claim 5, characterized in that: The calculation result of the pairing distance is obtained, including: in order to evaluate the matching quality of each center-vertex pair, a pairing distance Dcv is introduced, which is defined as: in, is the regression value from the center to the vertex, is the ideal center-to-vertex vector, is the modulus of the vector. Dcv measures the deviation between the actual prediction and the ideal situation. A value close to 0 indicates a perfect match, and a value greater than 1 indicates no intersection, which means that special attention needs to be paid to learning.
7. The method for extracting key information from a document according to claim 1, characterized in that: After matching the information set to be matched with the original text image and identifying the target text information and the corresponding coordinate position corresponding to the information set to be matched from the original text image, the method further includes: According to the original text image and the position information of the table cells, the outer boundary line of the table in the original text image is identified; Based on the original text image and the external boundary line, a grayscale table boundary line connected to the external boundary line is constructed in some table cells in the original text image; The image after adding the grayscale table dividing line to the original text image is used as an archived text image for storage and backup.
8. The method for extracting key information from a document according to claim 7, characterized in that: The method of constructing a grayscale table boundary line interconnected with the external boundary line in some table cells in the original text image based on the original text image and the external boundary line includes: Perform content cleaning on the area covered by the outer boundary line in the original text image to obtain an interface to be processed containing recognizable information; Based on the data training classification model, the information of the interface to be processed is recognized, and at least three information categories are obtained; Among the table cells of the interface to be processed, cells to be processed that contain at least three information categories are identified, and the cells to be processed are divided into at least two parts in a manner of connecting the grayscale table dividing line with an external boundary line.
9. The method for extracting key information from a document according to claim 8, characterized in that: The number of grayscale table dividing lines in the entire original text image is at least ten; among the table cells of the interface to be processed, the cells to be processed that contain at least three information categories are identified, and after the cells to be processed are divided into at least two parts by connecting the grayscale table dividing lines with external boundary lines, the method further includes: Determine whether the directions of at least ten grayscale table boundary lines are horizontal; Keep the contents of table cells whose grayscale table dividing lines are horizontal unchanged; Identify table cells whose grayscale table dividing lines are not in the horizontal direction, adjust the grayscale table dividing lines to the horizontal direction, and then adjust the position of the text information in the table cells within the range of the original information category according to the horizontal grayscale table dividing lines so that the direction of the text information is horizontal.
10. An information recognition system, characterized in that: The information identification system comprises a unit for executing the method according to any one of claims 1-9.
Citation Information
Patent Citations
Invoice text information identification method based on deep learning
CN112149654A
Table picture structure analysis method, system and device and readable storage medium
CN112712014A
E-commerce table image recognition method and device based on deep learning
CN117710999A
Character detection and recognition method and apparatus, electronic device, and storage medium
WO2023071119A1
Cited By
Enterprise qualification evaluation system and method
CN119886920A
