Method and system for extracting water resource index system based on table in literature

CN118552971APending Publication Date: 2024-08-27AGRI INFORMATION INST OF CHINESE ACAD OF AGRI SCI
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410640335.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

[0003]本发明的目的在于提供一种基于文献中表格提取水资源指标体系的方法及系统,从而解决现有技术中存在的前述问题

Benefits of technology

[0038] The beneficial effects of the present invention are: 1. The method of the present invention can quickly and accurately extract the water resource index system from the literature, improving the efficiency and accuracy of data acquisition. 2. This invention helps researchers and decision-makers manage and utilize water resources more effectively through automatic extraction and analysis of tabular data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552971A
    Figure CN118552971A
Patent Text Reader

Abstract

The invention discloses a method and system for extracting a water resource index system based on a table in literature, and the method comprises the following steps: S1, table region detection; s2, image preprocessing; s3, table structure analysis; s4, text detection and recognition; and S5, generating an index system. The method has the advantages that the water resource index system can be rapidly and accurately extracted from the literature, and the data acquisition efficiency and accuracy are improved. Through automatic extraction and analysis of table data, researchers and decision makers can manage and utilize water resources more effectively.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water resource management, and in particular to a method and system for extracting a water resource indicator system based on a table in a document. Background Art

[0002] Water resources are an indispensable basic element in the natural environment and play a vital role in maintaining the balance of the ecosystem. With the increasing demand for water resources, the rational use and protection of water resources has become an important issue. The establishment of a water resources indicator system is helpful to optimize the current water resources planning and achieve sustainable use of water resources. However, water resources indicator data are scattered in different databases and literatures, which makes it difficult to obtain information and affects the effective management and in-depth research of the water resources indicator system. Summary of the invention

[0003] The purpose of the present invention is to provide a method and system for extracting a water resource indicator system based on a table in a document, thereby solving the above-mentioned problems existing in the prior art.

[0004] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0005] A method for extracting a water resources indicator system based on a table in the literature includes the following steps:

[0006] S1. Table area detection: Based on the literature database, the table area detection model is used in combination with PDF information and traditional image processing technology to locate and extract table images from the literature.

[0007] S2, image preprocessing: preprocessing the detected table image to enhance the recognizability of table lines and text in the table image;

[0008] S3, table structure analysis: optimize the table lines in the preprocessed table image and determine the specific structure of the table using projection technology;

[0009] S4, text detection and recognition: using the text detection model to detect the text area in the preprocessed table image, and then using the text recognition model to recognize the text content in the text area;

[0010] S5. Index system generation: based on the text content, confirm whether the current table is a water resource index system table. If so, based on the coordinates of the text area and the specific structure of the table, extract the table keys and their corresponding table values ​​in the water resource index system table to construct a water resource index system.

[0011] Preferably, step S1 specifically comprises converting the document into a YOLOv4-t i ny network model for constructing a table line and table cell recognition, converting the document into a format that can be processed by the model, inputting the format-converted document into the model, and extracting a table image in the document using the YOLOv4-t i ny network model;

[0012] The YOLOv4-t i ny network model uses the CSP-darknet53-t i ny provided in the Darknet framework as the backbone network. It reduces the number of model parameters and computational complexity by using the CSP strategy while maintaining a high feature extraction capability.

[0013] Preferably, step S2 specifically includes first performing grayscale processing and then performing binarization processing on the table image to enhance the recognizability of table lines and text.

[0014] Preferably, step S3 specifically includes optimizing the table lines in the processed table image through corrosion and expansion operations, and then accurately locating the specific position of the table using projection technology;

[0015] Projection technology first determines the specific coordinates of the table structure lines, and then combines them with the position information of the table header to accurately determine the specific structure of the table.

[0016] Preferably, step S4 specifically comprises extracting the text area in the table image using the DBNet algorithm, and then extracting the text content from the text area using the CRNN model;

[0017] The DBNet algorithm first determines the location of the text target, and then crops the text sub-image of the original image based on the location of the text target to obtain the text area containing the text.

[0018] Preferably, step S5 specifically includes the following contents:

[0019] S51, based on the header text contained in the text content, searching for preset keywords or phrases related to water resources to determine whether the current table is a water resources indicator system table; if the preset keywords are matched in the header text, then determining that the current table is a water resources indicator system table;

[0020] S52. Combining the text area detected by the DBNet algorithm with the line structure of the water resource indicator system table, grouping the text area in the X and Y directions to distinguish the table keys and their corresponding table values ​​in the water resource indicator system table, and constructing the water resource indicator system based on the table keys and the corresponding table values.

[0021] Preferably, step S52 specifically includes the following contents:

[0022] S521, obtaining the X-axis coordinates of all text areas in the water resources indicator system table, and sorting these X-axis coordinates; calculating the gradient of the X-axis coordinates in the X-axis direction, determining whether two adjacent X-axis coordinates belong to the same row by setting the X-axis direction gradient threshold, and then vertically grouping the text areas in the X-axis direction;

[0023] S522, obtaining the Y-axis coordinates of all rows in the water resource indicator system table, the Y-axis coordinates including the header line, the dividing line and the bottom line, storing these Y-axis coordinates in an array, determining the text area whose geometric center is located between two adjacent columns of data in the array, and these text areas are table keys; based on the specific position of the text area, calculating the gradient of the Y-axis coordinate in the Y-axis direction, determining whether two adjacent Y-axis coordinates belong to the same column by setting a Y-axis direction gradient threshold, and then horizontally grouping each column of table values ​​in the Y-axis direction;

[0024] S523. Extract corresponding table keys and table values ​​based on the grouping results to form a water resources indicator system.

[0025] Preferably, the method further comprises,

[0026] Word frequency statistics and analysis: Statistical analysis of the frequency of use of indicators in the water resources indicator data, and analyze the relative importance of each indicator in water resources management.

[0027] The present invention also aims to provide a system for extracting a water resource indicator system based on a table in a document, and the system can implement the above-mentioned method; the system includes a water resource indicator system data extraction module, which includes:

[0028] Table area detection unit: used to locate and extract table images from documents based on the document database using the table area detection model combined with PDF information and traditional image processing technology;

[0029] Image preprocessing unit: used to preprocess the detected table image to enhance the recognizability of table lines and text in the table image;

[0030] Table structure analysis unit: used to optimize the table lines in the preprocessed table image and determine the specific position of the table using projection technology;

[0031] Text detection and recognition unit: used to detect the text area in the preprocessed table image using the text detection model, and then recognize the text content in the text area using the text recognition model;

[0032] Index system generation unit: used to confirm whether the current table is a water resource index system table based on the text content. If so, the text box coordinates are combined with the specific position of the table to perform threshold segmentation on the extracted text content in the X and Y directions respectively, and the row and column areas of the wireless coordinates are divided to form a water resource index system.

[0033] Preferably, the system further comprises:

[0034] Table image upload module: used to upload table images provided by users;

[0035] Personal information management module: used to manage user personal information;

[0036] Data viewing module: used to click and view relevant data of the water resources indicator system;

[0037] Retrieve high-frequency indicators module: used to retrieve and view high-frequency indicators.

[0038] The beneficial effects of the present invention are as follows: 1. The method of the present invention can quickly and accurately extract the water resource indicator system from the literature, thereby improving the efficiency and accuracy of data acquisition. 2. The present invention helps researchers and decision makers to manage and utilize water resources more effectively by automatically extracting and analyzing tabular data. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 is a flow chart of a method in an embodiment of the present invention;

[0040] Figure 2 is a structural diagram of a table area detection model in an embodiment of the present invention;

[0041] Figure 3 It is a structural diagram of the system in an embodiment of the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation methods described herein are only used to explain the present invention and are not used to limit the present invention.

[0043] Embodiment 1

[0044] like Figure 1 As shown, in this embodiment, a method for extracting a water resource indicator system based on a table in the literature is provided, comprising the following steps:

[0045] 1. Table area detection

[0046] Based on the literature database, the table area detection model is used in combination with PDF information and traditional image processing technology to locate and extract table images from the literature.

[0047] Specifically: Convert the literature into a YOLOv4-t i ny network model for identifying table lines and table cells (structure as Figure 2 As shown in the figure, the document is converted into a format that the model can process (such as converting PDF format into image format), and then the document after format conversion is input into the model, and the table image in the document is extracted using the YOLOv4-t i ny network model.

[0048] The YOLOv4-t i ny network model uses CSP-darknet53-t i ny provided in the Darknet framework as the backbone network. The backbone network is an optimized lightweight version that reduces the number of model parameters and computational complexity by using the CSP (Cross Stage Partial Networks) strategy while maintaining a high feature extraction capability. The model combines PDF information and traditional image processing technology to improve the accuracy and efficiency of table area detection.

[0049] In this embodiment, before using the YOLOv4-t i ny network model, the YOLOv4-t i ny network model is trained using the labeled table data, and then the trained model is used to extract the table image.

[0050] 2. Image Preprocessing

[0051] The detected table image is preprocessed to enhance the recognizability of table lines and text in the table image.

[0052] Specifically: the table image is first grayscaled and then binarized to enhance the recognizability of table lines and text.

[0053] In the present embodiment, in the step of processing the table image, binarization is a crucial technology. This process simplifies the image into a binary image with only two pixel values, in which each pixel is clearly classified as foreground or background. Foreground pixels represent key features such as the border and text of the table, which are indispensable elements for understanding and analyzing the content of the table. Relatively speaking, background pixels cover all other non-core features, such as blank areas or irrelevant patterns. Through this distinction, the table data can be extracted and analyzed more accurately. Binarization is an image processing technology, through which the foreground and background in the image can be clearly distinguished. In the binarized image, important foreground elements are usually marked with a value of 255 (displayed as white), while insignificant background parts are marked with a value of 0 (displayed as black). This process enhances the recognizability of table lines and text, simplifies the complexity of image analysis and data extraction, which helps to distinguish table lines and text more clearly, thereby improving the accuracy of subsequent steps.

[0054] 3. Table structure analysis

[0055] Optimize the table lines in the preprocessed table image and use projection technology to determine the specific position of the table.

[0056] Specifically: the table lines in the table image are optimized and processed through corrosion and expansion operations, and then the specific position of the table is accurately located using projection technology;

[0057] Projection technology first determines the specific coordinates of the table structure lines, and then combines them with the position information of the table header to accurately determine the specific structure of the table.

[0058] In this embodiment, the table lines in the image are optimized by corrosion and expansion operations. It involves identifying and extracting horizontal and vertical lines, using projection technology to determine the specific structure of the table, determining the specific coordinates of these lines, and then combining the position information of the table header to accurately locate the structure of the table. Although the projection method can be performed automatically, it is necessary to manually adjust the threshold and the parameters of the morphological operation to adapt to document images of different qualities. It is sensitive to changes in image quality and document format, so it is necessary to optimize the preprocessing steps.

[0059] 4. Text Detection and Recognition

[0060] The text detection model is used to detect the text area in the preprocessed table image, and then the text recognition model is used to recognize the text content in the text area.

[0061] Specifically: the DBNet algorithm is used to extract the text area in the table image, and then the CRNN model is used to extract the text content from the text area.

[0062] The DBNet algorithm first determines the location of the text target, and then crops the text sub-image of the original image based on the location of the text target to obtain the text area containing the text.

[0063] The DBNet algorithm needs to be trained before use. 10,000 images are selected from the ICPR2018 dataset as training data. These images are divided into a validation set (30%) and a training set (70%) in a ratio of 3:7. This division ensures that there is enough data for model learning (training set) and there is also enough data to verify the performance of the model (validation set). The training set and validation set are used to train and verify the DBNet algorithm respectively to obtain the trained DBNet algorithm, and then the trained DBNet algorithm is used to detect the text area in the table.

[0064] V. Generation of the indicator system

[0065] Based on the text content, confirm whether the current table is a water resource indicator system table. If so, extract the table key and its corresponding table value in the water resource indicator system table based on the coordinates of the text area and the specific structure of the table to construct a water resource indicator system. Otherwise, abandon the current table image and enter the recognition of the next table image. Finally, display the generated water resource indicator system in the form of a table, icon or report. Specifically, it includes the following contents,

[0066] 1. Based on the header text contained in the text content, search for preset keywords or phrases related to water resources to determine whether the current table is a water resources indicator system table; if the preset keywords are matched in the header text, it is determined that the current table is a water resources indicator system table.

[0067] In this embodiment, in order to identify a specific table in a table image, in this scenario it is the "water resources indicator system" table matching keywords: search for specific keywords or phrases in the extracted header text, such as "water resources indicator system", "water resources criteria", "water resources standards", etc., to determine whether the current table is the target table (water resources indicator system table). Confirm the target table: If the identified header text contains preset keywords, it can be confirmed that the table is the required water resources indicator system table. If no match is found, continue to check the next table image. Extract and organize data: Once the target table is confirmed, the data in the table can be further analyzed and extracted.

[0068] 2. Combine the text area detected by the DBNet algorithm with the line structure of the water resources indicator system table. Group the text area in the X and Y directions to distinguish the table keys and their corresponding table values ​​in the water resources indicator system table, and build a water resources indicator system based on the table keys and corresponding table values.

[0069] In this embodiment, after the water resource indicator system table is identified, the challenge faced when processing the water resource indicator system table is that the table adopts the form of a three-line table, which means that the parameter value part does not have clear line divisions. In order to accurately distinguish the keywords (table keys) and the corresponding numerical values ​​(table values) in the table, it is necessary to utilize the structural characteristics of the table, especially the position of the three horizontal lines, which usually refers to the header row of the table. Combined with the text area detected by DBNet for fusion, the text area detected by DBNet is combined with the line structure of the table to determine which are the table keys (headers or column names) and which are the table values ​​(data in the cells) to achieve parsing of the table content.

[0070] In order to distinguish the key-value pairs in the table, the relative position of the text area and the table structure line is detected, which includes the following steps:

[0071] 2.1. First, obtain the X-axis coordinates of all text areas in the water resource indicator system table and sort these X-axis coordinates; calculate the gradient of the X-axis coordinates in the X-axis direction (the gradient is the difference between two adjacent X-axis coordinates), and determine whether two adjacent X-axis coordinates belong to the same row by setting the X-axis direction gradient threshold, and then group the text areas in the X-axis direction vertically, and use the same color to represent the same column of data. (If the gradient of two adjacent X-axis coordinates is greater than this threshold, the two coordinates are considered to belong to different rows)

[0072] 2.2. Obtain the Y-axis coordinates of all rows in the water resources indicator system table. The Y-axis coordinates include the header line, dividing line, and bottom line. Store these Y-axis coordinates in an array, such as [Y1, Y2, Y3]. Determine the text area whose geometric center is between two adjacent columns of data in the array (such as Y1 and Y2). These text areas are table keys, such as "water resources guidelines", "indicators", "units", etc. Finally, locate each table key, that is, the specific position of the text area, and calculate the gradient of the Y-axis coordinate in the Y-axis direction. By setting the Y-axis gradient threshold, determine whether two adjacent Y-axis coordinates belong to the same column, and then group each column of table values ​​in the Y-axis direction horizontally. (If the gradient of two adjacent Y-axis coordinates is greater than this threshold, the two coordinates are considered to belong to different columns)

[0073] 2.3. Based on the grouping results, extract the corresponding table keys and table values ​​to form a water resources indicator system.

[0074] 6. Word Frequency Statistics and Analysis

[0075] It is also possible to count the usage frequency of indicators in the water resources indicator data and analyze the relative importance of each indicator in water resources management, thereby providing additional information on the usage frequency of each indicator for the indicator system.

[0076] Embodiment 2

[0077] like Figure 3 As shown, in this embodiment, a user-friendly retrieval system is developed, and the system can implement the above method; the system includes

[0078] 1. Water resources indicator system data extraction module

[0079] This module includes,

[0080] Table area detection unit: used to locate and extract table images from documents based on the document database using the table area detection model combined with PDF information and traditional image processing technology;

[0081] Image preprocessing unit: used to preprocess the detected table image to enhance the recognizability of table lines and text in the table image;

[0082] Table structure analysis unit: used to optimize the table lines in the preprocessed table image and determine the specific position of the table using projection technology;

[0083] Text detection and recognition unit: used to detect the text area in the preprocessed table image using the text detection model, and then recognize the text content in the text area using the text recognition model;

[0084] Index system generation unit: used to determine whether the text content is water resource index data. If so, the text box coordinates are combined with the specific position of the table to perform threshold segmentation on the extracted text content in the X and Y directions respectively, and the row and column areas of the wireless coordinates are divided to form a water resource index system.

[0085] 2. Table image upload module: used to upload table images provided by users. The system also allows users to upload table images by themselves and automatically complete the process of indicator extraction and analysis.

[0086] 3. Personal information management module: used to manage user personal information.

[0087] 4. Data viewing module: used to click and view the relevant data of the water resources indicator system. Users can log in to the system and click to view the relevant data of the indicator system according to their needs.

[0088] 5. High-frequency index retrieval module: used to retrieve and view high-frequency indicators. Users can log in to the system to view relevant high-frequency indicators as needed, and click to view the usage frequency and other related data of high-frequency indicators.

[0089] By adopting the above technical solution disclosed in the present invention, the following beneficial effects are obtained:

[0090] The present invention provides a method and system for extracting a water resource indicator system based on a table in a document. The method of the present invention can quickly and accurately extract a water resource indicator system from a document, thereby improving the efficiency and accuracy of data acquisition. The present invention helps researchers and decision makers to manage and utilize water resources more effectively by automatically extracting and analyzing table data.

[0091] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be considered as the scope of protection of the present invention.

Claims

1. A method for extracting a water resources indicator system based on a table in literature, characterized in that: The following steps are included: S1. Table area detection: Based on the literature database, the table area detection model is used in combination with PDF information and traditional image processing technology to locate and extract table images from the literature. S2, image preprocessing: preprocessing the detected table image to enhance the recognizability of table lines and text in the table image; S3, table structure analysis: optimize the table lines in the preprocessed table image and determine the specific structure of the table using projection technology; S4, text detection and recognition: using the text detection model to detect the text area in the preprocessed table image, and then using the text recognition model to recognize the text content in the text area; S5. Index system generation: based on the text content, confirm whether the current table is a water resource index system table. If so, based on the coordinates of the text area and the specific structure of the table, extract the table keys and their corresponding table values ​​in the water resource index system table to construct a water resource index system.

2. The method for extracting a water resource indicator system based on a table in a document according to claim 1 is characterized in that: Step S1 specifically includes converting the document into a YOLOv4-tiny network model for building a table line and table cell recognition model, converting the document into a format that the model can process, inputting the format-converted document into the model, and extracting the table image in the document using the YOLOv4-tiny network model; The YOLOv4-tiny network model uses the CSP-darknet53-tiny provided in the Darknet framework as the backbone network. It uses the CSP strategy to reduce the number of model parameters and computational complexity while maintaining a high feature extraction capability.

3. The method for extracting a water resource indicator system based on a table in a document according to claim 1 is characterized in that: Specifically, step S2 is to first perform grayscale processing and then perform binarization processing on the table image to enhance the recognizability of the table lines and text.

4. The method for extracting a water resource indicator system based on a table in a document according to claim 1 is characterized in that: Step S3 specifically includes optimizing the table lines in the processed table image through corrosion and expansion operations, and then accurately locating the specific position of the table using projection technology; Projection technology first determines the specific coordinates of the table structure lines, and then combines them with the position information of the table header to accurately determine the specific structure of the table.

5. The method for extracting a water resource indicator system based on a table in a document according to claim 1 is characterized in that: Step S4 specifically comprises extracting the text region in the table image using the DBNet algorithm, and then extracting the text content from the text region using the CRNN model; The DBNet algorithm first determines the location of the text target, and then crops the text sub-image of the original image based on the location of the text target to obtain the text area containing the text.

6. The method for extracting a water resource indicator system based on a table in a document according to claim 1 is characterized in that: Step S5 specifically includes the following contents: S51, based on the header text contained in the text content, searching for preset keywords or phrases related to water resources to determine whether the current table is a water resources indicator system table; if the preset keywords are matched in the header text, then determining that the current table is a water resources indicator system table; S52. Combining the text area detected by the DBNet algorithm with the line structure of the water resource indicator system table, grouping the text area in the X and Y directions to distinguish the table keys and their corresponding table values ​​in the water resource indicator system table, and constructing the water resource indicator system based on the table keys and the corresponding table values.

7. The method for extracting a water resource indicator system based on a table in a document according to claim 6 is characterized in that: Step S52 specifically includes the following contents: S521, obtaining the X-axis coordinates of all text areas in the water resources indicator system table, and sorting these X-axis coordinates; calculating the gradient of the X-axis coordinates in the X-axis direction, determining whether two adjacent X-axis coordinates belong to the same row by setting the X-axis direction gradient threshold, and then vertically grouping the text areas in the X-axis direction; S522, obtaining the Y-axis coordinates of all rows in the water resource indicator system table, the Y-axis coordinates including the header line, the dividing line and the bottom line, storing these Y-axis coordinates in an array, determining the text area whose geometric center is located between two adjacent columns of data in the array, and these text areas are table keys; based on the specific position of the text area, calculating the gradient of the Y-axis coordinate in the Y-axis direction, determining whether two adjacent Y-axis coordinates belong to the same column by setting a Y-axis direction gradient threshold, and then horizontally grouping each column of table values ​​in the Y-axis direction; S523. Extract corresponding table keys and table values ​​based on the grouping results to form a water resources indicator system.

8. The method for extracting a water resource indicator system based on a table in a document according to claim 1 is characterized in that: The method also includes, Word frequency statistics and analysis: Statistical analysis of the frequency of use of indicators in the water resources indicator data, and analyze the relative importance of each indicator in water resources management.

9. A system for extracting water resource index system based on tables in literature, characterized by: The system can implement the method described in any one of claims 1 to 8 above; the system includes a water resources indicator system data extraction module, which includes: Table area detection unit: used to locate and extract table images from documents based on the document database using the table area detection model combined with PDF information and traditional image processing technology; Image preprocessing unit: used to preprocess the detected table image to enhance the recognizability of table lines and text in the table image; Table structure analysis unit: used to optimize the table lines in the preprocessed table image and determine the specific position of the table using projection technology; Text detection and recognition unit: used to detect the text area in the preprocessed table image using the text detection model, and then recognize the text content in the text area using the text recognition model; Index system generation unit: used to confirm whether the current table is a water resource index system table based on the text content. If so, the text box coordinates are combined with the specific position of the table to perform threshold segmentation on the extracted text content in the X and Y directions respectively, and the row and column areas of the wireless coordinates are divided to form a water resource index system.

10. The system for extracting water resource indicator system based on tables in literature according to claim 9 is characterized in that: The system also includes, Table image upload module: used to upload table images provided by users; Personal information management module: used to manage user personal information; Data viewing module: used to click and view relevant data of the water resources indicator system; Retrieve high-frequency indicators module: used to retrieve and view high-frequency indicators.

Citation Information

Patent Citations

  • Periodical literature table extraction method based on text state characteristics

    CN110968667A

  • Form recognition method and device in image, electronic equipment and storage medium

    CN111814722A

  • Financial statement information detection and recognition method based on OCR

    CN112016481A

  • Method for converting table information extracted from PDF document into structured knowledge

    CN113326797A

  • Automatic identification method and system

    CN115497104A