/ Модель

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

Контекст
514 токенов
Параметры
305 млн
Лицензия
CC BY-SA 4.0
Архитектура
xlm-roberta · dense
Базовая модель
xlm-roberta-base
Опубликована
11 ноя 2022

xlm-roberta-base-multilingual-text-genre-classifier

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

Многоязычная модель Classla на базе XLM-RoBERTa определяет жанр текста для автоматической разметки коллекций документов.

254скачиваний за 30 дней31лайквеса обновлены19 ноя 2025

Бенчмарки

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

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

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

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

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

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

Это многоязычная модель классификации текстов по жанру, разработанная Classla и дообученная на вручную размеченном наборе X-GENRE. Она основана на XLM-RoBERTa-base с архитектурой XLMRobertaForSequenceClassification и содержит около 305,2 млн параметров. Модель присваивает тексту жанровую метку, например «Информация/объяснение», «Инструкция» или «Юридический текст», и предназначена для автоматической разметки больших коллекций документов.

Модель рассчитана на тексты на языках, поддерживаемых XLM-RoBERTa-base; в карточке среди языков указаны, в частности, арабский, болгарский, бенгальский, немецкий, английский, испанский, французский, японский, корейский и хинди. Размер контекста — 514 токенов. Авторы сообщают о результатах на тестах внутри и вне обучающего набора и о сравнении с другими подходами, включая zero-shot модели GPT. Для длинных документов и языков с ограниченным покрытием качество может быть ниже; классификация предназначена для жанровой разметки, а не для определения темы или проверки фактов. Модель распространяется по лицензии CC BY-SA 4.0.

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

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

Ограничения

Контекст ограничен 514 токенами, поэтому длинные документы могут требовать разбиения. Точность зависит от языка, жанра и соответствия текста данным обучения; метки описывают жанр, а не тему или достоверность.

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

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

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

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

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

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

Открыть на Hugging Face

X-GENRE classifier - multilingual text genre classifier

Text classification model based on xlm-roberta-base and fine-tuned on a multilingual manually-annotated X-GENRE genre dataset. The model can be used for automatic genre identification, applied to any text in a language, supported by the xlm-roberta-base.

The details on the model development, the datasets and the model's in-dataset, cross-dataset and multilingual performance are provided in the paper Automatic Genre Identification for Robust Enrichment of Massive Text Collections: Investigation of Classification Methods in the Era of Large Language Models (Kuzman et al., 2023).

The model can also be downloaded from the CLARIN.SI repository.

If you use the model, please cite the paper:

@article{kuzman2023automatic,
  title={Automatic Genre Identification for Robust Enrichment of Massive Text Collections: Investigation of Classification Methods in the Era of Large Language Models},
  author={Kuzman, Taja and Mozeti{\v{c}}, Igor and Ljube{\v{s}}i{\'c}, Nikola},
  journal={Machine Learning and Knowledge Extraction},
  volume={5},
  number={3},
  pages={1149--1175},
  year={2023},
  publisher={MDPI}
}

AGILE - Automatic Genre Identification Benchmark

We set up a benchmark for evaluating robustness of automatic genre identification models to test their usability for the automatic enrichment of large text collections with genre information. The benchmark comprises 11 European languages and two test datasets. You are welcome to submit your entry at the benchmark's GitHub repository.

The model outperforms all other technologies, including GPT models that are used in a zero-shot scenario.

Results on the English test dataset (EN-GINCO):

ModelTest DatasetMacro F1Micro F1
X-GENRE classifieren-ginco0.6870.684
GPT-4o (gpt-4o-2024-08-06) (zero-shot)en-ginco0.620.735
Llama 3.3 (70B) (zero-shot)en-ginco0.5860.684
Gemma 2 (27B) (zero-shot)en-ginco0.5640.603
Gemma 3 (27B) (zero-shot)en-ginco0.5410.672
GPT-4o-mini (gpt-4o-mini-2024-07-18) (zero-shot)en-ginco0.5340.632
Support Vector Machineen-ginco0.5140.489
GPT-3.5-Turbo (zero-shot)en-ginco0.4940.625
DeepSeek-R1 14B (zero-shot)en-ginco0.2930.229
Dummy Classifier (stratified)en-ginco0.0880.154
Dummy classifier (most frequent)en-ginco0.0320.169

Results on the multilingual test dataset (X-GINCO), comprising instances in Albanian, Catalan, Croatian, Greek, Icelandic, Macedonian, Maltese, Slovenian, Turkish, and Ukrainian:

ModelTest DatasetMacro F1Micro F1
X-GENRE classifierx-ginco0.8470.845
GPT-4o (gpt-4o-2024-08-06) (zero-shot)x-ginco0.7760.769
Llama 3.3 (70B) (zero-shot)x-ginco0.7410.738
Gemma 3 (27B) (zero-shot)x-ginco0.7390.733
GPT-4o-mini (gpt-4o-mini-2024-07-18) (zero-shot)x-ginco0.6880.67
GPT-3.5-Turbo (zero-shot)x-ginco0.6270.622
Gemma 2 (27B) (zero-shot)x-ginco0.6120.593
DeepSeek-R1 14B (zero-shot)x-ginco0.1970.204
Support Vector Machinex-ginco0.1660.184
Dummy Classifier (stratified)x-ginco0.1060.113
Dummy classifier (most frequent)x-ginco0.0290.133

(The multilingual test dataset is easier than the English one, as the vague label "Other" and instances that were predicted with a confidence score below 0.80 were not included in the test dataset.)

For language-specific results, see the AGILE benchmark.

Intended use and limitations

Usage

Use example for prediction on a dataset, using batch processing, is available via Google Collab.

An example of preparing data for genre identification and post-processing of the results can be found here where we applied X-GENRE classifier to the English part of MaCoCu parallel corpora.

For reliable results, genre classifier should be applied to documents of sufficient length (the rule of thumb is at least 75 words). Predictions with confidence scores below 0.8 should not be used. In our experience annotating large web corpora in various European languages, this occurs in approximately 4% of cases. We label these instances as "Mix." Furthermore, the label "Other" can be used as another indicator of low confidence of the predictions, as it often indicates that the text does not have enough features of any genre, and these predictions can be discarded as well.

Use examples

from simpletransformers.classification import ClassificationModel
model_args= {
            "num_train_epochs": 15,
            "learning_rate": 1e-5,
            "max_seq_length": 512,
            "silent": True
            }
model = ClassificationModel(
    "xlmroberta", "classla/xlm-roberta-base-multilingual-text-genre-classifier", use_cuda=True,
    args=model_args
    
)
predictions, logit_output = model.predict(["How to create a good text classification model? First step is to prepare good data. Make sure not to skip the exploratory data analysis. Pre-process the text if necessary for the task. The next step is to perform hyperparameter search to find the optimum hyperparameters. After fine-tuning the model, you should look into the predictions and analyze the model's performance. You might want to perform the post-processing of data as well and keep only reliable predictions.", 
                                        "On our site, you can find a great genre identification model which you can use for thousands of different tasks. With our model, you can fastly and reliably obtain high-quality genre predictions and explore which genres exist in your corpora. Available for free!"]
                                        )
predictions
# Output: array([3, 8])

[model.config.id2label[i] for i in predictions]
# Output: ['Instruction', 'Promotion']

X-GENRE categories

For details on the X-GENRE categories, refer to the X-GENRE Annotation Guidelines.

List of labels

labels_list=['Other', 'Information/Explanation', 'News', 'Instruction', 'Opinion/Argumentation', 'Forum', 'Prose/Lyrical', 'Legal', 'Promotion'],

labels_map={'Other': 0, 'Information/Explanation': 1, 'News': 2, 'Instruction': 3, 'Opinion/Argumentation': 4, 'Forum': 5, 'Prose/Lyrical': 6, 'Legal': 7, 'Promotion': 8}

Description of labels

LabelDescriptionExamples
Information/ExplanationAn objective text that describes or presents an event, a person, a thing, a concept etc. Its main purpose is to inform the reader about something. Common features: objective/factual, explanation/definition of a concept (x is …), enumeration.research article, encyclopedia article, informational blog, product specification, course materials, general information, job description, manual, horoscope, travel guide, glossaries, historical article, biographical story/history.
InstructionAn objective text which instructs the readers on how to do something. Common features: multiple steps/actions, chronological order, 1st person plural or 2nd person, modality (must, have to, need to, can, etc.), adverbial clauses of manner (in a way that), of condition (if), of time (after …).how-to texts, recipes, technical support
LegalAn objective formal text that contains legal terms and is clearly structured. The name of the text type is often included in the headline (contract, rules, amendment, general terms and conditions, etc.). Common features: objective/factual, legal terms, 3rd person.small print, software license, proclamation, terms and conditions, contracts, law, copyright notices, university regulation
NewsAn objective or subjective text which reports on an event recent at the time of writing or coming in the near future. Common features: adverbs/adverbial clauses of time and/or place (dates, places), many proper nouns, direct or reported speech, past tense.news report, sports report, travel blog, reportage, police report, announcement
Opinion/ArgumentationA subjective text in which the authors convey their opinion or narrate their experience. It includes promotion of an ideology and other non-commercial causes. This genre includes a subjective narration of a personal experience as well. Common features: adjectives/adverbs that convey opinion, words that convey (un)certainty (certainly, surely), 1st person, exclamation marks.review, blog (personal blog, travel blog), editorial, advice, letter to editor, persuasive article or essay, formal speech, pamphlet, political propaganda, columns, political manifesto
PromotionA subjective text intended to sell or promote an event, product, or service. It addresses the readers, often trying to convince them to participate in something or buy something. Common features: contains adjectives/adverbs that promote something (high-quality, perfect, amazing), comparative and superlative forms of adjectives and adverbs (the best, the greatest, the cheapest), addressing the reader (usage of 2nd person), exclamation marks.advertisement, promotion of a product (e-shops), promotion of an accommodation, promotion of company's services, invitation to an event
ForumA text in which people discuss a certain topic in form of comments. Common features: multiple authors, informal language, subjective (the writers express their opinions), written in 1st person.discussion forum, reader/viewer responses, QA forum
Prose/LyricalA literary text that consists of paragraphs or verses. A literary text is deemed to have no other practical purpose than to give pleasure to the reader. Often the author pays attention to the aesthetic appearance of the text. It can be considered as art.lyrics, poem, prayer, joke, novel, short story
OtherA text that which does not fall under any of other genre categories.

Fine-tuning hyperparameters

Fine-tuning was performed with simpletransformers. Beforehand, a brief hyperparameter optimization was performed and the presumed optimal hyperparameters are:

model_args= {
            "num_train_epochs": 15,
            "learning_rate": 1e-5,
            "max_seq_length": 512,
            }        
      

Citation

If you use the model, please cite the paper which describes creation of the X-GENRE dataset and the genre classifier:

@article{kuzman2023automatic,
  title={Automatic Genre Identification for Robust Enrichment of Massive Text Collections: Investigation of Classification Methods in the Era of Large Language Models},
  author={Kuzman, Taja and Mozeti{\v{c}}, Igor and Ljube{\v{s}}i{\'c}, Nikola},
  journal={Machine Learning and Knowledge Extraction},
  volume={5},
  number={3},
  pages={1149--1175},
  year={2023},
  publisher={MDPI}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей