/ Модель

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

Контекст
8 192 токена
Параметры
307 млн
Лицензия
eupl-1.2
Архитектура
modernbert · dense
Базовая модель
mmBERT-base
Библиотека
transformers
Опубликована
31 июл 2025

EuroVoc

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

Многоязычный классификатор Европейского парламента предлагает тематические теги EuroVoc для документов на 24 официальных языках ЕС.

247скачиваний за 30 дней0лайковвеса обновлены23 сен 2026

Бенчмарки

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

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

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

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

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

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

EuroVoc — многоязычный классификатор тем, разработанный Харуном Калканчи и Андреасом Папагианнисом для Европейского парламента. Он помогает размечать документы тегами из иерархического тезауруса EuroVoc: модель предсказывает несколько из 7 062 понятий, а редактор проверяет предложенные теги. Модель предназначена прежде всего для классификации документов об институтах и деятельности ЕС, включая юридические и тематически разнородные материалы.

В основе — энкодер ModernBERT из семейства mmBERT с маскированным усреднением состояний токенов и линейной головой классификации с отдельным выходом для каждого понятия. Метаданные указывают 306,9 млн параметров и контекст до 8 192 токенов; README предупреждает, что при предсказании документы обрезаются примерно до 2 048 токенов. Модель поддерживает 24 официальных языка ЕС и выдаёт многометочную текстовую классификацию.

На широких тематических уровнях качество выше, чем при выборе точного понятия: F1 составляет 0,733 для доменов, 0,621 для микротезаурусов и 0,429 для отдельных понятий. Редкие понятия распознаются хуже, а модель может предложить родственный или родительский тег вместо точного. Поэтому результаты полезны как подсказки для проверки человеком, особенно на самом детальном уровне. Лицензия — EUPL-1.2.

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

  • предложение широких тематических тегов для документов ЕС
  • полуавтоматическая разметка юридических документов тегами EuroVoc
  • присвоение документам нескольких тематических категорий
  • поиск подходящих понятий тезауруса EuroVoc по тексту документа

Ограничения

Точные понятия из редких классов распознаются хуже, и модель может подменять их родственным или более общим тегом; результаты следует проверять человеком. README сообщает об обрезке документов примерно до 2 048 токенов, хотя метаданные указывают нативный контекст 8 192 токена.

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

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

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

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

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

Открыть на Hugging Face

EuroVoc Multilabel Classifier 🇪🇺 (multilingual)

EuroVoc is the EU's large multidisciplinary, multilingual (24 languages) hierarchical thesaurus of more than 7,000 concepts covering the activities of the EU institutions. Given the volume of legal documents produced daily, high-quality automated or semi-automated subject classification is valuable in this domain.

This version supersedes the earlier English-only RoBERTa classifier: it is built on the multilingual jhu-clsp/mmBERT-base encoder and reads documents in all 24 official EU languages natively, predicting 7,062 EuroVoc concept labels (multi-label).

Architecture

ModernBertModel (mmBERT) encoder, then a masked mean-pool over token states, then a single linear head (classifier.pt) giving one logit per concept (sigmoid, BCE). No trust_remote_code is needed: the encoder is a standard ModernBertModel and the head loads from classifier.pt.

What it is for

A tagging assistant: it proposes tags, a person confirms them. At the broad subject level roughly 3 of 4 suggestions are correct and it finds about 7 of 10 of the correct ones. It is not accurate enough to tag documents unattended at the most specific level, where it must pick one exact concept out of 7,062.

How good it is

Held-out validation set, 800 batches. EuroVoc is a 3-level hierarchy, and accuracy depends heavily on which level you ask for.

levelpicks fromF1 (overall)F1 (per label)threshold
Domain21 broad subjects0.7330.6830.70
Micro-thesaurus127 topics0.6210.4730.80
Concept7,062 exact tags0.4290.0450.90

F1 (overall) weights every prediction equally; F1 (per label) averages each label's own score, so it is dominated by the thousands of rare concepts and sits much lower. Use the per-level thresholds above, not 0.5: they are the tuned operating points.

Choosing an operating point

uselevelthresholdsuggestions correctcorrect tags found
default (suggest-and-confirm)Domain0.7574%72%
precision-criticalDomain0.9080%63%
mid-level suggestMicro-thesaurus0.8061%63%

Raising the threshold trades finding fewer tags for being right more often.

Languages

Handles all 24 scripts natively, with no unreadable characters, and quality is close to uniform: best Swedish 0.507 and Spanish 0.500, English 0.488, lowest Maltese 0.466 and Greek 0.468 (the share of a document's correct tags landing in the model's top 5). An earlier version of this tagger used an English-only tokenizer and could not read Greek or Cyrillic at all (65 to 68% of their characters were unknown); moving to mmBERT's multilingual tokenizer fixed that, and it is where much of the overall gain came from. Croatian and Irish have under 40 validation documents each, so treat their numbers as noise.

What makes it work

The one idea behind this model: each of the 7,062 concept classifiers is seeded from the meaning of its own EuroVoc name rather than a random start, so rarely-seen concepts inherit language understanding they could never learn from their handful of training documents. Measured against an earlier version of the model without this step (same architecture, same data, same evaluation), it lifts concept-level F1 by 11% (0.385 to 0.429) and the rare-concept score by 20% (0.038 to 0.045), with gains at every level.

Known limits

  • Picks a sibling or parent concept instead of the exact one. The model reliably reads the subject but can choose a neighbouring vocabulary term at the most specific level. On a wood-industry document it predicted "wood product" and "sustainable forest management" where the annotator had written "wood industry" and "sustainable development": correct understanding, wrong vocabulary choice. This is the main reason concept-level scores trail the coarser levels, and the main reason to operate at Domain or Micro-thesaurus level for unattended use.
  • Rare concepts are still under-predicted. Most of the 7,062 tags appear in very few documents; the name-based initialisation reduced this (per-label F1 +20%) but did not erase it. The concept-level tail remains the weakest area.
  • Long documents are cut at ~2,048 tokens (about 68% fit whole; the median fits).

How it was trained

Fine-tuned from jhu-clsp/mmBERT-base on the EuroVoc CELLAR corpus (~327,000 unique documents, 24 official languages). Trained in two stages on 3x NVIDIA RTX A5000, bf16 mixed precision, effective batch 216: a main run with the classifier seeded from EuroVoc name embeddings (learning rate 5e-5, ~9.9 passes over the data), then a short low-rate anneal (7.5e-6, ~2.2 passes) that produced the shipped checkpoint. Total training time roughly 35.5 hours (a 29h main run plus a 6h anneal), about 107 GPU-hours.

Usage

The repo ships a predict.py, or inline:

import torch, pickle, json
from huggingface_hub import hf_hub_download as dl
from transformers import AutoTokenizer, AutoModel
R = "EuropeanParliament/EuroVoc"           # add revision="<branch>" while staged
tok = AutoTokenizer.from_pretrained(R); enc = AutoModel.from_pretrained(R).eval()
head = torch.load(dl(R, "classifier.pt"), weights_only=True)
mlb = pickle.load(open(dl(R, "mlb.pickle"), "rb")); names = json.load(open(dl(R, "names.json")))
b = tok("your EU document text", truncation=True, max_length=2048, return_tensors="pt")
with torch.no_grad():
    h = enc(**b).last_hidden_state; m = b['attention_mask'].unsqueeze(-1).float()
    p = ((h*m).sum(1)/m.sum(1).clamp(min=1e-9) @ head['weight'].T + head['bias']).sigmoid()[0]
for s, i in zip(*p.topk(10)):
    if s > 0.9:   # concept threshold; MT 0.80, DO 0.70
        print(names.get(str(mlb.classes_[i]), mlb.classes_[i]), float(s))

Authors

Original EuroVoc classifier (English RoBERTa): Sébastien Campion, Andreas Papagiannis (European Parliament).

Multilingual mmBERT version: Harun Kalkanci, Andreas Papagiannis (European Parliament).

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей