/ Модель

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

Лицензия
CC BY-SA 4.0
Базовая модель
folio-finnish-newspaper-ocr
Опубликована
30 ноя 2026

folio-swedish-newspaper-ocr

Описание изображенийИзображение → текст
133скачиваний за 30 дней0лайковвеса обновлены2 дек 2026

Описание модели

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

Компактная OCR-модель для транскрибирования строк исторических шведских газет XIX века с сохранением оригинальной орфографии.

Folio Swedish Newspaper OCR — компактная модель foliokestrel для распознавания печатных строк на изображениях шведских газет XIX века. Она содержит 1,31 млн параметров, работает на CPU и сохраняет историческое написание, включая длинную s (ſ), диакритические знаки и пунктуацию. Модель принимает обрезки строк; комплект для чтения страниц также находит строки по размеченным прямоугольникам и формирует транскрипцию. Доступны веса в форматах ONNX и safetensors.

На тесте из 2 888 строк семи газет CER составил 4,33%; результаты заметно различались между изданиями. Модель также поддерживает отдельный режим для прямоугольников строк на исходных сканах и компактный вариант для CPU и WebAssembly. Для новых газет, сложного орнаментального шрифта, коротких фрагментов и качества разметки страницы точность может отличаться. Модель дообучена на базе Folio Finnish Newspaper OCR; лицензия — CC BY-SA 4.0.

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

  • распознавание строк Fraktur на сканах шведских газет
  • транскрибирование газетных вырезок с длинной s и исторической пунктуацией
  • извлечение текста из размеченных прямоугольников строк на газетной странице
  • создание поискового PDF из сканов старых шведских газет

Ограничения

Точность зависит от издания: на семи тестовых газетах CER варьировался от 1,63% до 15,53%. Результаты относятся к непустым строкам с известными границами; орнаментальный шрифт, незнакомые издания, короткие фрагменты и ошибки разметки страницы могут ухудшить качество.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

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

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

Открыть на Hugging Face

Folio Swedish Newspaper OCR

Transcribe a line of nineteenth-century Swedish newspaper print on a CPU. The 1.31-million-parameter reader aims to preserve diplomatic spelling, including long s (ſ), accents and punctuation. It also reads the verified rectangles on 101 original newspaper scans from Kungliga biblioteket.

To read a full page, install the FP32 page-crop reader and its Swedish language data together. The command finds the lines and prints their transcriptions.

python -m pip install https://huggingface.co/foliokestrel/folio-swedish-newspaper-ocr/resolve/main/python/folio_swedish_newspaper_ocr-0.2.0-py3-none-any.whl
folio-swedish-ocr page newspaper.jpg

For a cropped line that slopes across the scan, try folio-swedish-ocr line --straighten line.png. On registered early newspaper rectangles it reduced character errors from 4.91% to 3.01%. The later sample went from 8.85% to 8.97%. Try a real crop and compare results

Run folio-swedish-ocr example to try the included historical crop. Line images, multipage TIFF, JSON output and source package

On 2,888 line crops from seven held-out newspaper titles, the Swedish reader made 7,185 edits in 165,877 reference characters (4.33% CER). Swedish Fraktur Kraken made 14,729 edits (8.88%) on the same crops. The Swedish reader’s CER ranged from 1.63% to 15.53% across the seven titles. Per-title and per-page results

A 1.33 MB download is also available for CPU and WebAssembly inference. It made 9.63% character errors on 624 later newspaper lines and 4.35% on the original seven-title test, compared with 9.68% and 4.33% for the 5.26 MB model. Run the compact model and inspect changed readings

For lines cropped directly from newspaper scans, the optional page-crops reader reduced character error from 5.54% to 4.91% on 2,888 verified rectangles. It improved on each of the seven held-out titles. With the same Tesseract line detections on 22 pages, known-line character error fell from 7.95% to 7.18%, counting missed lines as deletions. To try it, run python folio_fraktur.py --model-dir page-crops page-crops/examples/line.png. Page-crop reader, full-page command and later-newspaper results

The optional CPU model used 24.6% and 24.5% less time than FP32 to transcribe 192 cropped lines in two single-thread CPU runs. Including page layout and the rest of the full-page command, the six-scan comparison saved 4.6% of elapsed time. The graph occupies 2.05 MB. The FP32 graph occupies 5.26 MB. Run the CPU comparison on your own lines

