Live data from Hacker News

DeepDoctection: Document extraction and analysis using deep learning models

github.com

51–60 of 63 posts

Re: DeepDoctection: Document extraction and analysis using deep learning models

#51
post #33

Earlier quoted context omitted.

GPT-4 presumably.

I keep bumping in to the context window size. I'm trying to figure out a "compression" step that I can use in the general case, but nothing's very satisfying so far. The mozilla/readability library is a good first step though.

Yeah I have the same issue with context window size. Personally I'm just waiting for future LLM's with 10x-100x context window. However, someone else recently came up with this solution:

https://news.ycombinator.com/item?id=35488291

Re: DeepDoctection: Document extraction and analysis using deep learning models

#52
post #50

Earlier quoted context omitted.

Yeah I get that, after all attension is all you need. But unless you want to spend a bunch of money on the 32k context version I don't think there are other options than embeddings and index.

What is the state of the art for running models locally in terms of context size?

I think local models SOTA is llama which has 2048 context[1].

[1] https://github.com/facebookresearch/llama/issues/16

Re: DeepDoctection: Document extraction and analysis using deep learning models

#53

Earlier quoted context omitted.

Could you explain how you use GPT for ocr correction?

https://promptbase.com/prompt/ocr-text-fixer This is the prompt I bought from promptbase. You basically provide GPT with some examples on possible OCR errors, and then you give it the OCRed text and it tries to correct it

Fascinating. Thanks!

Re: DeepDoctection: Document extraction and analysis using deep learning models

#54

I've worked extensively in this space. For those looking for just an OCR solution MSFT's offering "read" is by and far the most accurate. Key-value, table and other information extraction is a much harder problem. Anything that can go wrong in production will. Documents with extra pages, rotated, blacked out, fuzzy. There are many steps that go into making document extraction really e2e. The biggest enterprise users…

Do they have human workers for those hard to solve cases in the loop?

Yes the solution i worked on had an interface for HITL

Re: DeepDoctection: Document extraction and analysis using deep learning models

#55
post #32

I've worked extensively in this space. For those looking for just an OCR solution MSFT's offering "read" is by and far the most accurate. Key-value, table and other information extraction is a much harder problem. Anything that can go wrong in production will. Documents with extra pages, rotated, blacked out, fuzzy. There are many steps that go into making document extraction really e2e. The biggest enterprise users…

I would like to extract text from approximately 2000 PDF files (machine generated, not scanned) in which the layout can be different on a file basis. Some have normal paragraphs, others two columns and even three columns. All contain tables, but I am not interested in them. Do you know a good (semi-)automatic solution for this?

this is a hard problem and will require an enterprise solution unfortunately. If its only 2000 pdfs you might be better outsourcing to an off-shore consulting agency to do it manually

Re: DeepDoctection: Document extraction and analysis using deep learning models

#56
post #29

Interesting I was just thinking a LLM would do a great job correcting OCR mistakes.

OCR engines may use a HMM (Hidden Markov Model) for OCR correction.

Yeah, but they don’t do a semantic correction. LLM are extraordinarily more powerful than HMM.

Re: DeepDoctection: Document extraction and analysis using deep learning models

#57
post #32

Earlier quoted context omitted.

I would like to extract text from approximately 2000 PDF files (machine generated, not scanned) in which the layout can be different on a file basis. Some have normal paragraphs, others two columns and even three columns. All contain tables, but I am not interested in them. Do you know a good (semi-)automatic solution for this?

this is a hard problem and will require an enterprise solution unfortunately. If its only 2000 pdfs you might be better outsourcing to an off-shore consulting agency to do it manually

Thanks for the reply, good to know that!

Re: DeepDoctection: Document extraction and analysis using deep learning models

#58
post #33

Earlier quoted context omitted.

I keep bumping in to the context window size. I'm trying to figure out a "compression" step that I can use in the general case, but nothing's very satisfying so far. The mozilla/readability library is a good first step though.

Yeah I have the same issue with context window size. Personally I'm just waiting for future LLM's with 10x-100x context window. However, someone else recently came up with this solution: https://news.ycombinator.com/item?id=35488291

I feel like the next step is to quantize or otherwise downsize old tokens so that they can fit more in memory at once. Not sure what the implications of a mixed-float-size model would be.

Re: DeepDoctection: Document extraction and analysis using deep learning models

#59
post #33

Earlier quoted context omitted.

I keep bumping in to the context window size. I'm trying to figure out a "compression" step that I can use in the general case, but nothing's very satisfying so far. The mozilla/readability library is a good first step though.

Why do you want to compress this data? What's the final use case here?

Imagine a browser plugin that pops up a modal. I write a query related to the current page, eg "Please summarize this page in three paragraphs, and translate to Turkish" or "There's a recipe somewhere on this page. Please suggest some variations on the filling" or "Can you make me a list of all the people mentioned on this page". Whole page (or at least the meat of it) gets bundled up with the query and sent to openai. What I'm trying to build is a simple in-browser swiss army knife.

Yes, I could try to figure out which bits of the page need to be sent along with the prompt, but that's hard in the general case. Squeezing a bit more out of the prompt window by stripping out unnecessary boilerplate is easy by comparison. (Multi-page articles are another headache).

Re: DeepDoctection: Document extraction and analysis using deep learning models

#60
post #59

Earlier quoted context omitted.

Why do you want to compress this data? What's the final use case here?

Imagine a browser plugin that pops up a modal. I write a query related to the current page, eg "Please summarize this page in three paragraphs, and translate to Turkish" or "There's a recipe somewhere on this page. Please suggest some variations on the filling" or "Can you make me a list of all the people mentioned on this page". Whole page (or at least the meat of it) gets bundled up with the query and sent to opena…

Due to the constrained context window this is indeed a problem. But I would say solving it by just increasing context window will be really brute forcing the issue. I hope we can come up with something better. I'm betting on embeddings for these kind of things in my personal projects. But that too seems like a jackhammer for a nail kind of thing for single web pages.
Post reply on HN