News for hackers. Stuff that matters.
Re:Donut: OCR-Free Document Understanding Transformer by lelandfe on Monday May 29, 2023 @06:56AM (#36112714)
OCRmyPDF is the typical answer: https://github.com/ocrmypdf/OCRmyPDF

It uses Tesseract under the hood. Results tend to just be OK in my experience.

Re:Donut: OCR-Free Document Understanding Transformer by xrd on Monday May 29, 2023 @09:25AM (#36113710)
Tesseract is amazing. It is simple and generally good results.
Re:Donut: OCR-Free Document Understanding Transformer by version_five on Monday May 29, 2023 @10:18AM (#36114237)
I was just playing with tesseract last week (I'd used it years ago) and wasn't too happy. I had a pretty simple pdf that was in what you could think of as an old typewritten font, but easily legible, and I got all kinds of word fragments and nonsense characters in the output. I know that high quality ocr systems include a language model to coerce the read text into the most probable words. Is tesseract just supposed to be the first stage of such a system?

I'll note that when I put the tesseract output into chatgpt and prompted it saying it was ocr'd text and asking to clean it up, it worked very well.

Re:Donut: OCR-Free Document Understanding Transformer by lelandfe on Monday May 29, 2023 @10:36AM (#36114423)
I tried to figure out how to train Tesseract on a specific font and just gave up after a while. Coercion from a dictionary or language model also sounds like it would be a good idea.
Re:Donut: OCR-Free Document Understanding Transformer by flaviut on Monday May 29, 2023 @01:40PM (#36116136)
I was just processing a document with tesseract & ocrmypdf, and two things:

My first time processing it, I used `ocrmypdf --redo-ocr` because it looked like there was some existing OCR. After processing, the OCR was crap because ocrmypdf didn't realize it was OCR but thought it was real text in the document that should be kept. This was fixable using `ocrmypdf --force-ocr`.

Before realizing this, I discovered that Tesseract 4 & 5 use a neural network-based recognition. I then came across this step-by-step guide on fine-tuning Tesseract for a specific document set: https://www.statworx.com/en/content-hub/blog/fine-tuning-tes...

I didn't end up following the fine-tuning process because at this point `ocrmypdf --force-ocr` worked excellently, but I thought the draw_box_file_data.py script from their example was particularly useful: https://gist.github.com/flaviut/d901be509425098645e4ae527a9e...

Re:Donut: OCR-Free Document Understanding Transformer by denysvitali on Monday May 29, 2023 @06:10PM (#36118711)
FWIW, I'm using Google's ML Kit which runs completely on-device and doesn't send the documents to Google. It works better than tesseract for my use case.

I did a presentation on the topic recently: https://clis-everywhere.k8s.best/16

I'll soon make the stack open source, but it shouldn't be hard to recreate given the inputs I've already provided.

Re:Donut: OCR-Free Document Understanding Transformer by dataflow on Monday May 29, 2023 @01:08PM (#36115796)
I could never get tesseract to give good output. It baffles me when people say it's good. Do I need to tune it somehow or something?