/ Модель

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

Лицензия
CC BY 4.0
Опубликована
7 сен 2023

xlm-roberta-large-english-legislative-cap-v3

Классификация текстаТекст → label3 профессии
112скачиваний за 30 дней4лайкавеса обновлены24 авг 2026

Описание модели

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

Модель классифицирует англоязычные законодательные документы по основным тематическим категориям Comparative Agendas Project.

Это модель poltextlab на базе xlm-roberta-large, дообученная на англоязычных законодательных документах: законопроектах, законах, резолюциях, слушаниях и других материалах. Она классифицирует документы по основным тематическим кодам Comparative Agendas Project (CAP).

Модель предназначена для тематической разметки законодательных текстов и сравнительных исследований политической повестки. В README сообщается о точности 0,9 на тестовом наборе из 148 474 примеров; модель используется в бесплатном инструменте CAP Babel Machine. Для загрузки требуется авторизованный доступ к репозиторию Hugging Face. Лицензия — CC BY 4.0.

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

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

Ограничения

Модель рассчитана на англоязычные законодательные документы и тематические коды CAP, поэтому качество на других языках и типах текстов не подтверждено. Для загрузки нужен токен доступа к gated-репозиторию.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus

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

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

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

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

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

Открыть на Hugging Face

xlm-roberta-large-english-legislative-cap-v3

Model description

An xlm-roberta-large model fine-tuned on english training data containing legislative documents (bills, laws, motions, legislative decrees, hearings, resolutions) labeled with major topic codes from the Comparative Agendas Project.

We follow the master codebook of the Comparative Agendas Project, and all of our models use the same major topic codes.

How to use the model

from transformers import AutoTokenizer, pipeline

tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-large")
pipe = pipeline(
    model="poltextlab/xlm-roberta-large-english-legislative-cap-v3",
    task="text-classification",
    tokenizer=tokenizer,
    use_fast=False,
    token="<your_hf_read_only_token>"
)

text = "We will place an immediate 6-month halt on the finance driven closure of beds and wards, and set up an independent audit of needs and facilities."
pipe(text)

The translation table from the model results to CAP codes is the following:

CAP_NUM_DICT = {
    0: 1,
    1: 2,
    2: 3,
    3: 4,
    4: 5,
    5: 6,
    6: 7,
    7: 8,
    8: 9,
    9: 10,
    10: 12,
    11: 13,
    12: 14,
    13: 15,
    14: 16,
    15: 17,
    16: 18,
    17: 19,
    18: 20,
    19: 21,
    20: 23,
    21: 999,
}

We have included a 999 label because our models are fine-tuned on training data containing the label 'None' in addition to the 21 CAP major policy topic codes, indicating that the given text contains no relevant policy content. We use the label 999 for these cases.

Gated access

Due to the gated access, you must pass the token parameter when loading the model. In earlier versions of the Transformers package, you may need to use the use_auth_token parameter instead.

Model performance

The model was evaluated on a test set of 148474 examples. Model accuracy is 0.9.

labelprecisionrecallf1-scoresupport
00.850.80.835794
10.830.810.822920
20.910.920.9210336
30.90.920.915258
40.820.90.864604
50.910.930.926173
60.870.890.885111
70.880.920.94251
80.870.910.891517
90.890.920.918119
100.910.90.910326
110.870.880.885471
120.860.860.863078
130.880.860.879050
140.880.890.8810197
150.870.880.872556
160.920.920.924821
170.860.860.864106
180.90.870.8917295
190.90.90.910681
2010.20.3325
210.990.960.9716785
macro avg0.890.860.86148474
weighted avg0.90.90.9148474

Fine-tuning procedure

This model was fine-tuned with the following key hyperparameters:

  • Number of Training Epochs: 10
  • Batch Size: 8
  • Learning Rate: 5e-06
  • Early Stopping: enabled with a patience of 2 epochs

Inference platform

This model is used by the CAP Babel Machine, an open-source and free natural language processing tool, designed to simplify and speed up projects for comparative research.

Cooperation

Model performance can be significantly improved by extending our training sets. We appreciate every submission of CAP-coded corpora (of any domain and language) at poltextlab{at}poltextlab{dot}com or by using the CAP Babel Machine.

Reference

Sebők, M., Máté, Á., Ring, O., Kovács, V., & Lehoczki, R. (2024). Leveraging Open Large Language Models for Multilingual Policy Topic Classification: The Babel Machine Approach. Social Science Computer Review, 0(0). https://doi.org/10.1177/08944393241259434

Debugging and issues

This architecture uses the sentencepiece tokenizer. In order to use the model before transformers==4.27 you need to install it manually.

If you encounter a RuntimeError when loading the model using the from_pretrained() method, adding ignore_mismatched_sizes=True should solve the issue.

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

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

GPU в ailist

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

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

Подбираем GPU…

Ревизия весов
cbed0f4

0 моделей