# US 2021/0240973 A1 · Extracting data from tables detected in electronic documents

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0240973 A1
- Document ID: US20210240973A1
- Status: Published application
- Kind: A1
- Application number: 16/778,147
- Filed: 2020-01-31
- Published: 2021-08-05
- Earliest claimed: 2020-01-31
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Erhan Erdemir; Kenneth James Peterka
- Web page: https://patentgrep.com/patent/US20210240973A1

## CPC

- G06F 40/177: of tables; using ruled lines
- G06F 18/24: Classification techniques
- G06F 40/216: using statistical methods
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 40/289: Phrasal analysis, e.g. finite state techniques or chunking
- G06F 40/30: Semantic analysis
- G06V 30/412: Layout analysis of documents structured with printed lines or input boxes, e.g. business forms or tables
- G06V 30/10: Character recognition
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

The embodiments disclosed herein relate to extracting table data from an electronic document. Tables are detected based on identification of the column headers, of the table, that correspond to known fields. Once a table is detected, values corresponding to the column headers are extracted and stored in association with the known fields.

## Claims

### Claim 1

A non-transitory computer readable medium comprising instructions which, when executed by one or more hardware processors, causes performance of operations comprising:
detecting a plurality of phrases in an electronic document that are (a) on a same first text line and (b) correspond respectively to a plurality of known fields,
wherein a first phrase of the plurality of phrases corresponds to a first field of the plurality of known fields,
wherein a second phrase of the plurality of phrases corresponds to a second field of the plurality of known fields,
wherein the first phrase and the second phrase correspond to column headers in a table in the electronic document;
extracting data from the table in the electronic document at least by:
responsive at least to determining that a first value has (a) a corresponding horizontal position in the electronic document that at least partially overlaps with a horizontal position of the first phrase in the electronic document and (b) a corresponding vertical position in the electronic document that is below a vertical position of the first phrase in the electronic document: storing the first value in association with the first field that corresponds to the first phrase;
responsive at least to determining that a second value has (a) a corresponding horizontal position in the electronic document that at least partially overlaps with a horizontal position of the second phrase in the electronic document and (b) a corresponding vertical position in the electronic document that is below a vertical position of the second phrase in the electronic document: storing the second value in association with the second field that corresponds to the second phrase.

### Claim 2 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
responsive to determining that the plurality of phrases are (a) on the same first text line and (b) correspond respectively to the plurality of known fields:
determining that the plurality of phrases correspond respectively to a plurality of column headers in the table in the electronic document.

### Claim 3 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
determining that a second text line, immediately below the first text line, includes one or more digits;
responsive to determining that the second text line includes one or more digits, determining that the second text line comprises a set of values associated with the plurality of known fields;
storing each of the set of values in association with a corresponding field in the plurality of known fields.

### Claim 4 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
determining that a second text line, immediately below the first text line, does not include any digits;
responsive to determining that the second text line does not include any digits, determining that text in the second text line continues at least one column header of a plurality of column headers in the first text line.

### Claim 5 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
determining that a second text line, immediately below the first text line, is located within a threshold vertical distance threshold from the first text line;
responsive to determining that the second text line is located within the threshold vertical distance threshold from the first text line: determining that text in the second text line continues at least one column header of a plurality of column headers in the first text line.

### Claim 6 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
tagging each of the plurality of phrases as column headers.

### Claim 7 (depends on 1)

The medium of claim 1, wherein determining that the plurality of phrases are on the same first text line comprises determining that each of the plurality of phrases have at least partially overlapping vertical positions in the electronic document.

### Claim 8 (depends on 1)

The medium of claim 1, wherein extracting the data from the table is responsive to:
determining a number of the plurality of phrases, on the same first text line, that correspond to the plurality of known fields;
determining that the number exceeds a threshold value.

### Claim 9 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
determining a mathematical relationship between values in a first labeled column, a second labeled column, and a third non-labeled column in the table;
based on the mathematical relationship, determining that the third non-labeled column corresponds to a third field of the plurality of known fields;
storing a particular value in the third non-labeled column in association with the third field.

### Claim 10 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
writing a marked-up document that identifies the first text line as a column header line and a second text line as a line item with values corresponding to labels in the column header line.

### Claim 11 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
determining a mathematical relationship between values in a first labeled column, a second labeled column, and a third non-labeled column in the table;
based on the mathematical relationship, determining that the third non-labeled column corresponds to a third field of the plurality of known fields;
storing a particular value in the third non-labeled column in association with the third field.

### Claim 12 (depends on 1)

The medium of claim 1, wherein the operations further comprise writing a marked-up document that identifies the first text line as a column header line and a second text line as a line item with values corresponding to labels in the column header line.

### Claim 13 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
detecting a primary line of the first value and a secondary line of the first value based on one or more of:
(a) an alignment of the primary line of the first value;
(b) an indentation of the primary line of the first value;
(c) an alignment of the secondary line of the first value; or
(d) an indentation of the secondary line of the second value.

### Claim 14 (depends on 1)

The medium of claim 1, wherein the column headers in the table are detected on a first page of the electronic document, and wherein the operations further comprise:
responsive to detecting the same column headers, detected on the first page of the electronic document, on a second page of the electronic document: determining that the table extends to the second page of the electronic document;
extracting a third value from a portion of the table on the second page;
storing the third value in association with the same first field that corresponds to the first phrase.

### Claim 15 (depends on 1)

The medium of claim 1, wherein the column headers in the table are detected on a first page of the electronic document, and wherein the operations further comprise:
responsive to detecting the same column headers, detected on the first page of the electronic document, on a second page of the electronic document: determining that the table extends to the second page of the electronic document;
extracting a third value from a portion of the table on the second page based on horizontal position information, for a column comprising the third value, that was determined in relation to extracting the first value from the first page of the electronic document;
storing the third value in association with the first field that corresponds to the first phrase.

### Claim 16 (depends on 1)

The medium of claim 1, wherein the operations further comprise:
responsive to determining that the plurality of phrases are (a) on the same first text line and (b) correspond respectively to the plurality of known fields: determining that the plurality of phrases correspond to column headers in the table in the electronic document;
tagging each of the plurality of phrases as column headers;
determining that a second text line, immediately below the first text line, includes one or more digits;
responsive to determining that the second text line includes one or more digits, determining that the second text line comprises a set of values associated with the first subset of fields;
storing each of the set of values in association with a corresponding field in the first subset of fields;
wherein determining that the phrases, of the first subset of phrases, are on the same first text line comprises determining that the plurality of phrases have at least partially overlapping vertical positions in the electronic document;
wherein extracting the data from the table is responsive to:
determining a number of the plurality of phrases that correspond respectively to the plurality of known fields;
determining that the number exceeds a threshold value;
determining a mathematical relationship between values in a first labeled column, a second labeled column, and a third non-labeled column in the table;
based on the mathematical relationship, determining that the third non-labeled column corresponds to a third field of the plurality of known fields;
storing a particular value in the third non-labeled column in association with the third field;
writing a marked-up document that identifies the first text line as a column header line and a second text line as a line item with values corresponding to labels in the column header line.

### Claim 17

A method comprising:
detecting a plurality of phrases in an electronic document that are (a) on a same first text line and (b) correspond respectively to a plurality of known fields,
wherein a first phrase of the plurality of phrases corresponds to a first field of the plurality of known fields,
wherein a second phrase of the plurality of phrases corresponds to a second field of the plurality of known fields,
wherein the first phrase and the second phrase correspond to column headers in a table in the electronic document;
extracting data from the table in the electronic document at least by:
responsive at least to determining that a first value has (a) a corresponding horizontal position in the electronic document that at least partially overlaps with a horizontal position of the first phrase in the electronic document and (b) a corresponding vertical position in the electronic document that is below a vertical position of the first phrase in the electronic document: storing the first value in association with the first field that corresponds to the first phrase;
responsive at least to determining that a second value has (a) a corresponding horizontal position in the electronic document that at least partially overlaps with a horizontal position of the second phrase in the electronic document and (b) a corresponding vertical position in the electronic document that is below a vertical position of the second phrase in the electronic document: storing the second value in association with the second field that corresponds to the second phrase;
wherein the method is performed by at least one device including a hardware processor.

### Claim 18 (depends on 17)

The method of claim 17, wherein the operations further comprise:
responsive to determining that the plurality of phrases are (a) on the same first text line and (b) correspond respectively to the plurality of known fields:
determining that the plurality of phrases correspond to column headers in the table in the electronic document.

### Claim 19 (depends on 17)

The method of claim 17, wherein the operations further comprise:
determining that a second text line, immediately below the first text line, includes one or more digits;
responsive to determining that the second text line includes one or more digits, determining that the second text line comprises a set of values associated with the plurality of known fields;
storing each of the set of values in association with a corresponding field in the plurality of known fields.

### Claim 20 (depends on 17)

The method of claim 17, wherein the operations further comprise:
determining that a second text line, immediately below the first text line, does not include any digits;
responsive to determining that the second text line does not include any digits, determining that text in the second text line continues at least one column header of the column headers in the first text line.

### Claim 21 (depends on 17)

The method of claim 17, wherein the operations further comprise:
determining that a second text line, immediately below the first text line, is located within a threshold vertical distance threshold from the first text line;
responsive to determining that the second text line is located within the threshold vertical distance threshold from the first text line: determining that text in the second text line continues at least one column header of the column headers in the first text line.

### Claim 22

A system comprising:
at least one hardware processor;
the system storing instructions which, when executed by the at least one hardware processor, cause performance of operations comprising:
detecting a plurality of phrases in an electronic document that are (a) on a same first text line and (b) correspond respectively to a plurality of known fields,
wherein a first phrase of the plurality of phrases corresponds to a first field of the plurality of known fields,
wherein a second phrase of the plurality of phrases corresponds to a second field of the plurality of known fields,
wherein the first phrase and the second phrase correspond to column headers in a table in the electronic document;
extracting data from the table in the electronic document at least by:
responsive at least to determining that a first value has (a) a corresponding horizontal position in the electronic document that at least partially overlaps with a horizontal position of the first phrase in the electronic document and (b) a corresponding vertical position in the electronic document that is below a vertical position of the first phrase in the electronic document: storing the first value in association with the first field that corresponds to the first phrase;
responsive at least to determining that a second value has (a) a corresponding horizontal position in the electronic document that at least partially overlaps with a horizontal position of the second phrase in the electronic document and (b) a corresponding vertical position in the electronic document that is below a vertical position of the second phrase in the electronic document: storing the second value in association with the second field that corresponds to the second phrase.

### Claim 23 (depends on 22)

The system of claim 22, wherein the operations further comprise:
responsive to determining that the plurality of phrases are (a) on the same first text line and (b) correspond respectively to the plurality of known fields:
determining that the plurality of phrases correspond respectively to a plurality of column headers in the table in the electronic document.
