Here are the top models and approaches for extracting both layout and text from documents and images:
Vision-Language Models
GPT-4V (GPT-4 with Vision) - Excellent at understanding document structure and extracting both text and layout information. Can handle complex documents, tables, and forms with natural language instructions.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Google Gemini Pro Vision - Strong performance on document understanding tasks, good at maintaining spatial relationships and extracting structured data.
Claude 3 models - Capable of processing images and extracting text while understanding layout context and document structure.
Specialized Document AI Models
Microsoft LayoutLMv3 - Purpose-built for document understanding, combines text, layout, and image information. Excellent for forms, receipts, and structured documents.
Meta Donut (Document Understanding Transformer) - End-to-end model that doesn't require OCR preprocessing. Good for converting document images directly to structured text.
PaddleOCR + PP-Structure - Open-source solution combining OCR with layout analysis. Handles tables, paragraphs, and complex document structures well.
Commercial APIs
Google Document AI - Robust commercial solution with pre-trained models for invoices, forms, and general documents.
AWS Textract - Strong table extraction and form processing capabilities with good accuracy on complex layouts.
Azure Document Intelligence - Good performance on forms and structured documents with custom model training options.
For most use cases, I'd recommend starting with GPT-4V or similar vision-language models for flexibility, or LayoutLMv3 if you need a specialized solution you can fine-tune.
What type of documents are you looking to process?