An XML-based table extraction method for scientific literature

By converting PDFs to DOCX and using XML files to locate tables, and combining this with an ontology model to reconstruct the logical relationships of tables in journal articles, the problem of low accuracy in extracting tables with few borders is solved, achieving efficient table data extraction and storage.

CN115935910BActive Publication Date: 2026-04-21GUANGXI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGXI UNIV
Filing Date
2022-11-24
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing technologies suffer from low accuracy and confusing logical relationships when processing tables with few borders in journal articles, making it difficult to meet the needs of big data mining.

Method used

Convert PDF documents to DOCX documents, locate tables using XML files within the DOCX documents, extract table data using an ontology model, reconstruct the logical relationships between cells by combining the column relationships between each row of the table, and store the data in a database.

Benefits of technology

It improves the accuracy of table data extraction and the restoration of logical relationships, and is applicable to journal articles in different academic fields, achieving efficient information sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115935910B_ABST
    Figure CN115935910B_ABST
Patent Text Reader

Abstract

This invention provides an XML-based method for extracting tables from scientific and technological documents, belonging to the field of PDF file information extraction. The method includes converting the PDF to DOCX, decompressing the DOCX to obtain an XML file, filtering out interfering characters using text font size nodes and keywords in the XML tree structure, retaining table title keywords, obtaining table headers and splitting columns through cell attribute nodes, correcting the columns of other table rows (excluding the header) based on the header columns, inserting data from the previous row into table rows with missing columns according to rules, restoring the table row structure, and finally extracting and storing the table column data using an ontology model. This method is not constrained by the table border type of scientific and technological documents and accurately extracts related table data through a semantic model, restoring the logical relationships of the tables, improving the accuracy and automation of table extraction, and is applicable to scientific and technological documents in different fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of PDF file information extraction, and in particular to an XML-based method for extracting tables from scientific and technological documents. Background Technology

[0002] PDF (Portable Document Format) is a document format based on the PostScript language's image model. It accurately reproduces the characters, colors, and images of a document and is widely used in online electronic documents. It is an internationally accepted file format for the transmission and storage of journal articles. Journal articles contain a wealth of professional knowledge and authoritative data; therefore, making full use of the effective information in journal articles is extremely important.

[0003] Tables, as a carrier of high information density in journal articles, often contain key information within the document. Currently, the number of academic documents is exploding, and manual retrieval can no longer keep up with the speed of information growth. Especially with the maturity of big data technology and its penetration into various industries, table data in journal articles, as a major source of big data in relevant fields, is receiving increasing attention from big data mining and applied research. The demand for extracting tables from journal articles (especially scientific and technological literature) is also becoming increasingly strong. Therefore, automatically extracting table data from PDFs has become an important part of big data applications, laying the foundation for data sharing and utilization in related fields.

[0004] Common document tables establish cell relationships using borders, with clear boundaries between cells (full-bordered tables). Most current table extraction methods target full-bordered tables with minimal redundant data, using borders to identify and distinguish data areas. However, journal articles often use tables with fewer borders (such as three-line tables) and contain a significant amount of non-table data, severely impacting the effectiveness of such table extraction methods.

[0005] XML (Extensible Markup Language) is a general-purpose markup language that separates content from form and has a strict syntax. Its tags have strict hierarchical rules, enabling it to completely reproduce all information and structure within a document. Therefore, using XML for table extraction in journal articles can reduce reliance on table borders and improve the accuracy of extracting tables with few borders.

[0006] Therefore, based on the characteristics of tables in scientific and technological literature, an XML-based method for extracting tables from scientific and technological literature was designed. The PDF is converted into a DOCX document, and the XML file under the DOCX document is used to locate the table. Summary of the Invention

[0007] The purpose of this invention is to provide an XML-based method for extracting tables from scientific and technological documents, thereby solving the technical problems of low accuracy and confusing logical relationships in the extraction of various framed table data from existing scientific and technological documents.

[0008] Convert PDF to DOCX document, locate table using XML file in DOCX document, restore logical relationship between cells using column relationship between each row of table, extract table data through ontology model and store in database.

[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0010] A method for extracting scientific and technological literature tables based on XML, the method comprising the following steps:

[0011] Step 1: Document conversion. Convert the PDF to DOCX, decompress the DOCX to obtain the underlying XML file, use XML nodes to obtain all text, text attributes and cell attributes, and create a text collection named Text.

[0012] Step 2: Construct an ontology model, create a semantic model based on the relevant domain, and establish table title keywords for primary concepts;

[0013] Step 3: Filter out interfering characters. Use the font size attribute of the table title keywords to filter out interfering characters, and use the special keywords in the journal to filter out font size attributes to identify invalid interfering characters.

[0014] Step 4: Header recognition. Find the header content belonging to the ontology model based on the table title keywords, determine all the text in the header, split the header by columns using the cell length attribute, and use the number of columns in the header as the number of columns in the table.

[0015] Step 5: Restore the table structure. Use the cell length attribute to get the number of columns in each row of the table. If the number of columns is less than the number of columns in the header, take the text after the line break node or paragraph node from the cell with abnormal height in the previous row, insert it into the row, and concatenate the split characters in the same cell in the row into a complete string. Use the cell height and length attributes to determine the end position of the table.

[0016] Step 6: Extract table data, match table titles and headers according to the ontology model, and store the extracted data in the database.

[0017] Furthermore, in step 1, the PDF is converted to DOCX, largely restoring the structure of text lines and partially restoring the table structure, while preserving the relative positions of characters. After decompressing the DOCX, the underlying XML file is obtained. Nodes such as "w:t", "w:sz", "w:tcW", and "w:trHeight" in the XML structure are used to retrieve the text strings, text attributes (such as font size), cell length attributes, and cell height attributes from the original document. The character format in the XML is determined, all full-width characters are converted to half-width characters, and the connection relationships between characters are restored to construct a Text collection.

[0018] Furthermore, in step 2, an ontology model is constructed based on the relevant domain, including primary concepts, secondary concepts, etc., and a set of table title keywords is created based on the primary concepts.

[0019] Furthermore, in step 3, the text font size corresponds one-to-one with the string, obtaining the font size of the table title keywords and all text font sizes, and removing text characters with larger font sizes. Special keywords are created for the abstract and references, including keywords such as "Abstract", "References", etc., and the text after these keywords is filtered until the font size becomes larger or there is no text.

[0020] Furthermore, in step 4, the step of determining all text in the table header based on the table title keyword includes: determining the cell where the table title keyword is located, searching for the first occurrence of a secondary concept in the ontology model starting from the cell after the table title keyword according to the character order in XML, obtaining the height of the cell where the term is located, counting the characters that first appear at the height of that cell in the text set and the characters that last appear at the height of that cell, and taking all the text between the two characters as the table header content (including the two characters).

[0021] Furthermore, in step 4, the method of searching for the ontology model starting from the position of the table title keyword is as follows: if the table title keyword is not located in a cell, find the first ontology model secondary concept located in the cell according to the character order, and the row where the term is located is the table header; if the table title keyword is located in a cell, determine whether the length of the cell where the current character is located is equal to the length of the cell where the table title keyword is located. If the length changes and there is an ontology model secondary concept, then the table row where the cell is located is the table header.

[0022] Furthermore, in step 4, the steps of splitting the header content into columns include: obtaining the length of each cell in the header, the type of cell length being the number of columns in the header, querying the cell length attribute node bound to the character, dividing text with the same cell length into the same column, and dividing text with different cell lengths into different columns.

[0023] The kth character in the header is t k The cell containing it has a length of w. k The cell in the first row and jth column is c. 1j Its length is w 1j If w k =w 1j , then t k The character belongs to c 1j Cell, this character is also represented as t 1j .

[0024] In step 5, to avoid the confusion of character and cell traversal order caused by the journal's column division, the method to distinguish adjacent rows of the table is as follows: the starting position of the next row is traversed sequentially through the last character of the previous row. If the length of the cell containing the character is less than half the sum of the lengths of all cells in the previous row, then that character is the starting character of the next row.

[0025]

