/ Модель

Характеристики

Контекст
32 768 токенов
Лицензия
Apache 2.0
Базовая модель
Qwen2-VL-2B-Instruct-unsloth-bnb-4bit
Библиотека
peft
Опубликована
26 мар 2025

Qari-OCR-0.2.2.1-VL-2B-Instruct

Генерация текстаТекст → текст8 профессий

Qari-OCR-0.2.2.1-VL-2B-Instruct — мультимодальная модель для оптического распознавания арабского текста на изображениях страниц документов.

1 263скачиваний за 30 дней26лайковвеса обновлены7 июн 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Она разработана в рамках проекта NAMAA и является дообученной версией Qwen2-VL-2B-Instruct на арабском наборе данных OCR объёмом 50 000 записей. Модель предназначена прежде всего для извлечения текста со страниц документов и поддерживает арабский язык.

Модель основана на архитектуре Qwen2-VL и относится к классу vision-language моделей с параметрами порядка 2 млрд. Она рассчитана на обработку изображений и генерацию текстового представления документа, включая арабские диакритические знаки ташкиль. В обучении использовались различные размеры шрифта, форматы страниц и набор арабских шрифтов, поэтому модель подходит для документов с разными шрифтами и макетами. Длина контекста и точный перечень поддерживаемых модальностей в README не указаны.

Согласно приведённой оценке, модель показала WER 0,221, CER 0,059 и BLEU 0,597 на тестовом наборе, преимущественно содержащем тексты с диакритическими знаками. Ограничения включают возможное снижение качества на очень мелком или крупном тексте, редких шрифтах, сложных многоколоночных макетах, рукописном или декоративном письме, текстурированных фонах, размытых изображениях, а также на вертикально или диагонально ориентированном тексте. Модель распространяется по лицензии Apache-2.0.

Для каких профессий подходит8

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Qari-OCR-Arabic-0.2.2.1-VL-2B-Instruct Model

This is the model described in the paper QARI-OCR: High-Fidelity Arabic Text Recognition through Multimodal Large Language Model Adaptation.

Model Overview

This model is a fine-tuned version of unsloth/Qwen2-VL-2B-Instruct on an Arabic OCR dataset. It is optimized to perform Arabic Optical Character Recognition (OCR) for full-page text.

Code can be found at this url .

Key Features

  • Superior Accuracy: Achieves state-of-the-art performance metrics for Arabic OCR
  • Diacritics Support: Full recognition of Arabic diacritical marks (tashkeel) including fatḥah, kasrah, ḍammah, sukūn, shadda, and tanwin forms - a strength confirmed by evaluation on a primarily diacritical text dataset
  • Multiple Font Support: Works across a variety of Arabic font styles
  • Layout Flexibility: Handles different document layouts and formats

image/png

Model Details

  • Base Model: Qwen2 VL
  • Fine-tuning Dataset: Arabic OCR dataset
  • Objective: Extract full-page Arabic text with high accuracy
  • Languages: Arabic
  • Tasks: OCR (Optical Character Recognition)
  • Dataset size: 50,000 records
  • Epochs: 1

Evaluation Metrics

Performance is evaluated using three standard metrics:

  • Word Error Rate (WER): Measures word-level accuracy (lower is better)
  • Character Error Rate (CER): Measures character-level accuracy (lower is better)
  • BLEU Score: Measures overall translation quality (higher is better)

Results

ModelWER ↓CER ↓BLEU ↑
Qari-OCR-0.2.2.1-VL-2B-Instruct0.2210.0590.597
AIN 8B0.7570.3090.103
Qari-OCR-0.1-VL-2B-Instruct1.2940.7700.022
easyOCR1.0040.6480.005
pytesseract0.9900.911<0.001

WER Comparison

CER Comparison

BLEU Score Comparison

Model Details

Training Data

The model was trained using the following specifications:

  • Font Sizes: 14, 16, 18, 20, 24, 32, 40 pt
  • Page Layouts:
    • A4 (210mm × 297mm)
    • Letter (216mm × 279mm)
    • Small (105mm × 148mm)
    • Square (1080px × 1080px)
    • OneLine (210mm × 10mm)
  • Arabic Fonts Used:
    • IBM Plex Sans Arabic
    • KFGQPCUthman Taha Naskh
    • Scheherazade New
    • Amiri
    • Madina
    • Diwani Letter
    • Tajawal
    • Cairo
    • Lateef
    • Almarai
    • AlQalam Quran
    • Noto Naskh Arabic

Limitations

Based on the training specifications, the model has the following limitations:

  1. Font Size Constraints: May have reduced accuracy with very small (< 14pt) or very large (> 40pt) text
  2. Font Coverage: Performance may degrade on uncommon Arabic fonts not represented in the training data
  3. Diacritics Complexity: While the model supports diacritics (tashkeel), extremely dense or unconventional diacritical mark combinations may reduce accuracy
  4. Layout Sensitivity: May have difficulty with complex multi-column layouts or unconventional page formats
  5. Handwriting Recognition: Limited capability with handwritten text as training focused on digital fonts
  6. Decorative Text: May struggle with highly stylized or decorative Arabic calligraphy
  7. Background Complexity: Optimized for clear backgrounds; performance may degrade with complex or textured backgrounds
  8. Text Degradation: May have challenges with severely degraded, blurry, or low-resolution text
  9. Non-standard Orientations: Primarily designed for horizontally oriented text; may struggle with vertical or diagonal text

Evaluation Method

Evaluation was performed on a diverse dataset of Arabic text images, primarily featuring diacritical marks (tashkeel), measuring:

  • Word Error Rate (WER): The percentage of incorrectly recognized words
  • Character Error Rate (CER): The percentage of incorrectly recognized characters
  • BLEU Score: A measure of translation quality, higher scores indicate better overall text recognition

How to Use

Try Qari v0.2.2.1 - Google Colab

You can load this model using the transformers and qwen_vl_utils library:

!pip install transformers qwen_vl_utils accelerate>=0.26.0 PEFT -U
!pip install -U bitsandbytes
from PIL import Image
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
import torch
import os
from qwen_vl_utils import process_vision_info

model_name = "NAMAA-Space/Qari-OCR-0.2.2.1-Arabic-2B-Instruct"
model = Qwen2VLForConditionalGeneration.from_pretrained(
                model_name,
                torch_dtype="auto",
                device_map="auto"
            )
processor = AutoProcessor.from_pretrained(model_name)
max_tokens = 2000

prompt = "Below is the image of one page of a document, as well as some raw textual content that was previously extracted for it. Just return the plain text representation of this document as if you were reading it naturally. Do not hallucinate."
image.save("image.png")

messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "image": f"file://{src}"},
            {"type": "text", "text": prompt},
        ],
    }
]
text = processor.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
    text=[text],
    images=image_inputs,
    videos=video_inputs,
    padding=True,
    return_tensors="pt",
)
inputs = inputs.to("cuda")
generated_ids = model.generate(**inputs, max_new_tokens=max_tokens)
generated_ids_trimmed = [
    out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
    generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)[0]
os.remove(src)
print(output_text)

License

This model follows the licensing terms of the original Qwen2 VL model. Please review the terms before using it commercially.

Citation

If you use this model in your research, please cite:

@article{wasfy2025qari,
  title={QARI-OCR: High-Fidelity Arabic Text Recognition through Multimodal Large Language Model Adaptation},
  author={Wasfy, Ahmed and Nacar, Omer and Elkhateb, Abdelakreem and Reda, Mahmoud and Elshehy, Omar and Ammar, Adel and Boulila, Wadii},
  journal={arXiv preprint arXiv:2506.02295},
  year={2025}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · peft

Нельзя запустить

Репозиторий содержит только адаптер (LoRA/PEFT) без базовой модели.

Ревизия весов
6a3fe1f

0 моделей