424 1 month ago

A Qwen2.5VL:3b finetune designed to generate structured markdown files from documents.

vision

Models

View all →

Readme

Nanonets-OCR-s by Nanonets

Nanonets-OCR-s by Nanonets is a powerful, state-of-the-art image-to-markdown OCR model that goes far beyond traditional text extraction. It transforms documents into structured Markdown with intelligent content recognition and semantic tagging, making it ideal for downstream processing by Large Language Models (LLMs).


🔍 Key Features

📐 LaTeX Equation Recognition

Automatically converts mathematical equations and formulas into properly formatted LaTeX syntax.
It distinguishes between: - Inline equations: $...$ - Display equations: $$...$$

🖼️ Intelligent Image Description

Describes images within documents using structured <img> tags, making them digestible for LLM processing.
It can describe various image types, including: - Logos - Charts - Graphs
It details their content, style, and context.

✍️ Signature Detection & Isolation

Identifies and isolates signatures from other text, outputting them within a <signature> tag.
This is crucial for processing legal and business documents.

💧 Watermark Extraction

Detects and extracts watermark text from documents, placing it within a <watermark> tag.

☑️ Smart Checkbox Handling

Converts form checkboxes and radio buttons into standardized Unicode symbols for consistent and reliable processing: - ☐ (Unchecked) - ☑ (Checked) - ☒ (Crossed)

📊 Complex Table Extraction

Accurately extracts complex tables from documents and converts them into: - Markdown table format - HTML table format


🧠 How to Use It

To use Nanonets-OCR-s effectively, you must provide a well-structured prompt. Here’s the recommended prompt:

prompt = """Extract the text from the above document as if you were reading it naturally. 
Return the tables in html format. 
Return the equations in LaTeX representation. 
If there is an image in the document and image caption is not present, add a small description of the image inside the <img></img> tag; otherwise, add the image caption inside <img></img>. 
Watermarks should be wrapped in brackets. Ex: <watermark>OFFICIAL COPY</watermark>. 
Page numbers should be wrapped in brackets. Ex: <page_number>14</page_number> or <page_number>9/22</page_number>. 
Prefer using ☐ and ☑ for check boxes."""