You can also make a searchable PDF from your own newspaper JPEGs, PNGs or multipage TIFFs. The scanned pages stay visible and the text can be searched and copied. Offline command and two-page example

Read one line

Download the repository once with hf download foliokestrel/folio-swedish-newspaper-ocr --local-dir swedish-reader. Run these commands in that directory with Python 3.10 or newer.

python -m pip install -r requirements.txt
python folio_fraktur.py examples/line.png

Swedish newspaper line used in the example

The released model reads this validation example as “ffn fullſtändigt inredd byggnad, innehål=”. The original reference, source page and row number accompany the image. Example provenance

To read your own line, pass a cropped PNG or JPEG. Multiple paths are accepted in one command. In Python, load the reader once and reuse it.

from PIL import Image
from folio_fraktur import FrakturReader

reader = FrakturReader(".", threads=2)
with Image.open("line.png") as line:
    print(reader(line))

Read an original newspaper page

For an entire newspaper scan, you can review the least certain lines and merge your edits into the full page transcript. Try the seven-line example or prepare your own scan

Download a JPEG from the Swedish Newspaper Lines browser. The reader identifies it by SHA-256 digest and automatically locates every verified rectangle on that page. Output records preserve the source row index, page ID and box alongside the prediction. Use a new output filename. Swedish Newspaper Lines

python read_page_lines.py original.jpg predictions.jsonl

To include upstream reference text or read a subset, pass a JSONL exported by the browser or the provenance dataset. The reader verifies each row and rectangle against the original scan. The single-line command above also works with material outside this collection. Swedish Fraktur line provenance

python read_page_lines.py original.jpg compared.jsonl --lines page-lines.jsonl

On the same 2,888 test locations, reading rectangles directly from the original JPEGs produced 9,188 edits (5.54% CER) and 869 exact lines. The original Riksarkivet line crops mask background and neighboring print. Both measurements start with known locations. Page-box results

Held-out line recognition

Seven publications contributed 22 test pages containing 26,228 reference words. All four recognizers received the same grayscale Riksarkivet crops. CER and WER are total character and word edits divided by the respective reference totals. Mean title CER weights each title equally.

RecognizerCharacter editsCERWERExact linesMean title CER
Folio Swedish newspaper7,1854.33%18.96%9625.36%
Swedish Fraktur Kraken14,7298.88%29.37%44711.62%
Folio Finnish newspaper22,75313.72%51.10%8714.87%
Mannheim frak2021 RAW_LINE25,76315.53%49.12%12017.33%
NewspaperLinesFolio Swedish CERSwedish Kraken CER
Carlscronas Wekoblad3682.77%5.91%
Dagligt Allehanda4451.63%3.17%
Gefleborgs Läns Tidning21915.53%42.47%
Götheborgs Allehanda2234.01%6.13%
Hvad Nytt2534.55%5.94%
Najaden6932.21%5.82%
Stockholms Dagblad6876.79%11.89%

The Swedish reader trained on other titles in this newspaper collection. The Kraken model’s published Swedish training corpus covers earlier print from 1626–1816. A prior pilot sampled 384 rows from this same newspaper collection. Those rows and their image duplicates were excluded from adaptation and test folds. Titles and pages in the pilot can also occur in the new folds. These scores describe registered, nonblank lines from this collection. Ornate type, unfamiliar publications, short fragments and page layout can produce different results. Comparison protocol and replay commands · Swedish Kraken model

Training and availability

Folio Kestrel initialized the Swedish reader from the Finnish newspaper model, extended its character alphabet using Swedish training labels, and fine-tuned for 24 epochs. Validation used six titles entirely separate from the 26 training titles and the seven test titles. Epoch 11 had the lowest mean validation title CER (1.72%). The CPU ONNX export agreed with PyTorch on 5,635 of 5,639 validation transcriptions. All test numbers above use CPU inference. Training instructions and folds · CPU export comparison

The repository contains ONNX for inference, safetensors weights for training, and the data preparation, scoring and replay scripts. The weights use CC BY-SA 4.0, evaluation data and the bundled scan crop use CC BY 4.0, and the code uses Apache-2.0. Source credits and licenses

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

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

GPU в ailist

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

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

Не удалось определить, чем загружать веса модели (нет library_name и architectures).

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

0 моделей