/ Модель

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

Лицензия
CC BY 4.0
Библиотека
pytorch
Опубликована
12 сен 2026

azerbaijani-ocr-crnn

Описание изображенийИзображение → текст5 профессий

Компактная CRNN-модель LocalDoc распознаёт обрезанные строки азербайджанского текста на латинице и кириллице.

0скачиваний за 30 дней5лайковвеса обновлены1 окт 2026

Бенчмарки

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

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

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

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

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

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

LocalDoc разработала компактную модель распознавания отдельных строк азербайджанского текста на основе CRNN с CTC-декодированием. Она принимает изображение уже обрезанной строки и выдаёт текст латиницей или кириллицей; для распознавания целых страниц её можно сочетать с детектором строк. Модель содержит 8,5 млн параметров, занимает около 34 МБ и работает на CPU. В README приведены результаты на наборе LocalDoc/azerbaijani-ocr-benchmark: CER 0,0242 и WER 0,0565.

Модель подходит для распознавания строк в сканах книг и документов на азербайджанском языке, в том числе при пакетной обработке страниц через отдельный детектор. Она использует жадное CTC-декодирование без языковой модели; заявлена лицензия CC BY 4.0. Карточка рекомендует учитывать качество исходных сканов и особенности обучающих меток при оценке результатов.

Сценарии применения

  • распознавание строк азербайджанского текста в сканах книг
  • извлечение текста из обрезанных строк документов
  • пакетное распознавание строк страниц PDF вместе с детектором текста
  • оцифровка азербайджанских печатных материалов на латинице и кириллице

Ограничения

Это распознаватель обрезанных строк, а не самостоятельная система OCR страниц; для обработки страниц нужен детектор текста. В README отмечены не проверенные людьми обучающие метки, ограниченность кириллической части данных и зависимость точности от разрешения скана; декодирование не использует языковую модель.

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

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

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

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

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

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

Открыть на Hugging Face

Azerbaijani line recognizer (CRNN + CTC)

Recognises a single cropped line of Azerbaijani text, in Latin or Cyrillic script. 8.5M parameters, 34 MB — it loads in under a second and runs on CPU, which is the point: general vision-language models read this material well but cost seconds per line and gigabytes of memory.

This is a line recogniser, not a page OCR system. Pair it with a text detector (PP-OCRv5 detection works) to process whole pages.

Results on LocalDoc/azerbaijani-ocr-benchmark

metricvalue
CER0.0242
WER0.0565
CER, diacritics only0.0260
CER, Latin0.0267
CER, Cyrillic0.0044

Diacritics CER covers ə ı ğ ş ç ö ü İ and the Cyrillic ә ҝ ҹ ғ ј һ ө ү. For this language it matters more than the overall figure: those letters are a minority of characters and carry most of the meaning that gets lost.

Usage

import torch
from PIL import Image
from huggingface_hub import hf_hub_download
from modeling import load, preprocess, ctc_greedy

path = hf_hub_download("LocalDoc/azerbaijani-ocr-crnn", "model.pt")
model, itos = load(path)

img = Image.open("line.png")     # crop of ONE text line
with torch.no_grad():
    logits = model(preprocess(img))
print(ctc_greedy(logits, itos))

Input is normalised to 48 px height, any width. The backbone divides width by 4, so a 400 px crop yields 100 CTC time steps.

Whole pages and PDFs

pipeline.py in this repo wires the recogniser to a text detector. Detection is language-independent — a general model handles it, and only recognition needs to know Azerbaijani.

pip install paddleocr paddlepaddle pymupdf
from PIL import Image
from pipeline import PageOCR

ocr = PageOCR()

print(ocr.page(Image.open("scan.png")))

for i, text in enumerate(ocr.pdf("book.pdf", pages=range(0, 5),
                                 join_hyphens=True)):
    print(f"--- page {i} ---\n{text}\n")

The pipeline detects line boxes with PP-OCRv5_server_det, pads them vertically without letting a box run into its neighbour, sorts them into reading order, drops vertical text, and recognises in width-sorted batches. join_hyphens=True reattaches words split across lines.

Two settings worth knowing. UNCLIP controls how much the detector inflates each box: raise it if descenders on ç ş ğ come out clipped, lower it if crops start capturing the line above. dpi=300 is a floor — below roughly 150 dpi on the physical page, line height drops under 20 px and the diacritics stop existing as pixels rather than being merely hard to read.

Multi-column pages are not handled: reading order assumes one column, so lines from adjacent columns interleave. Split the page at the gutter first.

Honest limitations

Training labels were not human-verified. They come from OCR text layers already present in the source PDFs, so the model inherited that engine's systematic errors. The single most common residual error is predicting a where the print shows ə — the model learned that from its labels, not from the pixels. Cleaning the labels, rather than changing the architecture, is the next real improvement.

The Cyrillic figure is optimistic. Cyrillic is a small minority of the training corpus, and the Cyrillic side of the benchmark comes from few books. Treat 0.0044 as evidence the model can read those books, not as a general Cyrillic result.

Source resolution sets a floor. Text lines in these scans run about 20 px high. At that scale и/н/п/м differ only in the count of vertical strokes and are genuinely ambiguous — both the reference labels and the model guess. No architecture change reaches past that.

Greedy CTC decoding. No language model. A character n-gram model in a prefix beam search typically cuts CER substantially on low-resource languages and requires no retraining.

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

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

GPU в ailist

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

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

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
d163aae

0 моделей