New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

thelamapi/next-ocr

Package Overview
Dependencies
Contributors
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thelamapi/next-ocr

Hugging FaceHugging Face Hub
Version
5790b6d
Version published
Monthly downloads
5.1K
Contributors
1
Source

🖼️ Next OCR 8B

Compact OCR AI — Accurate, Fast, Multilingual, Math-Optimized

License: MIT Language: Multilingual HuggingFace Discord

📖 Overview

Next OCR 8B is an 8-billion parameter model optimized for optical character recognition (OCR) tasks with mathematical and tabular content understanding.

Supports multilingual OCR (Turkish, English, German, Spanish, French, Chinese, Japanese, Korean, Russian...) with high accuracy, including structured documents like tables, forms, and formulas.

⚡ Highlights

  • 🖼️ Accurate text extraction, including math and tables
  • 🌍 Multilingual support (30+ languages)
  • ⚡ Lightweight and efficient
  • 💬 Instruction-tuned for document understanding and analysis

📊 Benchmark & Comparison

image

ModelOCR-Bench Accuracy (%)Multilingual Accuracy (%)Layout / Table Understanding (%)
Next OCR99.096.895.3
PaddleOCR95.293.995.3
Deepseek OCR90.687.486.1
Tesseract92.088.472.0
EasyOCR90.484.778.9
Google Cloud Vision / DocAI98.795.593.6
Amazon Textract94.786.286.1
Azure Document Intelligence95.193.691.4
ModelHandwriting (%)Scene Text (%)Complex Tables (%)
Next OCR929691
PaddleOCR889290
Deepseek OCR808583
Tesseract758870
EasyOCR788675
Google Cloud Vision / DocAI909592
Amazon Textract859088
Azure Document Intelligence879189

🚀 Installation & Usage

from transformers import AutoTokenizer, AutoModelForVision2Seq
import torch

model_id = "Lamapi/next-ocr"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForVision2Seq.from_pretrained(model_id, torch_dtype=torch.float16)

img = Image.open("image.jpg")

# ATTENTION: The content list must include both an image and text.
messages = [
    {"role": "system", "content": "You are Next-OCR, an helpful AI assistant trained by Lamapi."},
    {
        "role": "user",
        "content": [
            {"type": "image", "image": img},
            {"type": "text", "text": "Read the text in this image and summarize it."}
        ]
    }
]

# Apply the chat template correctly
prompt = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=prompt, images=[img], return_tensors="pt").to(model.device)

with torch.no_grad():
    generated = model.generate(**inputs, max_new_tokens=256)

print(processor.decode(generated[0], skip_special_tokens=True))

🧩 Key Features

FeatureDescription
🖼️ High-Accuracy OCRExtracts text from images, documents, and screenshots reliably.
🇹🇷 Multilingual SupportWorks with 30+ languages including Turkish.
⚡ Lightweight & EfficientOptimized for resource-constrained environments.
📄 Layout & Math AwarenessHandles tables, forms, and mathematical formulas.
🏢 Reliable OutputsSuitable for enterprise document workflows.

📐 Model Specifications

SpecificationDetails
Base ModelQwen 3
Parameters8 Billion
ArchitectureVision + Transformer (OCR LLM)
ModalitiesImage-to-text
Fine-TuningOCR datasets with multilingual and math/tabular content
OptimizationsQuantization-ready, FP16 support
Primary FocusText extraction, document understanding, mathematical OCR

🎯 Ideal Use Cases

  • Document digitization
  • Invoice & receipt processing
  • Multilingual OCR pipelines
  • Tables, forms, and formulas extraction
  • Enterprise document management

📄 License

MIT License — free for commercial & non-commercial use.

📞 Contact & Support

Next OCR — Compact OCR + math-capable AI, blending accuracy, speed, and multilingual document intelligence.

Follow on HuggingFace

FAQs

Package last updated on 12 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts