/ Модель

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

Контекст
40 960 токенов
Параметры
508 млн
Лицензия
Apache 2.0
Архитектура
qwen3 · dense
Базовая модель
Qwen3-0.6B
Библиотека
transformers
Опубликована
2 ноя 2026

receipt-extractor-qwen3-0.6b

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

Дообученная компактная Qwen3 преобразует OCR-текст чеков в JSON с позициями, налогами, скидками и итоговой суммой для приложений разделения счёта.

370скачиваний за 30 дней0лайковвеса обновлены2 ноя 2026

Бенчмарки

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

Тесты пользователейпока нет

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

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

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

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

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

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

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

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

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

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

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

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

Ajay0007/receipt-extractor-qwen3-0.6b — компактная модель генерации текста, разработанная для извлечения позиций и сумм из распознанного OCR-текста чеков. Она полностью дообучена на базе Qwen/Qwen3-0.6B и содержит около 507,9 млн параметров. Модель принимает текст чека, где каждая визуальная строка представлена отдельной строкой, и возвращает структурированный JSON с товарами, количеством и ценой, подытогом, налогом, сервисным сбором или чаевыми, скидкой и общей суммой.

Модель предназначена для мобильных приложений, которые разбивают счёт по позициям: OCR выполняется отдельным компонентом, а модель преобразует распознанные строки в данные для проверки и интерфейса разделения расходов. В репозитории также есть сборка int8 для LiteRT-LM, рассчитанная на запуск на устройстве; заявленная скорость ориентировочная, полного бенчмарка задержки нет. Обучение использовало чеки на индонезийском и английском языках, а также преимущественно англоязычные данные с частью чеков на немецком и французском. Контекст модели — 40 960 токенов.

На тесте CORD-v2 доля чеков, готовых к разделению без правок, составила 75,5%, а на реальных фотографиях WildReceipt — 37,3%; на последнем наборе общая сумма была извлечена верно в 91,2% случаев. Качество зависит от OCR и расположения текста: модель может пропускать незнакомые обозначения итогов и неверно сопоставлять названия товаров с ценами, если они оказались на разных строках. Кириллические и другие не обучавшиеся нелатинские письменности поддерживаются слабо; чеки, написанные от руки, счета-фактуры и многостраничные документы не входят в целевой сценарий. Лицензия — Apache-2.0.

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

  • извлечение позиций и цен из OCR-текста чека
  • подготовка чека к разделению расходов по товарам
  • извлечение налога, сервисного сбора, скидки и общей суммы
  • преобразование распознанных строк чека в структурированный JSON

Ограничения

Точность зависит от качества OCR и разметки строк; модель слабо работает с незнакомыми обозначениями итогов и кириллицей, а также может неверно сопоставлять позиции с ценами. Результаты требуют проверки и не предназначены для бухгалтерских или налоговых расчётов без контроля.

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

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

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

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

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

Открыть на Hugging Face

receipt-extractor-qwen3-0.6b

Turn a receipt into structured JSON on the phone. This small model reads the OCR text of a receipt photo and returns line items, subtotal, tax, service charge/tip, discount and total as JSON. Built for an on-device, Splitwise-style "snap the bill and split it by item" app.

  • Base model: Qwen/Qwen3-0.6B (596M parameters), fully fine-tuned
  • Input: OCR text of a receipt (one visual line per row), from Google ML Kit (Android), Apple Vision (iOS), PaddleOCR, etc.
  • Output: compact JSON: {"items":[{"name","qty","price"}], "subtotal", "tax", "service", "discount", "total"}
  • On-device: includes model.litertlm (int8, 613 MB) for Google's LiteRT-LM runtime (Android, iOS, desktop)
  • Speed: ~1.5–3 s per receipt expected on-device (int8). The LiteRT build was verified to produce correct output, but a full latency benchmark was not completed. Please benchmark on your target devices.

How it fits in an app

photo ──► on-device OCR (ML Kit / Apple Vision, ~0.3 s) ──► this model (~1 s) ──► JSON ──► sum check ──► split UI
                                                                                   └─ fails → ask the user to review

The sum check (do item prices + tax + service − discount equal the total?) is a strong confidence signal: in our tests, receipts that pass it were fully correct ~89% of the time, versus ~25% for receipts that fail it. receipt_utils.sum_check() in this repo implements it.

Quick start (Python / transformers)

from transformers import AutoModelForCausalLM, AutoTokenizer
from huggingface_hub import hf_hub_download
import importlib.util, sys

repo = "Ajay0007/receipt-extractor-qwen3-0.6b"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)

# helper functions shipped with the model (prompt, OCR line grouping, JSON parsing, sum check)
spec = importlib.util.spec_from_file_location("receipt_utils", hf_hub_download(repo, "receipt_utils.py"))
ru = importlib.util.module_from_spec(spec); spec.loader.exec_module(ru)

ocr_text = """1 EGG TART 13,000
2 CHOCO CUSTARD PASTRY 24,000
REDBEAN BREAD 9,000
TOTAL 46,000
CASH 50,000
CHANGE 4,000"""

messages = [{"role": "user", "content": ru.build_prompt(ocr_text)}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_dict=True,
                                 return_tensors="pt",
                                 enable_thinking=False)
out = model.generate(**inputs, max_new_tokens=768, do_sample=False)
receipt = ru.parse_output(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
print(receipt)
print("sum check passed:", ru.sum_check(receipt))

Output for the example above:

{"items": [{"name": "EGG TART", "qty": "1", "price": "13,000"}, {"name": "CHOCO CUSTARD PASTRY", "qty": "2", "price": "24,000"}, {"name": "REDBEAN BREAD", "qty": "1", "price": "9,000"}], "total": "46,000"}

Use the prompt exactly as build_prompt writes it. The model was trained on that wording. Use greedy decoding (do_sample=False). For Qwen3, keep enable_thinking=False (the model was trained without a thinking block).

Getting OCR text in the right format

The model expects one visual receipt line per row, with the tokens on a line ordered left to right (so an item name and its price sit on the same row). Raw OCR engines return boxes, not lines. Use receipt_utils.ocr_boxes_to_text([(x_min, y_min, y_max, text), ...]), which is the same grouping used to build the training data. Port this ~20-line function to Kotlin/Swift for your app.

On-device: LiteRT-LM (Android / iOS)

model.litertlm is an int8 build (weights int8, activations fp32) made with litert-torch (dynamic_wi8_afp32, prefill 256, KV cache 1024 tokens). This build was verified to produce correct JSON in the LiteRT-LM runtime (4/5 smoke-test receipts fully correct); a full accuracy/latency benchmark of the int8 build was not completed.

import litert_lm                                 # pip install litert-lm-api
from huggingface_hub import hf_hub_download
path = hf_hub_download("Ajay0007/receipt-extractor-qwen3-0.6b", "model.litertlm")
engine = litert_lm.Engine(path, backend=litert_lm.Backend.CPU(thread_count=4), max_num_tokens=2048)
conv = engine.create_conversation(sampler_config=litert_lm.SamplerConfig(top_k=1, temperature=0.0),
                                  max_output_tokens=768,
                                  chat_template=open(hf_hub_download("Ajay0007/receipt-extractor-qwen3-0.6b", "litert_chat_template.jinja")).read())
reply = conv.send_message(ru.build_prompt(ocr_text))
print(reply["content"] if isinstance(reply, dict) else reply)

For apps, load the same file with the LiteRT-LM Kotlin API (Android, stable) or Swift API (iOS), or use the Google AI Edge Gallery app to try it on a phone and see its speed.

Important for Qwen3: pass the included litert_chat_template.jinja as the conversation's chat template (as above). The template bundled by the converter adds a system prompt that makes the model ignore the task.

Training data

DatasetReceipts usedRegion / languageLabels used
CORD-v2 (CC-BY-4.0), train split800Indonesia (Indonesian/English, IDR)items, priced add-ons, subtotal, tax, service, discount, total
WildReceipt, train split1,013mostly US/EU photos (English, some German/French)items, subtotal, tax, tip→service, total
Total1,813

Inputs were produced by running RapidOCR (PP-OCR) on the images, so the model learned from realistic, noisy OCR, not clean ground-truth text. CORD labels were corrected: priced add-ons stored as sub-items in CORD (e.g. "Extra Jelly 5,000") were restored, and a few annotation errors fixed. Store names, addresses, dates and payment lines (cash, change, card) are deliberately not extracted.

Training procedure

Full fine-tune (all weights) with plain supervised next-token loss on the assistant JSON only (prompt tokens masked).

SettingValue
Epochs5
Learning rate / schedule5e-5, cosine, 5% warmup
Batch size8
Max sequence length2,048 tokens
Precisionbf16, gradient checkpointing
Hardware / time1× NVIDIA A40, ~17 min
Target formatcompact JSON, null fields dropped (shorter output = faster on device)

We also tested LoRA (r=16, all linear layers, lr 2e-4): it matched the full fine-tune on CORD (70% vs 72% split-ready) and is a good option if you want small swappable adapters.

Evaluation

All numbers use OCR from RapidOCR, greedy decoding and the bf16 weights unless noted. Split-ready = every line item (name + price) and the total are exactly right, so the bill can be split with no edits. Item F1 = item matched on name (fuzzy ≥ 80) and exact price. Amounts are compared by value (60.000 = 60,000, 525 = 525.00).

This model

Test setItem F1Total correctSplit-ready
CORD-v2 test+val, corrected labels (200, Indonesia)85.9%94.3%75.5%
WildReceipt test (472, US/EU photos)59.9%91.2%37.3%
SROIE test (347, Malaysia, total only) — unseen dataset–86.2%–
Real-world photos, Latin script (30, Wikimedia Commons, hand-verified) — unseen47.9%56.7%36.7%
Real-world photos, CJK/Thai/Cyrillic (33, VLM-labeled) — unseen35.7%75.8%21.2%

Compared with other small models (same pipeline, same test sets)

ModelTrained onCORD split / totalWildReceipt split / totalSROIE totalPhotos split / totalSize
Donut-base CORD-v2 (public, image→JSON)CORD82 / 981 / 54310 / 13~200M params
Gemma 3 270MCORD64 / 934 / 48330 / 20~290 MB
LFM2.5-350MCORD73 / 942 / 40190 / 13364 MB
Qwen3-0.6BCORD76 / 9310 / 64493 / 47614 MB
LFM2-VL-450M (image→JSON)CORD74 / 923 / 52437 / 47~450M params
LFM2.5-350M — oursCORD-fixed + WildReceipt78 / 9631 / 888513 / 50364 MB
Qwen3-0.6B — oursCORD-fixed + WildReceipt76 / 9437 / 918637 / 57614 MB
LFM2-350M-Extract, zero-shot—2 / 342 / 1626– / –364 MB

Key takeaways:

  • Models trained only on CORD don't generalize. Every CORD-only model, including the public Donut-CORD, gets ≤10% split-ready on US/EU receipts. Adding WildReceipt raised WildReceipt totals from ~40–65% to ~90%, and SROIE (never seen in training) from ~20–50% to ~85%.
  • The int8 LiteRT build was evaluated separately; see the on-device section.
  • Seed-to-seed variation is about ±1–3 points; the 30-photo set has about ±9 points of noise.

Limitations

  • Real-world photos are still hard. On real phone photos, about 1 in 3 come out fully split-ready and about 1 in 2 have the right total. Typical failures:
    • totals labeled with keywords unseen in training ("Celkem", "SUMA PLN", "NET A PAYER") get omitted;
    • the OCR misses or garbles the total (OCR quality caps accuracy, and the model copies OCR errors);
    • item names and prices on separate lines of tall receipts get mis-paired.
  • Non-Latin scripts (Japanese, Chinese, Thai, Cyrillic) were not in the training data: totals are often right, but items rarely are.
  • Amounts are copied as printed (strings with the receipt's own separators and currency marks). Normalize them in the app (receipt_utils.to_number).
  • Handwritten bills, invoices and multi-page documents are out of scope.
  • Do not use the output for accounting or tax purposes without review.

Improve it for your users: fine-tune further on a few hundred labeled receipts from your target countries. In our experiments, adding diverse data mattered far more than model size.

License

Apache-2.0 (same as the base model). Fine-tuning data: CORD-v2 (CC-BY-4.0) and WildReceipt. This repository contains modified weights (fine-tuned) of Qwen/Qwen3-0.6B.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей