-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving Table Performance #26
Comments
Could you provide the code you're running? |
@Filimoa Sorry, it's your notebook file which I added to. I'm simply trying to identify the best way to extract text using OpenParse from a document like this: # -*- coding: utf-8 -*-
"""unitable.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1Sl-RQTv7Kw_2c2ymr8W_Fpz_HWKdK3v4
## Unitable
When table detection works this yields perfect results for incredibly challenging tables. Unfortunately we still need to use table-transformers for bounding box detection and it's performance leaves something to be desired.
I spoke with the UniTable team and they might implement this. Their challenge lies in PubTables-1M having poor groundtruth annotations.
If you're aware of a better table detection model, please let us know - theoretically this task should be significantly easier than content-extraction.
## Notebook
This notebook demonstrates using unitable to extract some challenging tables we've seen. This is meant to really push the limits of the model.
You will need to use git LFS to download the sample data.
"""
!pip install "openparse[ml]"
!openparse-download
import sys
from pathlib import Path
sys.path.append("..")
import openparse
pdfs_with_tables_dir = Path("/content/pdf")
for pdf_path in pdfs_with_tables_dir.glob("*"):
parser = openparse.DocumentParser(
table_args={
"parsing_algorithm": "unitable",
"min_table_confidence": 0.8,
},
processing_pipeline=None,
)
parsed_nodes = parser.parse(pdf_path)
table_nodes = [node for node in parsed_nodes.nodes if "table" in node.variant]
if not table_nodes:
print(f"Could not find tables on {pdf_path}")
continue
doc = openparse.Pdf(file=pdf_path)
doc.display_with_bboxes(table_nodes) |
Thanks, I'll try running this myself soon and add it to the eval suite. If I had to guess the |
@Filimoa So just to be clear, that notebook code I posted should have done the extraction similar to the quickstart and is the SOTA method open parse supports, right? |
I added to the quickstart and it tells me there are no tables in the file - which is clearly wrong. import sys
from pathlib import Path
sys.path.append("..")
import openparse
pdfs_with_tables_dir = Path("/content/pdf")
for pdf_path in pdfs_with_tables_dir.glob("*"):
parser = openparse.DocumentParser(
table_args={
"parsing_algorithm": "unitable",
"min_table_confidence": 0.8,
},
processing_pipeline=None,
)
parsed_nodes = parser.parse(pdf_path)
table_nodes = [node for node in parsed_nodes.nodes if "table" in node.variant]
if not table_nodes:
print(f"Could not find tables on {pdf_path}")
continue
doc = openparse.Pdf(file=pdf_path)
doc.display_with_bboxes(table_nodes)
```
|
I haven't had a chance to test for myself but to clarify yes unitable achieves SOTA performance on converting table images to HTML. Unfortunately it's trained on perfectly cropped tables so we're still forced to rely on table transformers to detect bounding boxes. So if table-transformers doesn't find a table, it won't touch unitable. I'm actively looking for something with better performance - I haven't had a chance to look into this very deeply, intuitively this seems like a much simpler task than the second stage. |
@Filimoa table-transformers sees the table before this. |
I'm working on shipping a llama-index integration and then I will spend some time improving table performance - there's a lot of low hanging fruit here. |
@TKaluza No not familiar with it, thanks for dropping the link I'll check it out |
Initial Checks
Description
I'm trying to use the https://filimoa.github.io/open-parse/processing/parsing-tables/unitable/ support to extract content out of a UB-04 document - I added
!pip install "openparse[ml]"
and!openparse-download
to the notebook, but I'm not sure what else is required.Thanks!
Example Code
No response
The text was updated successfully, but these errors were encountered: