1/10/2025 at 12:47:20 PM
Is there a OCR toolkit or a ML Model which is able to reliable extract tables from invoices?by hammersbald
1/10/2025 at 2:58:40 PM
By far the best one I've come across is Microsoft Azure Document Intelligence with the Layout Model[0].It's really, really good at tables.
You have to use the Layout Model and not just the base Document Intelligence.
A bit pricey, but if you're processing content one time and it's high value (my use case as clinical trial protocol documents and the trial will run anywhere from 6-24 months), then it's worth it, IMO.
[0] https://learn.microsoft.com/en-us/azure/ai-services/document...
by CharlieDigital
1/10/2025 at 1:04:58 PM
All frontier multi modal LLMs can do this - there’s likely something lighter weight as well.In my experience, the latest Gemini is best at vision and OCR
by benpacker
1/10/2025 at 2:48:05 PM
> All frontier multi modal LLMs can do thisThere's reliable, and there's reliable. For example [1] is a conversation where I ask ChatGPT 4o questions about a seven-page tabular PDF from [2] which contains a list of election polling stations.
The results are simultaneously impressive and unimpressive. The document contains some repeated addresses, and the LLM correctly identifies all 11 of them... then says it found ten.
It gracefully deals with the PDF table, and converts the all-caps input data into Title Case.
The table is split across multiple pages, and the title row repeats each time. It deals with that easily.
It correctly finds all five schools mentioned.
When asked to extract an address that isn't in the document it correctly refuses, instead of hallucinating an answer.
When asked to count churches, "Bunyan Baptist Church" gets missed out. Of two church halls, only one gets counted.
The "Friends Meeting House" also doesn't get counted, but arguably that's not a church even if it is a place of worship.
Longmeadow Evangelical Church has one address, three rows and two polling station numbers. When asked how many polling stations are in the table, the LLM counts that as two. A reasonable person might have expected one, two, three, or a warning. If I was writing an invoice parser, I would want this to be very predictable.
So, it's a mixed bag. I've certainly seen worse attempts at parsing a PDF.
[1] https://chatgpt.com/share/67812ad9-f2bc-8011-96be-faea40e48d... [2] https://www.stevenage.gov.uk/documents/elections/2024-pcc-el...
by michaelt
1/10/2025 at 10:34:51 PM
You can try to ask it to list all churches and assign them incremental number starting with 1. then print the last number. It's a variation of counting 'r' in 'raspberry' which works better than simple direct question.by numba888
1/10/2025 at 7:32:36 PM
> There's reliable, and there's reliable. For example [1] is a conversation where I ask ChatGPT 4o questions about a seven-page tabular PDF from [2] which contains a list of election polling stations.From your description, it does perfectly at the task asked about upthread (extraction) and has mixed results on other, question-answering, tasks, that weren't the subject.
by dragonwriter
1/10/2025 at 9:00:32 PM
> From your description, it does perfectly at the task asked about upthread (extraction) and has mixed results on other, question-answering, tasks, that weren't the subject.¯\_(ツ)_/¯
Which do you think was which?
by michaelt
1/10/2025 at 6:24:16 PM
Do I understand correctly that nearly all issues were related to counting (i.e. numerical operations)? that makes it still impressive because you can do that client-side with the structured databy NeedMoreTime4Me
1/10/2025 at 9:29:44 PM
Some would say the numerical information is among the most important parts of an invoice.by michaelt
1/10/2025 at 3:20:50 PM
I wonder if performance would improve if you asked it to create csvs from the tables first, then fed the CSVs in to a new chat?by philomath_mn
1/10/2025 at 3:52:53 PM
https://github.com/microsoft/table-transformerThis is much lighter weight and more reliable than vllm
by ttt3ts
1/10/2025 at 4:35:50 PM
As someone that spent quite a bit of time with table-transformers, I would definitely not recommend it. It was one of the first libraries we added for parsing tables into our chunking library [1] and the results were very underwhelming. This was a while back and at this point, it's just so much easier to use an LLM end to end for parsing docs (Gemini Flash can parse 20k pages per dollar) and I'm wary of any approach that stitches together different models.by serjester
1/11/2025 at 6:05:54 PM
Do you have some benchmark results I can look at that compares results?by ttt3ts
1/10/2025 at 8:52:09 PM
I would like to through our project in the ring. We use ColQwen2 over a ColPali implementation. Basically, search & extract pipeline: https://docs.colivara.com/guide/markdownby jonathan-adly
1/11/2025 at 1:59:06 PM
Surya is a great open source toolkit for table parsing, layout analysis and OCR: https://github.com/VikParuchuri/suryaby m_ke