/ Модель

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

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

mBERT-CompanyDocs-v2

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

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

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

Бенчмарки

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

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

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

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

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

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

CompanyDocs mBERT v2 — модель Ayoub Cherguelaine (AyoubChLin) для классификации типов деловых документов по извлечённому тексту. Это дообученный многоязычный BERT google-bert/bert-base-multilingual-cased с классификационной головой; метаданные указывают 205,1 млн параметров, формат safetensors и контекст до 512 токенов. Модель предназначена для маршрутизации документов, их индексации и выбора последующего процесса извлечения данных. В обучении использовались тексты на английском и французском языках; среди примеров классов — счета, заказы на закупку, коммерческие предложения, чеки и транспортные накладные.

Модель принимает только текст, обычно извлечённый из PDF или полученный после OCR, и выдаёт класс документа. В README приведены высокие метрики на тестовом наборе, однако они не подтверждают аналогичное качество на реальных документах; независимый аудит утечек и дубликатов не представлен. Модель не анализирует изображения, структуру страницы или рукописный текст, обрезает вход после 512 токенов и всегда выбирает класс из фиксированного набора, поэтому неподдерживаемые типы документов также получают одну из известных меток. Лицензия в предоставленных данных не указана.

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

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

Ограничения

Модель работает только с текстом, обрезает вход после 512 токенов и не имеет класса для неизвестных типов документов. Метрики README получены на конкретном наборе данных и не подтверждают качество на реальных документах, шумном OCR или документах без явных заголовков.

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

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

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

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

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

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

Открыть на Hugging Face

CompanyDocs mBERT v2

Classify business documents from their extracted text. CompanyDocs mBERT v2 is a fine-tuned multilingual BERT 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 99.9957% test accuracy, 99.5094% macro-F1, and approximately 177.9 million parameters.

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

Model details

PropertyValue
AuthorAyoub Cherguelaine (AyoubChLin)
Base checkpointgoogle-bert/bert-base-multilingual-cased
Architecturemultilingual BERT 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 177.9M
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 BERT entry in the uploaded notebook's saved outputs. They are not a new evaluation of the hosted checkpoint.

Test metricResult
Accuracy99.9957%
Macro-F199.5094%
Weighted-F199.9957%
Macro precision99.8316%
Macro recall99.2296%
English accuracy100.0000%
French accuracy99.9947%

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. Near-perfect accuracy on this dataset warrants 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 14.5 minutes, peak allocated GPU memory of 29.8 GB, and approximately 1,222.0 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-mbert-v2"
MODEL_ID = "AyoubChLin/companydocs-v2-doc-cls-mbert"

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: the recorded run has near-perfect overall accuracy, but macro-F1 is lower. Evaluate rare classes and 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 BERT 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…

Класс архитектуры
BertForSequenceClassification
Ревизия весов
3000e12

0 моделей