[0026] In equation (1), c n The nth character in the table (excluding the header), cell i1 For the cell in the i-th row and 1-th column of the table, w n The length of the cell containing the nth character. J is the sum of the lengths of all cells in row (i-1), and J is the number of header columns.

[0027] Get the height of the cell containing the character, set that height as the height of the table row, get the last character in the cell at that height, and determine all the text in the table row.

[0028] Furthermore, in step 5, the step of obtaining the number of columns in each row of the table includes: obtaining the length of each cell in the current row, and temporarily defining the type of length as the number of columns in that row. If the number of columns is equal to the number of columns in the table header, then the row is a complete row; if the number of columns is less than the number of columns in the table header, then the missing columns are filled in by the extra text in the previous row.

[0029] Furthermore, in step 5, the method for supplementing the redundant text from the previous line to the missing column of the next line is as follows: Query the column containing the cell with a height variation in the previous line, and insert a new cell in the same column position in the next line. Determine whether the text in the cell of the previous line contains a line break node "w:br\" or a new paragraph node "w:p". If it does, extract the string after the line break or new paragraph node and insert it into the new cell of the next line; if it does not, insert an empty string into the new cell.

[0030] Furthermore, in step 5, the step of determining the end position of the table includes: obtaining the height of the cell containing the next character after the last character of the row, counting all text at that cell height, and if the length type of the cell containing these texts is greater than 1, then the last character of the row is not the end character of the table; if the length type of the cell containing these texts is 1, then the last character of the row is the end character of the table.

[0031]

[0032] In equation (2), c (u-1)q For the q-th character in the (u-1)-th row, cell IJ For the cell at the largest row I and largest column J, w up The length of the p-th cell in row u. Let be the type of length for the p-th cell in row u.

[0033] Furthermore, in step 6, the ontology model is used to identify the table title, determine the nouns in the table header that belong to the ontology model, use the nouns as the keys of the dictionary, and use the text of other rows in the same column as the nouns as the values ​​of the dictionary, and output them to the database one by one; nouns in the table header that do not appear in the ontology model are not extracted.

[0034]

[0035] key1 is the first second-level noun of the ontology. The first value under key1 The a-th value under key1, key m This is the m-th second-level noun on the entity. for key m The first value below, for key m The d-th value.

[0036] The present invention, by adopting the above-described technical solution, has the following beneficial effects:

[0037] This invention is designed to address the unique characteristics of tables in PDF journal articles converted to DOCX format. It decompresses the DOCX document to obtain the underlying XML file, filters out interfering characters using table headers, extracts the table header through an ontology model and cell attributes, and divides the table's column structure based on the relationship between text and cell attributes, thus largely restoring the table's logical relationships. Storing the extracted data in a database facilitates information sharing. Because it employs a semantic model, corresponding ontology models can be established for journals in different academic fields, allowing for selective extraction of table content, thus offering broad applicability and diverse selectivity. Attached Figure Description

[0038] Figure 1 This is a flowchart of the method of the present invention.

[0039] Figure 2 This is a table that was misidentified after document conversion according to the present invention.

[0040] Figure 3 This is a schematic diagram of the underlying DOCX file structure of the present invention.

[0041] Figure 4 This is the XML tree structure of the present invention.

[0042] Figure 5 This is a schematic diagram of the cell attributes of the present invention.

[0043] Figure 6 This refers to the text order in XML for the two-column layout journal of this invention.

[0044] Figure 7 This is a schematic diagram illustrating the abnormal merging of table rows according to the present invention.

[0045] Figure 8 This is the database storage mapping of the present invention.

[0046] Figure 9 This is an example verification diagram of the present invention. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and preferred embodiments. However, it should be noted that many details listed in the specification are merely to provide the reader with a thorough understanding of one or more aspects of the invention, and these aspects of the invention can be implemented even without these specific details.

[0048] like Figure 1 As shown, this invention proposes a method for extracting scientific and technological literature tables based on XML, the method comprising the following steps:

[0049] Step 1: Convert the document to obtain the text and related attributes.

[0050] Tools like pdf2docx can be used to convert scientific documents to DOCX documents, restoring the relative position of text and the attributes of tables in PDFs. However, non-table parts may also be interpreted as tables, such as... Figure 2 As shown, the summary section is identified as a table. Unzipping the DOCX document reveals the underlying folder; a portion of the content of the document.xml file within that folder is displayed as follows. Figure 3As shown, the intermediate nodes required include: table node "w:tbl", table row node "w:tr", table cell node "w:tc", new paragraph node "w:p", and text node "w:r". There are hierarchical relationships between different nodes, and nodes at different levels contain relevant attributes of the DOCX document, allowing the construction of an XML tree structure. Because nested tables may occur after file conversion, the tree structure of text and cell attributes in the XML file has two possibilities, such as... Figure 4 As shown, (a) is a tree structure without nested tables, and (b) is a tree structure with nested tables. The structure to be used is the one within the dashed box in (b).

[0051] In the underlying nodes, the "w:t" node represents the text content; the "w:sz" node represents the font size of the text, corresponding one-to-one with the text; the "w:tcW" node represents the length of a cell, and all text within a cell shares the value of this node; the "w:trHeight" node represents the height of each row in the table. If cells in the same row have the same height, all cells in that row share the value of this node. If there are several cells with different heights in the same row, the value of this node is truncated, and cells of different heights correspond to values ​​in separate nodes; the "w:br / " node represents a line break and generally exists alone. The cell length and height node attributes are as follows: Figure 5 As shown.

[0052] The characters in XML may be in full-width format. All full-width characters need to be converted to half-width characters and stored in the Text collection.

[0053] Step 2: Construct the ontology model.

[0054] Different ontology models are established based on the academic fields of different types of scientific and technological literature. The ontology model contains multiple levels. For example, the knowledge ontology model established in the field of extrusion casting uses "material composition," "process parameters," "mechanical properties," and their English terms as primary concepts. Each primary concept contains several secondary concepts, and so on. The terms in the primary concepts are used as table title keywords.

[0055] Step 3: Filter out interfering characters.

[0056] The XML contains all the text within the DOCX document. Except for table text, other text may contain interfering characters, so irrelevant text needs to be filtered out in batches.

[0057] 1) Filter text characters.

[0058] According to the standard format of scientific and technological literature, the font size of the text in the table is smaller than that of the text in the body. Obtain the font size of the table title keyword. If there are multiple font sizes for the table title keyword, delete the text with the larger font size. If there is only one font size for the table title keyword, it means that the table title keyword does not appear in the body.

[0059] 2) Filter out interference characters with small font sizes.

[0060] In scientific and technological literature, some non-table text may have a font size equal to or smaller than that of table text. This smaller font size text needs to be filtered separately. Create special keywords such as "Abstract," "References," and "Abstract," and delete all smaller font size text following these keywords.

[0061] After text filtering, all concepts in the ontology model represent only the text related to tables and table titles, and are not affected by text other than table content.

[0062] Step 4: Header identification and segmentation.

[0063] The header structure determines the structure of other table rows, so it is necessary to identify the column structure of the header and the cell where the header text is located.

[0064] 1) Table header positioning.

[0065] Based on the table title keywords filtered in step 3, determine the position of the table title. Query the secondary concepts in the ontology model in the character order of the XML. If the first noun that appears belongs to the secondary concept and is text under the "w:tbl" node (table node), then the line containing that text is the table header line.

[0066] 2) Split the table header.

[0067] Get the height of the cell containing the second-level concept noun, count the first occurrence of the character at that cell height and the last occurrence of the character at that cell height in the text collection, and use the text between these two characters as the header text.

[0068] Different cell lengths within the same row represent different table columns. Iterate through all the text in the table header and divide the header into columns based on the cell length containing the text. Let the k-th character in the header be t. k The cell containing it has a length of w. k The cell in the first row and jth column is c. 1j Its length is w 1j If w k =w 1j , then t k The character belongs to c 1j Cell, this character can also be represented as t 1j .

[0069] Step 5: Restore the table structure and determine the end position of the table.

[0070] The structures of other cells in the table are all based on the header structure, and the number of cells in this row is adjusted according to the columns of the header.

[0071] 1) Obtain the table row.

[0072] Since some journals are in two-column layout format, after conversion to XML, the display order of characters is not necessarily that the left column ends first and then enters the right column. There may be two mixed display orders of full-column and two-column within the same page (such as Figure 6 , after the character "rule." in the left-column cell ends, it directly jumps to the character "magnesium ingot" in the right-column cell, and after the last character "casting" in the cell where "magnesium ingot" is located ends, it jumps to the character "1" in the left-column cell), resulting in the inability to directly determine the boundary of adjacent rows in the table. Therefore, a method for determining the boundary of adjacent rows in the table needs to be formulated. For example, determine the start and end positions of the i-th row. The determination method of the start position is: start traversing from the last character of the (i - 1)-th row. If the length of the cell where the character is located is less than half of the sum of the lengths of all cells in the previous row, then this character is the start character of the next row.

[0073]

[0074] In formula (1), c n is the n-th character in the table except the header, cell i1 is the cell in the first column of the i-th row in the table, w n is the length of the cell where the n-th character is located, is the sum of the lengths of all cells in the (i - 1)-th row, and J is the number of columns in the header.

[0075] Obtain the height of the cell where the character is located. This height is the height of the i-th row in the table. Through this height, obtain the last character that belongs to the height of this cell. This character is the last character of the i-th row. Traverse to obtain all characters between the first character and the last character of the i-th row, which are all the texts of the i-th row.

[0076] 2) Adjust the number of columns in the table row.

[0077] The number of types of cell lengths in the same row is the number of columns in this row. Obtain the number of columns in this row through the number of types of cell lengths. If the number of columns in this row is equal to the number of columns in the previous row, then the number of columns in this row is correct. If the number of columns in this row is less than the number of columns in the previous row, then the number of columns in this row is missing and text needs to be retrieved from the previous row. As Figure 7 shown, the two lines of text within the thick rectangular frame are compressed into the same row, resulting in a column missing in the next row.

[0078] The retrieval method is as follows: obtain the cells with varying heights in the previous row and the column containing those cells, insert an empty cell in the same column of that row, and determine whether there is a newline node "w:br\" or a new paragraph node "w:p" in the cells with varying heights. If not, insert an empty character into the empty cell; if so, extract the text after the newline node or new paragraph node and insert it into the empty cell.

[0079] For example, if the number of columns in row i is less than the number of columns in the header, text needs to be retrieved from row (i-1). Obtain the cell in row (i-1) where the new height node appears and its corresponding column j. Insert an empty cell in row i, column j to restore the missing cell. Check if a newline node "w:br\" or a new paragraph node "w:p" exists in the cell in row (i-1). If not, insert an empty string into the cell in row i, column j. If it exists, extract the text after the newline node "w:br\" or the new paragraph node "w:p" and insert it into the cell in row i, column j.

[0080] 3) Combine characters within the same cell.

[0081] Characters within the same cell may appear separated due to differences in font, subscript, or other formatting. Concatenating all characters within the same cell into a complete string according to XML character order facilitates data output.

[0082] 4) Determining the end position of the table.

[0083] The steps for determining the end position of a table include: obtaining the height of the cell containing the character following the last character of the row; counting all text within that cell's height; if the cell containing these texts has a length type greater than 1, then the last character of the row is not the end character of the table; if the cell containing these texts has a length type of 1, then the last character of the row is the end character of the table.

[0084]

[0085] In equation (2), c (u-1)q For the q-th character in the (u-1)-th row, cell IJ The cell at the largest row I and largest column J, which is the last cell of the table, w up The length of the p-th cell in row u. Let be the type of length for the p-th cell in row u.

[0086] Step 6: Output the table.

[0087] The table title is located using the first-level concept of the ontology model. All columns of the table are traversed to determine whether the header name of each column belongs to the second-level concept under the ontology. The header and data of the column represented by the second-level concept are extracted. The noun is used as the key of the dictionary, and the text of other rows in the same column as the noun is used as the value of the dictionary. The results are then output to the database one by one.

[0088]

[0089] key1 is the first second-level noun of the ontology. The first value under key1 The a-th value under key1, key m This is the m-th second-level noun on the entity. for key m The first value below, for key m The d-th value.

[0090] Using a MySQL database, tables are created based on the first-level concepts of the ontology model to store tabular data. For example, in the field of extrusion casting, a database could be built with some data mapping methods such as... Figure 8 As shown, (a) is the mapping of material composition data, and (b) is the mapping of process parameters and mechanical properties data.

[0091] Example verification such as Figure 9 As shown, (a) is the original table from the scientific and technological literature, (b) is the extracted result of the material composition table, and (c) is the extracted result of the process parameter table.

[0092] Matters not covered in this invention are common knowledge.

[0093] This method utilizes text size nodes and keywords in an XML tree structure to filter out interfering characters, retaining table title keywords. It retrieves the table header and splits it into columns using cell attribute nodes. For all table rows except the header, columns are corrected based on the header columns. For rows with missing columns, data is extracted from the previous row according to rules and inserted to restore the table row structure. Finally, an ontology model is used to extract and store the table column data. This method is not constrained by the table border types in scientific literature and accurately extracts related table data through a semantic model, restoring the logical relationships within the tables. This improves the accuracy and automation of table extraction and is applicable to scientific literature in various fields.

[0094] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for extracting scientific and technological literature tables based on XML, characterized in that: The method includes the following steps: Step 1: Document Conversion. Convert the PDF to DOCX, decompress the DOCX file to obtain the underlying XML file, and use XML nodes to retrieve all text, text attributes, and cell attributes to create a text collection. Text ; Step 2: Construct an ontology model, create a semantic model based on the relevant domain, and establish table title keywords for primary concepts; Step 3: Filter out interfering characters. Use the font size attribute of the table title keywords to filter out interfering characters, and use the special keywords in the journal to filter out font size attributes to identify invalid interfering characters. Step 4: Table header recognition. Find the table header content belonging to the ontology model based on the table title keywords, determine all the text in the table header, divide the table header by columns using the cell length attribute, and use the number of columns in the table header as the number of columns in the table. Step 5: Restore the table structure. Use the cell length attribute to get the number of columns in each row of the table. If the number of columns is less than the number of columns in the header, take the text after the line break node or paragraph node from the cell with abnormal height in the previous row, insert it into the row, and concatenate the split characters in the same cell in the row into a complete string. Use the cell height and length attributes to determine the end position of the table. Step 6: Extract table data, match table titles and headers according to the ontology model, extract table data related to the relevant domain and store it; In step 4, the process of determining all the text in the table header based on the table title keyword includes determining the position of the table title keyword, searching for the first occurrence of the secondary concept in the ontology model starting from the cell after the table title keyword according to the character order in XML, obtaining the height of the cell where the corresponding noun is located, counting the characters that first appear at the height of that cell in the text set and the characters that last appear at the height of that cell, and taking all the text between the two characters as the table header content; The method for finding the ontology model starting from the table title keyword position is as follows: If the table title keyword is not located in the cell, find the first ontology model second-level concept located in the cell according to the character order. The row where the noun is located is the table header. If the table title keyword is located in the cell, determine whether the length of the cell where the current character is located is equal to the length of the cell where the table title keyword is located. If the length changes and there is an ontology model second-level concept, then the table row where the cell is located is the table header. The process of splitting the header content into columns includes: obtaining the length of each cell in the header, the type of cell length being the number of columns in the header, querying the cell length attribute node bound to that character, dividing text with the same cell length into the same column, and dividing text with different cell lengths into different columns; Table header k The number of characters is t k The length of the cell it is located in is w k , first line j The cells in the column are c 1j Its length is w 1j ,like w k = w 1j ,but t k Character belongs to c 1j Cell, this character is also represented as t 1j .

2. The method for extracting scientific and technological literature tables based on XML according to claim 1, characterized in that: In step 1, the PDF is converted to DOCX, restoring the text line structure and partially restoring the table structure while preserving the relative positions of characters. After decompressing the DOCX, the underlying XML file is obtained. The w:t, w:sz, w:tcW, and w:trHeight nodes in the XML structure are used to retrieve the text string, text attributes, cell length attribute, and cell height attribute from the original document, respectively. The character format in the XML is determined, all full-width characters are converted to half-width characters, and the connection relationships between characters are restored to construct... Text A collection of texts.

3. The method for extracting scientific and technological literature tables based on XML according to claim 1, characterized in that: In step 2, an ontology model is constructed based on the relevant domain, including first-level concepts and second-level concepts, and a set of table title keywords is created based on the first-level concepts.

4. The method for extracting scientific and technological literature tables based on XML according to claim 1, characterized in that: In step 3, the text font size corresponds one-to-one with the string, obtains the font size of the table title keywords and all text font sizes, removes text characters with larger font sizes, creates special keywords for the abstract and references, including the keywords Abstract, References, and Filter the text after the keyword until the font size becomes larger or there is no text.

5. The method for extracting scientific and technological literature tables based on XML according to claim 1, characterized in that: In step 5, to avoid the confusion of character and cell traversal order caused by the journal's column division, the method to distinguish adjacent rows of the table is as follows: the starting position of the next row is traversed sequentially through the last character of the previous row. If the length of the cell containing the character is less than half the sum of the lengths of all cells in the previous row, then that character is the starting character of the next row. (1) In equation (1), c n For the first digit in the table excluding the header... n One character, cell i1 For the first in the table i The cell in the first column of the row, w n For the first n The length of the cell containing each character For the ( i -1) The sum of the lengths of all cells in the row. J This represents the number of columns in the header; Get the height of the cell containing the character, set the height as the height of the table row, get the last character in the height cell, and determine all the text in the table row.

6. The method for extracting scientific and technological literature tables based on XML according to claim 1, characterized in that: In step 5, the process of obtaining the number of columns in each row of the table includes: obtaining the length of each cell in the current row, and temporarily defining the type of length as the number of columns in the row. If the number of columns is equal to the number of columns in the header, then the row is a complete row. If the number of columns is less than the number of columns in the header, then the missing columns are filled in by the extra text in the previous row.

7. The method for extracting scientific and technological literature tables based on XML according to claim 1, characterized in that: In step 5, the method for adding redundant text from the previous line to the missing column of the next line is as follows: Query the column containing the cell with a height change in the previous line, and insert a new cell in the same column position in the next line. Determine whether the text in the cell of the previous line has a line break node w:br\ or a new paragraph node w:p. If it does, extract the string after the line break or new paragraph node and insert it into the new cell of the next line. If it does not, insert an empty character into the new cell.

8. The method for extracting scientific and technological literature tables based on XML according to claim 1, characterized in that: In step 5, the steps for concatenating strings include: determining whether characters belong to the same cell length node, concatenating characters of equal cell length into a single string, and restoring the continuous strings within each cell; The steps for determining the end position of a table include: obtaining the height of the cell containing the character following the last character of the current row; counting all text within that cell's height; if the cell containing the text has a length type greater than 1, then the last character of the current row is not the end character of the table; if the cell containing the text has a length type of 1, then the last character of the current row is the end character of the table. (2) In equation (2), c (u-1)q For the ( u -1) row q One character, cell IJ For the largest row I Maximum column J The cell at that position, w up For the first u Line number p Cell length, For the first u Line number p Types of cell lengths.

9. The method for extracting scientific and technological literature tables based on XML according to claim 1, characterized in that: In step 6, the ontology model is used to identify the table title, determine the nouns in the table header that belong to the ontology model, use the nouns as the keys of the dictionary, and use the text of other rows in the same column as the nouns as the values ​​of the dictionary, and output them to the database one by one. Nouns in the table header that do not appear in the ontology model are not extracted. key 1 is the first second-level noun on the subject. for key The first value under 1, for key The first of the first two a One value, key m For the first m A second-level noun on the entity, for key m The first value below, for key m The next d Values.

Citation Information

Patent Citations

  • Periodical literature table extraction method based on text state characteristics

    CN110968667A

  • Method for converting PDF file to XML file

    CN1776673A