Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 13 min read Deep dive easyNovice

Accelerating Document AI

Open-source multimodal models now make it practical to build custom Document AI systems for OCR, document classification, layout analysis, parsing, table extraction and document question answering. Models such as LayoutLMv3 and Donut combine text and visual layout. On RVL-CDIP they reach about 95% accuracy, against 89% for text-only BERT, and on FUNSD LayoutLM raises F1 from 60% to 90%. Practical advice: check model licenses early, since LayoutLMv2/v3 checkpoints are non-commercial. Start with a few hundred annotated documents and fine-tune pretrained models rather than pre-training your own. Weigh OCR-free, high-resolution models against their memory cost, and verify that OCR bounding boxes align with the model processor.

Assumes: Transformer modelsfine-tuning pretrained models

Related posts

  • Supercharge your OCR Pipelines with Open Models

    Hugging Face mediumAdept

    Vision-language-model-based OCR has moved well beyond plain transcription. Current open-weight models such as OlmOCR-2, Chandra, dots.ocr, DeepSeek-OCR, PaddleOCR-VL, Granite-Docling and Nanonets-OCR2 handle handwriting, tables, charts, formulas and layout grounding, and output DocTags, HTML, Markdown or JSON. Choose the output format by use case: layout-preserving formats for digital reconstruction, Markdown with image captions for LLM input, and JSON for programmatic use. Since performance varies widely by domain, evaluate candidates on your own representative documents alongside OmniDocBench, OlmOCR-Bench and CC-OCR. Open models are cheap to run, around $178 per million pages for OlmOCR-2 on an H100, and serve easily with vLLM behind an OpenAI-compatible client.

  • Welcome the NVIDIA Llama Nemotron Nano VLM to Hugging Face Hub

    Hugging Face easyNovice

    Llama Nemotron Nano VL is an 8B vision language model for document processing, built on Llama-3.1-8B-Instruct with a C-RADIOv2-VLM-H vision transformer. It uses dynamic high-resolution tiling to handle dense layouts and arbitrary aspect ratios, and is reported to lead on OCRBench v2 for text recognition, table extraction, element parsing and bounding-box grounding. Training has two stages: MLP-connector pre-training on ~1.5M samples for vision-language alignment, then end-to-end SFT on OCR-heavy data drawn from NeMo Retriever Parse sets (NVPDFTex, Common Crawl PDFs, Wikipedia renders) plus DocLayNet, FinTabNet and PubTables-1M, with affine and photometric augmentation. The model outputs tables in LaTeX, HTML or markdown and can be post-trained further with NeMo and Megatron scripts.

  • Finetuning olmOCR to be a faithful OCR-Engine

    Hugging Face mediumAdept

    TNG fine-tuned olmOCR-7B-0225-preview so it no longer drops headers and footers. The original model omits them by design because its training data targets LLM pretraining text, which makes it unreliable for business documents like invoices. The team used Qwen2.5-VL-72B-Instruct to generate an 8,000-document dataset capturing all page content, then trained with the open-source olmOCR pipeline on an 8xH100 node: 2.5 epochs, default hyperparameters, about 6 hours, with roughly two GPUs likely enough. Qualitative comparisons show the fine-tune extracts header and footer data while still parsing simple tables and multi-column layouts, though output quality can vary noticeably with sampling temperature.

  • Visual Document Retrieval Goes Multilingual

    Hugging Face hardMaster

    vdr-2b-multi-v1 is a multilingual embedding model that encodes document page screenshots into single dense vectors for OCR-free retrieval. It is fine-tuned from dse-qwen2-2b-mrl-v1 on a new open 500k-sample synthetic dataset covering Italian, Spanish, English, French and German. The data pipeline is laid out step by step: topic-driven PDF scraping, layout-based page sampling, VLM query generation, filtering with voyage-3 and hard-negative mining. The model improves NDCG@5 by about 2.3% on average over the base model and by 2.3% on Italian-to-German cross-lingual search. An English-only variant matches the base model using 768 instead of 2560 image tokens, about 3x faster inference, and Matryoshka plus binary embeddings keep roughly 97-99% of quality at much smaller vector sizes.

  • Newer Models, Same Advantage

    Hugging Face easyNovice

    DharmaOCR, a Brazilian Portuguese OCR model trained with supervised fine-tuning followed by Direct Preference Optimization, scored 0.925 on a Portuguese-only benchmark, ahead of the newer Mistral OCR4 (0.798) and Unlimited-OCR (0.7587). The gap shows up as misread Brazilian proper nouns and vocabulary in handwritten ENEM essays, and as text degeneration on small-font documents, where generalist models produce output unrelated to the page. SFT focuses the model's parameters on the target language. DPO trains on preferences between complete outputs, which reduces the token-by-token drift that causes repetitive or incoherent transcriptions. The authors argue that specialization will keep an edge even as general models improve.

The quest for software engineering knowledge.

Look:
Layout: