Live data from Hacker News

Nanonets-OCR-s – OCR model that transforms documents into structured markdown

huggingface.co

31–40 of 85 posts

Re: Nanonets-OCR-s – OCR model that transforms documents into structured markdown

#31
post #26

How does it do with multi-column text and headers and footers?

We have trained the model on tables with hierarchical column headers and with rowspan and colspan >1. So it should work fine. This is the reason we predict the table in HTML instead of markdown.

Re: Nanonets-OCR-s – OCR model that transforms documents into structured markdown

#32
post #24

Earlier quoted context omitted.

Actually, we have trained the model to convert to markdown and do semantic tagging at the same time. Eg, the equations will be extracted as LaTeX equations, and images (plots, figures, and so on) will be described within the ` ` tags. Same with ` `, ` `, . Also, we extract the tables as HTML tables instead of markdown for complex tables.

What happens to footnotes?

They will be extracted in a new line as normal text. It will be the last line.

Re: Nanonets-OCR-s – OCR model that transforms documents into structured markdown

#33
post #28

Earlier quoted context omitted.

Hey, the reason for the long processing time is that lots of people are using it, and with probably larger documents. I tested your file locally seems to be working correctly. https://ibb.co/C36RRjYs Regarding the token limit, it depends on the text. We are using the qwen-2.5-vl tokenizer in case you are interested in reading about it. You can run it very easily in a Colab notebook. This should be faster than the dem…

> I tested your file locally seems to be working correctly Apologies if there's some unspoken nuance in this exchange, but by "working correctly" did you just mean that it ran to completion? I don't even recognize some of the unicode characters that it emitted (or maybe you're using some kind of strange font, I guess?) Don't misunderstand me, a ginormous number of floating point numbers attempting to read that handwr…

This is the result. ``` Page 1 of 1 Page # <page_number>8</page_number>

Log: MA 6100 Z. O 3. 15

34 cement emitter resistors - 0.33 R SW 5% measure 0.29 R, 0.26 R 35 replaced R'4 36, R4 30 emitter resistor on R-44 0.0. 3rd w/ new WW 5W .33R 36 % w/ ceramic lead insulators applied de-oat d100 to Speak outs, card terminals, terminal blocks, output tran jacks 37 replace &-clun diviers and class A BJTs w/ BD139/140 & TIP37A2 38 placed boards back in 39 desoldered ground lus from volume (con 48) 40 contact cleaner, Deox. t DS, facel/42 on pots & switches · teflon lube on rotor joint 41 reably cleaned ground lus & resoldered, reattatched panel ```

You can paste it in https://markdownlivepreview.com/ and see the extraction. This is using the Colab notebook I have shared before.

Which Unicode characters are you mentioning here?

Re: Nanonets-OCR-s – OCR model that transforms documents into structured markdown

#34
post #18

How does it compare to Datalab/Marker https://github.com/datalab-to/marker ? We evaluated many PDF->MD converters and this one performed the best, though it is not perfect.

As anecdotal evidence, it serves my complex-enough purposes very well - mathematics and code interspersed together. One of my "litmus test" papers is this old paper on a Fortran inverse-Laplace transform algorithm [1] that intersperses inline and display equations, and monospace code blocks, while requiring OCR from scratch, and very few models currently do a satisfactory job, i.e. in the following page transcribed by Marker,

https://imgur.com/a/Q7UYIfW

the inline $\sigma_0$ is mangled as "s 0", and $f(t)$ is mangled as "f~~t*!". The current model gets them both correct.

Re: Nanonets-OCR-s – OCR model that transforms documents into structured markdown

#35
post #29

Earlier quoted context omitted.

Actually, we have trained the model to convert to markdown and do semantic tagging at the same time. Eg, the equations will be extracted as LaTeX equations, and images (plots, figures, and so on) will be described within the ` ` tags. Same with ` `, ` `, . Also, we extract the tables as HTML tables instead of markdown for complex tables.

Have you considered XML. TEI, for example, is very robust and mature for marking up documents.

First I heard of it. https://en.wikipedia.org/wiki/Text_Encoding_Initiative

Re: Nanonets-OCR-s – OCR model that transforms documents into structured markdown

#37
post #7

There are no benchmarks or accuracy measures on a hold out set?

Hi, author of the model here.. We have a benchmark for evaluating VLM on document understanding tasks: https://idp-leaderboard.org/ . But unfortunately, it does not include image to markdown as a task. The problem with evaluating an image to markdown is that even if the order of two blocks are different, it can still be correct. Eg: if you have both seller info and buyer info side by side in the image one model can e…

If this is the only issue, can't this be addressed by normalizing the post-processed data before scoring? (that is, if it really is just a matter of block ordering)

Re: Nanonets-OCR-s – OCR model that transforms documents into structured markdown

#38
post #35
post #29

Earlier quoted context omitted.

Have you considered XML. TEI, for example, is very robust and mature for marking up documents.

First I heard of it. https://en.wikipedia.org/wiki/Text_Encoding_Initiative

Understandable. I work in academic publishing, and while the XML is everywhere crowd is graying, retiring, or even dying :( it still remains an excellent option for document markup. Additionally, a lot of government data produced in the US and EU make heavy use of XML technologies. I imagine they could be an interested consumer of Nanonets-OCR. TEI could be a good choice as well tested and developed conversions exist to other popular, less structured, formats.

Re: Nanonets-OCR-s – OCR model that transforms documents into structured markdown

#39
post #26

How does it do with multi-column text and headers and footers?

We have trained the model on tables with hierarchical column headers and with rowspan and colspan >1. So it should work fine. This is the reason we predict the table in HTML instead of markdown.

Thank you. I was rather thinking of magazine like layouts with columns of text and headers and footers on every page holding article title and page number.

Re: Nanonets-OCR-s – OCR model that transforms documents into structured markdown

#40
post #7

There are no benchmarks or accuracy measures on a hold out set?

Hi, author of the model here.. We have a benchmark for evaluating VLM on document understanding tasks: https://idp-leaderboard.org/ . But unfortunately, it does not include image to markdown as a task. The problem with evaluating an image to markdown is that even if the order of two blocks are different, it can still be correct. Eg: if you have both seller info and buyer info side by side in the image one model can e…

The more important thing to me with any VLM is base OCR performance and hallucinations. It's not too hard to get improved average accuracy on very low quality scans using language models. Unfortunately these also typically produce large numbers of hallucinations, which are a deal breaker if you are trying to get out values for financial or legal purposes.

OCR that has lower accuracy, but where the inaccurate parts are left blank or flagged are far superior. Mistral OCR also suffers from this problem.

If your OCR produced bounding boxes for every text line, and ran a traditional OCR on the text, this could alleviate it. Or at the very least bounding boxes let users cross-correlate with output from traditional OCR.

Also a small note, it's probably best not to say your product beats Mistral when it's not even tested against it. Having more features doesn't make a product better if the accuracy is not better on those features.

I don't mean to be discouraging, this is an important space and it looks like you have a very feature rich model. I'd like to see a good solution be developed!

Post reply on HN