/ Модель

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

Контекст
4 096 токенов
Лицензия
Apache 2.0
Архитектура
vision-encoder-decoder · dense
Базовая модель
arabic-nougat-base-books-ocr
Библиотека
transformers
Опубликована
19 ноя 2026

arabic-nougat-egyptian-receipts-json

Описание изображенийИзображение → текст4 профессии
81скачиваний за 30 дней0лайковвеса обновлены20 ноя 2026

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

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

Модель распознаёт арабские египетские чеки по изображению и извлекает их содержимое в JSON.

Модель masterofaudio2077/arabic-nougat-egyptian-receipts-json разработана как полноточечное дообучение Arabic Nougat для распознавания египетских чеков. Она принимает изображение чека и формирует JSON с извлечёнными полями продавца, адреса, номера и даты чека, итоговой суммы и позиций с количеством, ценой за единицу и суммой. Значения копируются так, как напечатаны, включая индийские цифры. Архитектура — vision-encoder-decoder, размер — 349 млн параметров; модель обучалась на синтетических чеках с обрезанными верхними и нижними частями.

На синтетическом тесте JSON был валиден в 98,2% случаев, а итоговая сумма распознана точно в 86,2% случаев. Эти результаты не переносятся напрямую на реальные чеки: проверка на одной реальной фотографии выявила пропущенные позиции и суммы, сопоставленные не с теми строками; при отсутствии итоговой суммы на обрезанном изображении модель также могла её выдумать. Модель выпущена под лицензией Apache-2.0.

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

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

Ограничения

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

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

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

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

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

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

Бенчмарки пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь рядом с другими моделями теста

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Распознавание текста» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

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

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

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

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

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

Открыть на Hugging Face

Egyptian receipts to JSON (Arabic Nougat, full fine-tune)

masterofaudio2077/arabic-nougat-base-books-ocr fine-tuned on masterofaudio2077/egyptian-receipts-ocr (CC-BY-4.0) to turn a receipt image into JSON: merchant, merchant_en, address, receipt_no, date, total and items[{name, qty, unit_price, amount}], every value copied as printed (Indic digits stay Indic).

Versions

This card describes version 2 (main). Version 1 is kept on the branch v1-invents-header: VisionEncoderDecoderModel.from_pretrained("masterofaudio2077/arabic-nougat-egyptian-receipts-json", revision="v1-invents-header").

Version 1 was trained for 1,356 steps on complete receipts only. On the one real photo tried (a close-up of a bill with no header) it invented a merchant and an address, repeated the address key three times, returned 2 of 5 items and gave a total of 366.45 for a printed 296.46. Cutting lines off that photo showed the cause: the merchant it returned was always the first printed line, because every training receipt had a header.

Version 2 trains for 2000 steps and cuts the header and/or footer off 40% of the training receipts at random, rewriting the target to the fields still visible. Its "json valid" is stricter (a repeated key is invalid), so it is not directly comparable with the 97.5% of version 1.

Real-photo check (one REAL photo, not synthetic)

Every number further down this card is measured on synthetic receipts. This is the one real photo tried so far: a close-up of a restaurant bill (items and totals only, no header). It is a single image, so it shows what happens on one real receipt; it is not a measurement.

real receipt

Version 2 (this version), output as generated (greedy decoding, fp32 on CPU):

{"total":"296.46","items":[{"name":"بطاطس محمرة","qty":"1","amount":"57.8"},{"name":"كوفير","qty":"2","amount":"67.5"}]}

Against what the photo prints (read by hand) and against version 1 (branch v1-invents-header):

fieldprintedversion 1version 2
merchantnot in the photoأرز البضرة (invented)absent
addressnot in the photoinvented, key repeated 3 timesabsent
total296.46366.45296.46
items returned522
أرز أبيض, qty 1, 51.7missingmissing
ملوخية سادة, qty 1, 57.8missingmissing
بامية سادة, qty 1, 67.5missingmissing
بطاطس محمرة, qty 1, 47.3بطاطس معمرة, 1, 47.3بطاطس محمرة, 1, 57.8 (name right, amount wrong)
كوفير, qty 2, 0.00كوفير-بيت, 2, 0.00كوفير, 2, 67.5 (name right, amount wrong)

Fixed: the invented merchant and address. Version 2 returned neither in any of 4 runs on this photo (the full photo and 3 crops with the top lines cut off). Version 1 turned the first printed line into the merchant every time. The total on the full photo is exact.

Not fixed: the items. Three of five are missing, and the two it returned carry amounts that belong to other rows (57.8 is the amount of ملوخية سادة, 67.5 the amount of بامية سادة). With the top lines cut off, the totals came back as 295.46 and 296.45, one digit off. On a crop that shows no total at all, it returned 67.3 as the total, which is invented. Item names are spelled better than in version 1, but the numbers are attached to the wrong rows. Do not rely on item amounts from real photos without checking them.

The synthetic results below do not predict this: this bill uses a POS bitmap font, -.- marks after the names and English Total / Discount / Service / Tax labels, none of which the synthetic data has.

Results on SYNTHETIC test receipts (greedy decoding)

test rowsnjson validnumbers exactitem-name CERpage CERtotal exactdate exactreceipt_no exactmerchant inventedaddress invented
all43398.2%87.0%0.3670.09686.2%78.0%74.8%0.0%n/a
legible (>= 8 px)40998.8%89.7%0.2840.07289.6%81.4%78.2%0.0%n/a
cut: header/footer removed16098.1%85.0%0.4290.13287.5%73.9%69.2%1.6%1.0%

json valid: parses, has an items list and repeats no key. invented: on receipts whose target has no merchant (or address), the share of outputs that have one anyway; only the cut rows can show it.

All training and test data is synthetic and unverified (annotation_source: synthetic_exact). There are no real photos in the test set above.

Examples from the SYNTHETIC test set (the first 3 test receipts, then the first 2 cut ones; none selected)

clothing-0000044: valid JSON, page CER 0.015

receipt

Target

{"merchant":"محل شريف","address":"سوق العبور التجاري، حي شرق شبرا الخيمة، القليوبية","receipt_no":"426/41259","date":"2025-01-17","total":"810","items":[{"name":"طقم داخلي حريمي كود ST-900 مقاس XL","qty":"1","unit_price":"680","amount":"680"},{"name":"بوكسر رجالي كود BX-12 مقاس L","qty":"2","unit_price":"65","amount":"130"}]}

Model output

{"merchant":"محل شريف","address":"سوق العبور التجاري، حي شرق شبرا الخيمة، القليوبية","receipt_no":"426/41259","date":"2025-01-17","total":"816","items":[{"name":"طقم داخلي حريمي كود B-900 مقاس XL","qty":"1","unit_price":"680","amount":"680"},{"name":"بوكسر رجالي كود M-12 مقاس L","qty":"2","unit_price":"65","amount":"130"}]}

clothing-0000175: valid JSON, page CER 0.027

receipt

Target

{"merchant":"أزياء باب الشعرية","merchant_en":"Bab El Shaaria Menswear","address":"شارع الجيش، بجوار مسجد الشعراني، باب الشعرية، القاهرة","receipt_no":"213/12076","date":"17.12.2024","total":"1949.40","items":[{"name":"جاكيت جلد رجالي مستورد","qty":"1","unit_price":"1250.00","amount":"1250.00"},{"name":"تيش رجالي قطن L","qty":"2","unit_price":"85.00","amount":"170.00"},{"name":"شراب رجالي 3 قطع","qty":"1","unit_price":"35.00","amount":"35.00"},{"name":"كاب رجالي","qty":"1","unit_price":"55.00","amount":"55.00"},{"name":"بوك رجالي جلد","qty":"1","unit_price":"90.00","amount":"90.00"},{"name":"حزام رجالي 120سم","qty":"1","unit_price":"110.00","amount":"110.00"}]}

Model output

{"merchant":"أزياء باب الشعرية","merchant_en":"El Baraka El Eman Heirs","address":"شارع الجيش، بجوار مسجد الشعراني، باب الشعرية، القاهرة","receipt_no":"213/12076","date":"17.12.2024","total":"1949.40","items":[{"name":"جاكيت جلد رجالي مستورد","qty":"1","unit_price":"1250.00","amount":"1250.00"},{"name":"تيش رجالي قطن L","qty":"2","unit_price":"85.00","amount":"170.00"},{"name":"شراب رجالي 3 قطع","qty":"1","unit_price":"35.00","amount":"35.00"},{"name":"كاب رجالي","qty":"1","unit_price":"55.00","amount":"55.00"},{"name":"بوك رجالي جلد","qty":"1","unit_price":"90.00","amount":"90.00"},{"name":"حزام رجالي 120سم","qty":"1","unit_price":"110.00","amount":"110.00"}]}

clothing-0000203: valid JSON, page CER 0.009

receipt

Target

{"merchant":"ستايل بوينت","address":"شارع المحكمة، بجوار موقف الأتوبيس، كفر الدوار، البحيرة","receipt_no":"8134947","date":"22/05/2025","total":"232.56","items":[{"name":"بوكسر رجالي قطن أبيض مقاس XL ماركة محلية","qty":"1","unit_price":"95","amount":"95"},{"name":"فانلة حريمي حمالات قطن مقاس L لون بيج","qty":"1","unit_price":"85","amount":"85"},{"name":"شراب رجالي قطن أسود مقاس 41-44","qty":"2","unit_price":"30","amount":"60"}]}

Model output

{"merchant":"ستايل بوينت","address":"شارع المحكمة، بجوار مؤقف الأتوبيس، كفر الدوار، البحيرة","receipt_no":"8134947","date":"22/05/2025","total":"232.56","items":[{"name":"بوكسر رجالي قطن أبيض مقاس XL ماركة محلية","qty":"1","unit_price":"95","amount":"95"},{"name":"فانلة حريمي حمالات قطن مقاس 1 لون بيج","qty":"1","unit_price":"85","amount":"85"},{"name":"شراب رجالي قطن أسود مقاس 44-41","qty":"2","unit_price":"30","amount":"60"}]}

clothing-0000044 (header/footer cut off): valid JSON, page CER 0.016

receipt

Target

{"receipt_no":"426/41259","date":"2025-01-17","total":"810","items":[{"name":"طقم داخلي حريمي كود ST-900 مقاس XL","qty":"1","unit_price":"680","amount":"680"},{"name":"بوكسر رجالي كود BX-12 مقاس L","qty":"2","unit_price":"65","amount":"130"}]}

Model output

{"receipt_no":"426/41259","date":"2025-01-17","total":"810","items":[{"name":"طقم داخلي حريمي كود B-900 مقاس XL","qty":"1","unit_price":"680","amount":"680"},{"name":"بوكسر رجالي كود M-12 مقاس L","qty":"2","unit_price":"65","amount":"130"}]}

clothing-0000175 (header/footer cut off): valid JSON, page CER 0.031

receipt

Target

{"merchant":"أزياء باب الشعرية","merchant_en":"Bab El Shaaria Menswear","address":"شارع الجيش، بجوار مسجد الشعراني، باب الشعرية، القاهرة","receipt_no":"213/12076","date":"17.12.2024","total":"1949.40","items":[{"name":"جاكيت جلد رجالي مستورد","qty":"1","unit_price":"1250.00","amount":"1250.00"},{"name":"تيش رجالي قطن L","qty":"2","unit_price":"85.00","amount":"170.00"},{"name":"شراب رجالي 3 قطع","qty":"1","unit_price":"35.00","amount":"35.00"},{"name":"كاب رجالي","qty":"1","unit_price":"55.00","amount":"55.00"},{"name":"بوك رجالي جلد","qty":"1","unit_price":"90.00","amount":"90.00"},{"name":"حزام رجالي 120سم","qty":"1","unit_price":"110.00","amount":"110.00"}]}

Model output

{"merchant":"أزياء باب الشعرية","merchant_en":"El Hagg Ragabry & Retail","address":"شارع الجيش، بجوار مسجد الشعراني، باب الشعرية، القاهرة","receipt_no":"213/12076","date":"17.12.2024","total":"1949.40","items":[{"name":"جاكيت جلد رجالي مستورد","qty":"1","unit_price":"1250.00","amount":"1250.00"},{"name":"تيش رجالي قطن L","qty":"2","unit_price":"85.00","amount":"170.00"},{"name":"شراب رجالي 3 قطع","qty":"1","unit_price":"35.00","amount":"35.00"},{"name":"كاب رجالي","qty":"1","unit_price":"55.00","amount":"55.00"},{"name":"بوك رجالي جلد","qty":"1","unit_price":"90.00","amount":"90.00"},{"name":"حزام رجالي 120سم","qty":"1","unit_price":"110.00","amount":"110.00"}]}

Training

All 349M parameters trained with Seq2SeqTrainer, 2000 steps, effective batch 16, Lion (bitsandbytes lion_32bit) lr 1.5e-05, weight decay 0.1. Mixed FP8 through Accelerate (torchao Float8Linear Linear layers over fp32 master weights with bf16 autocast), one NVIDIA L4. Training receipts with a median text-line height under 8 px at 896x672 were dropped. 40% of the training receipts were cut at random (header and/or footer removed, target reduced to the fields still visible) so the model does not invent fields that are not printed.

Use

import torch
from PIL import Image
from transformers import NougatProcessor, VisionEncoderDecoderModel

processor = NougatProcessor.from_pretrained("masterofaudio2077/arabic-nougat-egyptian-receipts-json")
model = VisionEncoderDecoderModel.from_pretrained("masterofaudio2077/arabic-nougat-egyptian-receipts-json", dtype=torch.float16).to("cuda").eval()
pv = processor(images=Image.open("receipt.jpg").convert("RGB"), return_tensors="pt").pixel_values.to("cuda", torch.float16)
out = model.generate(pixel_values=pv, max_new_tokens=1152)
print(processor.tokenizer.batch_decode(out, skip_special_tokens=True)[0])

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Класс архитектуры
VisionEncoderDecoderModel
Ревизия весов
bae3bd0

0 моделей