/ Модель

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

Контекст
8 192 токена
Параметры
140 млн
Лицензия
Apache 2.0
Архитектура
modernbert · dense
Базовая модель
mmBERT-small
Опубликована
12 июн 2026

orca-sonar-document-classifier

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

Мультиязычный классификатор Patronus AI, распределяющий документы и тексты по тематическим категориям для маршрутизации рисков и DLP-проверок.

69скачиваний за 30 дней5лайковвеса обновлены4 ноя 2026

Бенчмарки

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

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

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

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

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

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

Orca-Sonar — мультиязычный классификатор документов компании Patronus AI на основе mmBERT (ModernBERT). Модель относит текст или документ к одной из девяти тематических категорий и рассчитана на маршрутизацию текстов по уровню риска перед передачей LLM, проверкой DLP или сохранением. Она распознаёт тему содержимого даже в запросах-обёртках вроде просьбы кратко изложить договор.

Модель дообучена на jhu-clsp/mmBERT-small, содержит 140,5 млн параметров и принимает последовательности длиной до 8192 токенов. В карточке описана поддержка немецкого и английского языков; модель возвращает метку класса с оценкой уверенности. Доступны веса safetensors и экспорт ONNX в FP16. Лицензия — Apache-2.0.

В тестировании на отложенной выборке из реальных данных заявлены точность 0,942 и macro-F1 0,940. Для немецкого и английского языков авторы отмечают высокую точность, но другие языки не тестировались. Возможны ложные срабатывания; устойчивость к adversarial-входам, данным вне распределения, чистым персональным данным и патологически длинным текстам ограничена. Для важных сценариев маршрутизации рекомендуется порог уверенности или отказ от решения, а для DLP — предварительная детерминированная проверка длины и PII.

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

  • классификация договоров и юридической переписки
  • маршрутизация резюме, вакансий и кадровых документов
  • классификация финансовых отчётов и счетов
  • определение тематики текста перед передачей LLM
  • предварительная категоризация документов для DLP-проверки

Ограничения

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

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

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

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

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

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

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

Открыть на Hugging Face

Model Card for Orca Sonar Document Classifier

Multilingual Document Topic Classifier for Real-World AI Security & DLP

Read more

Orca-Sonar is a Multilingual ModernBERT-based (mmBERT) classifier that assigns a document/text to one of 9 topic classes. It is part of the Patronus Protect security stack and is designed for topic-/risk-routing of incoming texts (e.g. before they reach an LLM, a DLP gate, or a storage tier).

It classifies German and English text and is robust to user-to-AI wrappers (e.g. "Summarize this contract: …"), i.e. the topic of the content determines the class, not the surface format of the request.

Intended Uses

The model maps an input text to one of:

idlabeldescription
0legalcontracts, NDAs, ToS/AGB, privacy policies, statutes/judgments, compliance, legal correspondence
1hrCVs, job ads, employment contracts, terminations, HR policies, performance reviews, recruiting
2financeinvoices, balance sheets, quarterly/annual reports, cash-flow, SEC filings, forecasts
3internal_and_techADRs, RFCs, postmortems, specs, READMEs, wikis, architecture & strategy memos, runbooks
4source_coderaw program code & configs (Python/Go/Rust/JS/TS/SQL/Bash/Dockerfile/k8s/Terraform …)
5marketingpress releases, newsletters, landing-page/sales copy, outbound pitches, case studies
6otherconversational / non-business: smalltalk, recipes, travel, hobby, learning, creative
7educationcurricula, course materials, transcripts, grades, assignments, and academic records
8medicalclinical notes, diagnoses, treatments, medications, and healthcare records

Disambiguation: on a tie, the more sensitive class wins: legal > hr > finance > internal_and_tech > source_code > marketing > other.

Limitations

  • Highly accurate on German and English; other languages were not actively tested.
  • The model can produce false positives; for high-stakes routing combine it with a confidence/abstention gate.
  • Robustness against adversarial / out-of-distribution / pure-PII / pathological-length inputs is partial; pair the model with a deterministic pre-gate (length + PII) for production DLP use.

Model Variants

  • orca-sonar: full model (model.safetensors, fp32).
  • ONNX under onnx/ (inputs input_ids, attention_mask; output logits):
VariantPathSizeargmax agreement with fp32 PyTorch (test / OOD)
fp32onnx/onnx_fp32/model.onnx563 MB100 % / 100 %
fp16onnx/onnx_fp16/model_fp16.onnx282 MB100 % / 99.9 %
mixed (fp16 embeddings, int8 matmuls)onnx/onnx_mixed/model_mixed.onnx240 MB99.5 % / 99.5 %
int8onnx/int8/model.onnx142 MB99.6 % / 99.6 %
int8 + int4 embeddingsonnx/int8_int4_embeddings/model.onnx96 MB99.0 % / 98.9 %

Agreement was measured on the held-out test set (3,367 samples) and the OOD benchmark (845 samples), max length 256. Build details: onnx/quantization_manifest.json.

Training Data

Trained on our own in-house dataset (German + English, 9 topic classes), purpose-built for this model. The dataset will be published soon.

This version adds 1,890 hard examples for the seven original classes (270 per class). They come from an evolutionary generation loop: LLM-generated candidates are checked by two independent LLM judges, and only the examples the previous model got wrong or barely right are kept. education and medical received no new examples.

Benchmark

Both models were evaluated with the same script and max length 256. "Previous" is the model that was in this repository before this update.

Held-out test set (3,367 samples, 100 % real data):

MetricPreviousThis version
Accuracy0.9150.936
F1 (macro)0.9130.936
F1 legal0.9010.932
F1 hr0.8520.913
F1 finance0.9150.948
F1 internal_and_tech0.8900.917
F1 source_code0.9320.955
F1 marketing0.9420.930
F1 other0.9140.933
F1 education0.9380.953
F1 medical0.9370.942

Earlier versions of this card listed accuracy 0.942 for the previous model. On the current test split we measure 0.915 for that model, so the two numbers are not comparable.

Out-of-distribution benchmark (845 real samples from 23 public sources not used in training, judge-verified and deduplicated against the training data; seven classes, no education/medical):

MetricPreviousThis version
Accuracy0.8070.898
F1 (macro)0.7770.890

On the OOD set the largest gains are marketing (F1 0.54 → 0.84) and hr (0.68 → 0.84). Website-style promotional copy is still the weakest case: on a 35-sample diagnostic set of such pages, 31 % are classified as marketing.

Usage

from transformers import pipeline

clf = pipeline("text-classification", model="patronus-studio/orca-sonar-document-classifier")
clf("Fasse mir diesen Dienstleistungsvertrag zusammen: Laufzeit 24 Monate, Gerichtsstand München …")
# -> [{'label': 'legal', 'score': 0.99}]

ONNX

An FP16 ONNX version is available under onnx/onnx_fp16/:

import torch
from optimum.onnxruntime import ORTModelForSequenceClassification
from transformers import AutoTokenizer

model_id = "patronus-studio/orca-sonar-document-classifier"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = ORTModelForSequenceClassification.from_pretrained(model_id, subfolder="onnx/onnx_fp16", file_name="model_fp16.onnx")

inputs = tokenizer("def add(a, b):\n    return a + b", return_tensors="pt")
logits = model(**inputs).logits
print(model.config.id2label[int(torch.argmax(logits, dim=-1))])

Citation

@misc{orcasonar2026,
  title={Orca-Sonar: Multilingual Document Topic Classification for Real-World AI Security},
  author={Patronus Protect},
  year={2026},
  howpublished={\url{https://huggingface.co/patronus-studio/orca-sonar-document-classifier}}
}

License

This model is released under the Apache License 2.0. A copy of the license is included as LICENSE in this repository.

The model is derived from jhu-clsp/mmBERT-small, which is distributed under the MIT License. The upstream copyright and permission notice are retained; the MIT terms continue to apply to the portions originating from that work.

Patronus Ark

This model is built to run inside Patronus Ark, Patronus' open-source on-device AI-security scanning library (L1 native rules → L2 NTDB cascade → L3 transformer).

Note: the L2 heads under l2/ were trained and calibrated against the previous L3 model and have not been retrained for this update. Ark is open source: GitHub repository · product page.

More information


🛡️ Patronus Protect

Brought to you by Patronus Protect, a local AI firewall that secures every AI interaction (prompts, tools, documents) before it reaches your models. Try it for free at patronus.studio.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей