/ Модель

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

Контекст
514 токенов
Параметры
153 млн
Лицензия
Apache 2.0
Архитектура
roberta · dense

roberta-base-ca

Заполнение пропусковТекст → текст3 профессии

Каталонская модель RoBERTa для предсказания пропущенных слов и дообучения на задачах понимания текста.

161скачиваний за 30 дней2лайкавеса обновлены21 окт 2021

Бенчмарки

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

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

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

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

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

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

BSC-LT/roberta-base-ca — каталонская языковая модель BERTa, разработанная Barcelona Supercomputing Center. Это трансформер RoBERTa base для заполнения пропусков в тексте: модель предсказывает замаскированные токены по контексту. Она содержит 153,2 млн параметров, использует byte-level BPE со словарём из 52 000 токенов и принимает последовательности длиной до 514 токенов. Предобучение выполнено на корпусе примерно из 1,8 млрд токенов, собранном из публичных текстов и веб-данных на каталанском языке.

Модель предназначена для каталонского masked language modeling и может служить основой для дообучения на задачах понимания текста, включая ответы на вопросы, классификацию и распознавание именованных сущностей. В карточке приведены результаты дообученных вариантов на бенчмарке CLUB; они не означают, что данный чекпойнт напрямую выполняет эти задачи без дополнительного дообучения. Репозиторий содержит веса PyTorch. Лицензия — Apache-2.0.

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

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

Ограничения

Готовый чекпойнт предназначен для заполнения масок; для классификации, NER и ответов на вопросы требуется дообучение. Модель ориентирована на каталанский язык.

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

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

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

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

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

Открыть на Hugging Face

⚠️NOTICE⚠️: THIS MODEL HAS BEEN MOVED TO THE FOLLOWING URL AND WILL SOON BE REMOVED: https://huggingface.co/PlanTL-GOB-ES/roberta-base-ca

BERTa: RoBERTa-based Catalan language model

BibTeX citation

If you use any of these resources (datasets or models) in your work, please cite our latest paper:

@inproceedings{armengol-estape-etal-2021-multilingual,
    title = "Are Multilingual Models the Best Choice for Moderately Under-resourced Languages? {A} Comprehensive Assessment for {C}atalan",
    author = "Armengol-Estap{\'e}, Jordi  and
      Carrino, Casimiro Pio  and
      Rodriguez-Penagos, Carlos  and
      de Gibert Bonet, Ona  and
      Armentano-Oller, Carme  and
      Gonzalez-Agirre, Aitor  and
      Melero, Maite  and
      Villegas, Marta",
    booktitle = "Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021",
    month = aug,
    year = "2021",
    address = "Online",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2021.findings-acl.437",
    doi = "10.18653/v1/2021.findings-acl.437",
    pages = "4933--4946",
}

Model description

BERTa is a transformer-based masked language model for the Catalan language. It is based on the RoBERTA base model and has been trained on a medium-size corpus collected from publicly available corpora and crawlers.

Training corpora and preprocessing

The training corpus consists of several corpora gathered from web crawling and public corpora.

The publicly available corpora are:

  1. the Catalan part of the DOGC corpus, a set of documents from the Official Gazette of the Catalan Government

  2. the Catalan Open Subtitles, a collection of translated movie subtitles

  3. the non-shuffled version of the Catalan part of the OSCAR corpus \\cite{suarez2019asynchronous}, a collection of monolingual corpora, filtered from Common Crawl

  4. The CaWac corpus, a web corpus of Catalan built from the .cat top-level-domain in late 2013 the non-deduplicated version

  5. the Catalan Wikipedia articles downloaded on 18-08-2020.

The crawled corpora are:

  1. The Catalan General Crawling, obtained by crawling the 500 most popular .cat and .ad domains

  2. the Catalan Government Crawling, obtained by crawling the .gencat domain and subdomains, belonging to the Catalan Government

  3. the ACN corpus with 220k news items from March 2015 until October 2020, crawled from the Catalan News Agency

To obtain a high-quality training corpus, each corpus have preprocessed with a pipeline of operations, including among the others, sentence splitting, language detection, filtering of bad-formed sentences and deduplication of repetitive contents. During the process, we keep document boundaries are kept. Finally, the corpora are concatenated and further global deduplication among the corpora is applied. The final training corpus consists of about 1,8B tokens.

Tokenization and pretraining

The training corpus has been tokenized using a byte version of Byte-Pair Encoding (BPE) used in the original RoBERTA model with a vocabulary size of 52,000 tokens. The BERTa pretraining consists of a masked language model training that follows the approach employed for the RoBERTa base model with the same hyperparameters as in the original work. The training lasted a total of 48 hours with 16 NVIDIA V100 GPUs of 16GB DDRAM.

Evaluation

CLUB benchmark

The BERTa model has been fine-tuned on the downstream tasks of the Catalan Language Understanding Evaluation benchmark (CLUB), that has been created along with the model.

It contains the following tasks and their related datasets:

  1. Part-of-Speech Tagging (POS)

    Catalan-Ancora: from the Universal Dependencies treebank of the well-known Ancora corpus

  2. Named Entity Recognition (NER)

    AnCora Catalan 2.0.0: extracted named entities from the original Ancora version, filtering out some unconventional ones, like book titles, and transcribed them into a standard CONLL-IOB format

  3. Text Classification (TC)

    TeCla: consisting of 137k news pieces from the Catalan News Agency (ACN) corpus

  4. Semantic Textual Similarity (STS)

    Catalan semantic textual similarity: consisting of more than 3000 sentence pairs, annotated with the semantic similarity between them, scraped from the Catalan Textual Corpus

  5. Question Answering (QA):

    ViquiQuAD: consisting of more than 15,000 questions outsourced from Catalan Wikipedia randomly chosen from a set of 596 articles that were originally written in Catalan.

    XQuAD: the Catalan translation of XQuAD, a multilingual collection of manual translations of 1,190 question-answer pairs from English Wikipedia used only as a test set

Here are the train/dev/test splits of the datasets:

Task (Dataset)TotalTrainDevTest
NER (Ancora)13,58110,6281,4271,526
POS (Ancora)16,67813,1231,7091,846
STS3,0732,073500500
TC (TeCla)137,775110,20313,78613,786
QA (ViquiQuAD)14,23911,2551,4921,429

The fine-tuning on downstream tasks have been performed with the HuggingFace Transformers library

Results

Below the evaluation results on the CLUB tasks compared with the multilingual mBERT, XLM-RoBERTa models and the Catalan WikiBERT-ca model

TaskNER (F1)POS (F1)STS (Pearson)TC (accuracy)QA (ViquiQuAD) (F1/EM)QA (XQuAD) (F1/EM)
BERTa88.1398.9779.7374.1686.97/72.2968.89/48.87
mBERT86.3898.8276.3470.5686.97/72.2267.15/46.51
XLM-RoBERTa87.6698.8975.4071.6885.50/70.4767.10/46.42
WikiBERT-ca77.6697.6077.1873.2285.45/70.7565.21/36.60

Intended uses & limitations

The model is ready-to-use only for masked language modelling to perform the Fill Mask task (try the inference API or read the next section) However, the is intended to be fine-tuned on non-generative downstream tasks such as Question Answering, Text Classification or Named Entity Recognition.


Using BERTa

Load model and tokenizer

from transformers import AutoTokenizer, AutoModelForMaskedLM
    
tokenizer = AutoTokenizer.from_pretrained("BSC-TeMU/roberta-base-ca-cased")

model = AutoModelForMaskedLM.from_pretrained("BSC-TeMU/roberta-base-ca-cased")

Fill Mask task

Below, an example of how to use the masked language modelling task with a pipeline.

>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='BSC-TeMU/roberta-base-ca-cased')
>>> unmasker("Situada a la costa de la mar Mediterrània, <mask> s'assenta en una plana formada "
             "entre els deltes de les desembocadures dels rius Llobregat, al sud-oest, "
             "i Besòs, al nord-est, i limitada pel sud-est per la línia de costa,"
             "i pel nord-oest per la serralada de Collserola "
             "(amb el cim del Tibidabo, 516,2 m, com a punt més alt) que segueix paral·lela "
             "la línia de costa encaixant la ciutat en un perímetre molt definit.")

[
  {
    "sequence": " Situada a la costa de la mar Mediterrània, <mask> s'assenta en una plana formada "
                "entre els deltes de les desembocadures dels rius Llobregat, al sud-oest, "
                "i Besòs, al nord-est, i limitada pel sud-est per la línia de costa,"
                "i pel nord-oest per la serralada de Collserola "
                "(amb el cim del Tibidabo, 516,2 m, com a punt més alt) que segueix paral·lela "
                "la línia de costa encaixant la ciutat en un perímetre molt definit.",
    "score": 0.4177263379096985,
    "token": 734,
    "token_str": " Barcelona"
  },
  {
    "sequence": " Situada a la costa de la mar Mediterrània, <mask> s'assenta en una plana formada "
                "entre els deltes de les desembocadures dels rius Llobregat, al sud-oest, "
                "i Besòs, al nord-est, i limitada pel sud-est per la línia de costa,"
                "i pel nord-oest per la serralada de Collserola "
                "(amb el cim del Tibidabo, 516,2 m, com a punt més alt) que segueix paral·lela "
                "la línia de costa encaixant la ciutat en un perímetre molt definit.",
    "score": 0.10696165263652802,
    "token": 3849,
    "token_str": " Badalona"
  },
  {
    "sequence": " Situada a la costa de la mar Mediterrània, <mask> s'assenta en una plana formada "
                "entre els deltes de les desembocadures dels rius Llobregat, al sud-oest, "
                "i Besòs, al nord-est, i limitada pel sud-est per la línia de costa,"
                "i pel nord-oest per la serralada de Collserola "
                "(amb el cim del Tibidabo, 516,2 m, com a punt més alt) que segueix paral·lela "
                "la línia de costa encaixant la ciutat en un perímetre molt definit.",
    "score": 0.08135009557008743,
    "token": 19349,
    "token_str": " Collserola"
  },
  {
   "sequence": " Situada a la costa de la mar Mediterrània, <mask> s'assenta en una plana formada "
                "entre els deltes de les desembocadures dels rius Llobregat, al sud-oest, "
                "i Besòs, al nord-est, i limitada pel sud-est per la línia de costa,"
                "i pel nord-oest per la serralada de Collserola "
                "(amb el cim del Tibidabo, 516,2 m, com a punt més alt) que segueix paral·lela "
                "la línia de costa encaixant la ciutat en un perímetre molt definit.",
    "score": 0.07330769300460815,
    "token": 4974,
    "token_str": " Terrassa"
  },
  {
    "sequence": " Situada a la costa de la mar Mediterrània, <mask> s'assenta en una plana formada "
                "entre els deltes de les desembocadures dels rius Llobregat, al sud-oest, "
                "i Besòs, al nord-est, i limitada pel sud-est per la línia de costa,"
                "i pel nord-oest per la serralada de Collserola "
                "(amb el cim del Tibidabo, 516,2 m, com a punt més alt) que segueix paral·lela "
                "la línia de costa encaixant la ciutat en un perímetre molt definit.",
    "score": 0.03317456692457199,
    "token": 14333,
    "token_str": " Gavà"
  }
]

This model was originally published as bsc/roberta-base-ca-cased.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
RobertaForMaskedLM
Ревизия весов
38504df

0 моделей