/ Модель

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

Контекст
512 токенов
Архитектура
distilbert · dense
Базовая модель
distilbert-base-multilingual-cased
Библиотека
transformers
Опубликована
9 окт 2026

DistilmBERT-CompanyDocs-v2

Классификация текстаТекст → label6 профессий

Дообученная многоязычная DistilBERT классифицирует извлечённый текст деловых документов по типу на английском и французском языках.

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

Бенчмарки

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

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

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

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

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

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

CompanyDocs DistilmBERT v2 — модель Ayoub Cherguelaine (AyoubChLin), дообученная на многоязычной DistilBERT с классификационной головой для определения типа делового документа по извлечённому тексту. Она предназначена для маршрутизации документов, индексирования и выбора последующего сценария извлечения данных; среди классов — счета, заказы на закупку, коммерческие предложения, чеки и отгрузочные документы. Модель принимает текст, а не PDF или изображение, и обучена распознавать документы на английском и французском языках. Контекст ограничен 512 токенами, текст обрезается с конца.

В сохранённых результатах обучения указаны точность и macro-F1 100% на тестовом наборе для обоих языков, однако это результаты конкретного набора данных, а не независимая оценка загруженного чекпойнта или гарантия качества на реальных документах. Возможны ошибки из-за OCR, отсутствующих заголовков, новых шаблонов и сведений, расположенных после первых 512 токенов; неизвестные типы документов принудительно относятся к одному из известных классов. Лицензия в предоставленных данных не указана.

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

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

Ограничения

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

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

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

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

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

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

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

Открыть на Hugging Face

CompanyDocs DistilmBERT v2

Classify business documents from their extracted text. CompanyDocs DistilmBERT v2 is a fine-tuned multilingual DistilBERT model for identifying document types such as invoices, purchase orders, quotes, receipts, and shipping orders.

It was trained on CompanyDocuments v2, using the dataset's file_content field as input and document_type as the target. The uploaded training notebook reports 100.00% test accuracy, 100.00% macro-F1, and approximately 135.3 million parameters.

The training data includes English and French documents. The recorded run reports perfect test scores in both languages. These results describe this benchmark and do not establish perfect performance on real-world documents.

Model details

PropertyValue
AuthorAyoub Cherguelaine (AyoubChLin)
Base checkpointdistilbert/distilbert-base-multilingual-cased
Architecturemultilingual DistilBERT with a sequence classification head
TaskSingle-label document type classification
InputExtracted document text
OutputA document type label and model score
Maximum input length512 tokens, including special tokens
ParametersApproximately 135.3M
Training frameworkPyTorch and Hugging Face Transformers Trainer

Dataset and training relationship

Training dataset: AyoubChLin/Company-document-dataset-v2, configuration all.

The training pipeline reads three fields:

  • file_content: text extracted from the document.
  • document_type: the classification target.
  • locale: used for language-specific evaluation, rather than as a model input.

Empty texts are removed. Documents are tokenized with truncation at 512 tokens, preserving the beginning of each document. Batches use dynamic padding. The classifier does not consume embedded PDFs, document images, bounding boxes, or structured extraction annotations.

The recorded run contains these split sizes:

SplitDocumentsEnglishFrench
Train259,497163,99495,503
Validation47,11430,16716,947
Test46,9699,49637,473

The notebook describes the dataset splits as grouped by issuing company, with unseen issuers in validation and test. This grouping is a property of the dataset's provided splits; the notebook does not independently audit it. Its saved output reports no classes missing from training, so no class redistribution occurred in that recorded run.

Document types

The notebook's saved training output lists 13 labels:

ID in the recorded runLabel
0account_statement
1credit_note
2employment_certificate
3goods_received_note
4inventory_report
5invoice
6packing_slip
7payslip
8purchase_order
9quote
10receipt
11shipping_order
12work_order

Checkpoint verification: the notebook's current source also contains an unexecuted rare-class filter that would remove four of these labels. Its saved outputs still show 13 labels and the full split sizes. This card documents those recorded outputs. For the downloaded checkpoint, treat model.config.id2label as authoritative; verify it against this table before publishing the card as checkpoint-verified documentation.

Evaluation

Results below come from the multilingual DistilBERT entry in the uploaded notebook's saved outputs. They are not a new evaluation of the hosted checkpoint.

Test metricResult
Accuracy100.00%
Macro-F1100.00%
Weighted-F1100.00%
Macro precision100.00%
Macro recall100.00%
English accuracy100.00%
French accuracy100.00%

The test set contains substantially more French documents than English documents. Macro-F1 gives each class equal weight and is useful here because the class distribution is highly uneven: the recorded test set includes 6,807 purchase orders but only 10 inventory reports. Perfect scores on this dataset warrant further testing on independent documents, noisy OCR, and examples without explicit document titles. No independent leakage or duplicate audit was supplied.

The notebook also reports a training time of approximately 7.4 minutes, peak allocated GPU memory of 15.7 GB, and approximately 2,288.9 test documents/second. These measurements belong to that notebook run, configured for a single A100 80 GB GPU. Throughput was measured using batched Trainer.predict; it is not a guarantee of service latency or CPU performance.

Training configuration

The notebook source specifies the following configuration:

SettingValue
Epochs1
Learning rate3e-5
Training batch size128
Evaluation batch size256
Gradient accumulation steps1
Optimizer on CUDAFused AdamW (adamw_torch_fused)
Weight decay0.01
Learning rate scheduleLinear
Warmup10% of configured training steps
Random seed42
Checkpoint selectionBest validation macro-F1
PrecisionBF16 when supported on CUDA; otherwise FP16 on CUDA

Exact package versions, dataset commit, and hosted checkpoint commit were not recorded in the information used to prepare this card.

Quick start

pip install torch transformers
import torch
from transformers import pipeline

# Current repository ID. After renaming the repository, use:
# MODEL_ID = "AyoubChLin/companydocs-distilmbert-v2"
MODEL_ID = "AyoubChLin/companydocs-v2-doc-cls-distilmbert"

classifier = pipeline(
    "text-classification",
    model=MODEL_ID,
    device=0 if torch.cuda.is_available() else -1,
)

texts = [
    "INVOICE\nInvoice number: INV-1042\nTotal amount due: EUR 1,250.00",
    "PURCHASE ORDER\nPO number: PO-218\nPlease supply 20 office chairs.",
]

predictions = classifier(texts, truncation=True, max_length=512)
for prediction in predictions:
    print(prediction["label"], prediction["score"])

# Inspect the labels actually supported by this checkpoint.
print(classifier.model.config.id2label)

Extract text from a PDF or run OCR before passing the resulting string to the classifier. The examples above illustrate the interface; their predictions are not precomputed benchmark results.

Intended uses and limitations

Use this model for document routing, indexing, and selecting a downstream extraction workflow based on a predicted document type.

  • Language coverage: training and evaluation cover English and French. Other languages were not evaluated in the recorded run.
  • Benchmark scope: both English and French accuracy are 100% in the recorded run. Evaluate each language on representative production documents before deployment.
  • Text only: the model does not process visual layout, handwriting, or raw PDF files. OCR errors can change its predictions.
  • Truncation: content after the first 512 tokens is omitted. Documents whose identifying information appears later may be misclassified.
  • Closed label set: an unsupported document type will still receive a supported label. There is no trained unknown-document class.
  • Benchmark shortcuts: document titles such as “INVOICE” or “FACTURE” may make classification easier. Issuer-separated splits alone do not establish robustness to missing titles, new templates, or noisy real-world scans.
  • Scores: prediction scores have not been shown to be calibrated probabilities. Validate any review threshold on representative deployment data.

License and provenance

The repository's current license could not be verified when preparing this card, so no license is asserted in the metadata. Check the model repository's license and the dataset card before reuse or redistribution.

Training settings, label lists, and results are sourced from companydocs-v2-doc-classification.ipynb. Its saved outputs and current source are not fully synchronized, including a later error-analysis cell reporting a different test size. The results here use the multilingual DistilBERT training/evaluation output and its associated recorded split counts. Verify the hosted model configuration and rerun evaluation against a pinned dataset revision to establish fully reproducible checkpoint-specific results.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей