/ Модель

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

Контекст
514 токенов
Параметры
305 млн
Лицензия
MIT
Архитектура
xlm-roberta · dense
Опубликована
2 мар 2022

xlm-roberta-base

Заполнение пропусковТекст → текст8 профессий
7,5 млнскачиваний за 30 дней894лайкавеса обновлены19 фев 2024

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

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

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

XLM-RoBERTa base — многоязычная трансформерная модель FacebookAI, впервые выпущенная в этом репозитории. Она предварительно обучена на 2,5 ТБ отфильтрованных данных CommonCrawl на 100 языках с целью masked language modeling: модель восстанавливает замаскированные слова, используя контекст с обеих сторон. Это базовая модель архитектуры XLM-RoBERTa с 305,2 млн параметров и контекстом до 514 токенов.

Модель подходит для предсказания пропущенных слов и получения текстовых представлений для последующей настройки на классификацию последовательностей и токенов, а также ответы на вопросы. Она поддерживает множество языков; метаданные перечисляют коды языков, среди которых английский, арабский, китайский здесь не указан, французский, немецкий, японский, корейский, русский также не указан. Для генерации связного текста модель не предназначена. Лицензия — MIT.

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

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

Ограничения

Сырая модель в основном предназначена для дообучения на целевых задачах и не подходит для генерации текста. Перечень языков в доступных метаданных ограничен, хотя README указывает предобучение на 100 языках.

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

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

xlm-roberta-base и топ-9 моделей каталога в каждом тесте

Цвет сравнивает модели внутри строки: чем темнее ячейка, тем лучше результат в этом тесте. Таблица листается вправо

  • хужелучше
  • лучший результат в тесте
  • xlm-roberta-base, эта модель
  • — нет результата
Тестxlm-roberta-baseэта модельsentence-t5-xxlsentence-t5-basegtr-t5-xlnb-bert-largeLaBSEsentence-t5-xlsentence-t5-largeudever-bloom-1b1gtr-t5-large
DiaBLaBitextMiningfr-en.recall0,24670,85820,5945——0,8944 — лучший результат0,78860,74620,0341—
AmazonReviewsClassificationfr.f10,24030,4264 — лучший результат0,34820,3465——0,40860,38330,34580,3247
MTOPDomainClassificationfr.f10,40910,8612 — лучший результат0,76390,8508——0,84990,80050,69270,8273
MTOPIntentClassificationfr.accuracy0,19380,5833 — лучший результат0,45240,5107——0,54390,47730,51250,4639
STS22fr.euclidean.pearson0,24050,74730,73030,7883 — лучший результат——0,73650,70020,75370,7707
MasakhaNEWSClassificationfra.f10,55730,75190,7722 — лучший результат———0,76270,76890,7696—
AlloprofRerankingmap0,25580,6836 — лучший результат0,5012———0,6330,5799——
AlloprofRetrievalprecision_at_30,00030,1529 — лучший результат0,09———0,13670,1144——
BSARDRetrievalndcg_at_1000,0333 — лучший результат0,0016———0,00140——
FloresBitextMiningeng_Latn-fra_Latn.f10,53290,9987 — лучший результат0,9616———0,9920,9866——
MintakaRetrievalfr.ndcg_at_100,00880,3493 — лучший результат0,2104———0,31540,2392——
NorwegianParliamentaccuracy0,5683———0,6268 — лучший результат—————

Топ-5 каталога и эта модель

Место — среди моделей каталога с результатом этого теста

STS22

10 из 10

0,2405−0,55 до лидера

Один прогон

  1. 1gtr-t5-xl0,7883
  2. 2gtr-t5-large0,7707
  3. 3udever-bloom-1b10,7537
  4. 4sentence-t5-xxl0,7473
  5. 5sentence-t5-xl0,7365
  6. 10xlm-roberta-base0,2405

Поднаборы

  • Общий результат 0,6216
  • Общий результат 0,5672
  • Общий результат 0,5672
  • Общий результат 0,3653
MTEB

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

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

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

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

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

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

Открыть на Hugging Face

XLM-RoBERTa (base-sized model)

XLM-RoBERTa model pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. It was introduced in the paper Unsupervised Cross-lingual Representation Learning at Scale by Conneau et al. and first released in this repository.

Disclaimer: The team releasing XLM-RoBERTa did not write a model card for this model so this model card has been written by the Hugging Face team.

Model description

XLM-RoBERTa is a multilingual version of RoBERTa. It is pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages.

RoBERTa is a transformers model pretrained on a large corpus in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts.

More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the sentence.

This way, the model learns an inner representation of 100 languages that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard classifier using the features produced by the XLM-RoBERTa model as inputs.

Intended uses & limitations

You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task. See the model hub to look for fine-tuned versions on a task that interests you.

Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked) to make decisions, such as sequence classification, token classification or question answering. For tasks such as text generation, you should look at models like GPT2.

Usage

You can use this model directly with a pipeline for masked language modeling:

>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='xlm-roberta-base')
>>> unmasker("Hello I'm a <mask> model.")

[{'score': 0.10563907772302628,
  'sequence': "Hello I'm a fashion model.",
  'token': 54543,
  'token_str': 'fashion'},
 {'score': 0.08015287667512894,
  'sequence': "Hello I'm a new model.",
  'token': 3525,
  'token_str': 'new'},
 {'score': 0.033413201570510864,
  'sequence': "Hello I'm a model model.",
  'token': 3299,
  'token_str': 'model'},
 {'score': 0.030217764899134636,
  'sequence': "Hello I'm a French model.",
  'token': 92265,
  'token_str': 'French'},
 {'score': 0.026436051353812218,
  'sequence': "Hello I'm a sexy model.",
  'token': 17473,
  'token_str': 'sexy'}]

Here is how to use this model to get the features of a given text in PyTorch:

from transformers import AutoTokenizer, AutoModelForMaskedLM

tokenizer = AutoTokenizer.from_pretrained('xlm-roberta-base')
model = AutoModelForMaskedLM.from_pretrained("xlm-roberta-base")

# prepare input
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')

# forward pass
output = model(**encoded_input)

BibTeX entry and citation info

@article{DBLP:journals/corr/abs-1911-02116,
  author    = {Alexis Conneau and
               Kartikay Khandelwal and
               Naman Goyal and
               Vishrav Chaudhary and
               Guillaume Wenzek and
               Francisco Guzm{\'{a}}n and
               Edouard Grave and
               Myle Ott and
               Luke Zettlemoyer and
               Veselin Stoyanov},
  title     = {Unsupervised Cross-lingual Representation Learning at Scale},
  journal   = {CoRR},
  volume    = {abs/1911.02116},
  year      = {2019},
  url       = {http://arxiv.org/abs/1911.02116},
  eprinttype = {arXiv},
  eprint    = {1911.02116},
  timestamp = {Mon, 11 Nov 2019 18:38:09 +0100},
  biburl    = {https://dblp.org/rec/journals/corr/abs-1911-02116.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей