/ Модель

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

Контекст
512 токенов
Параметры
2 млрд
Лицензия
MIT
Архитектура
deberta-v2 · dense
Опубликована
4 янв 2024

albertina-1b5-portuguese-ptpt-encoder-256

Заполнение пропусковТекст → текст3 профессии
148скачиваний за 30 дней2лайкавеса обновлены18 мар 2024

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

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

Albertina 1.5B PTPT 256 — энкодер DeBERTa для заполнения пропусков и языковых задач на европейском португальском.

Albertina 1.5B PTPT 256 — языковая модель-энкодер семейства BERT, разработанная совместной командой Лиссабонского и Португальского университетов. Модель построена на архитектуре DeBERTa и предназначена для европейского португальского языка (PTPT). В карточке указаны 1,5 млрд параметров, 48 слоёв и размер скрытого состояния 1536; метаданные каталога оценивают размер в 2 млрд параметров. Контекст модели — до 512 токенов.

Модель обучена на корпусах европейского португальского объёмом около 4 млрд токенов, включая материалы Европейского парламента и парламента Португалии. Она подходит для заполнения пропусков в тексте и может служить основой для языковых задач на PTPT. В README сообщается о конкурентных результатах на бенчмарке extraGLUE для европейского португальского.

Модель распространяется под лицензией MIT. Это энкодер для маскированного языкового моделирования; README не описывает генерацию диалогов или поддержку других языковых вариантов.

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

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

Ограничения

Модель специализирована на европейском португальском и имеет ограниченный контекст в 512 токенов. README описывает её как энкодер для маскированного языкового моделирования, поэтому возможности диалоговой генерации не заявлены.

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face


Albertina 1.5B PTPT 256

Albertina 1.5B PTPT 256 is a foundation, large language model for the European variant of Portuguese.

It is an encoder of the BERT family, based on the neural architecture Transformer and developed over the DeBERTa model, with most competitive performance for this language. It has different versions that were trained for different variants of Portuguese (PT), namely the European variant, spoken in Portugal (PTPT) and the American variant, spoken in Brazil (PTBR), and it is openly distributed free of charge under an open license.

Albertina's Family of Models
Albertina 1.5B PTPT
Albertina 1.5B PTBR
Albertina 1.5B PTPT 256
Albertina 1.5B PTBR 256
Albertina 900M PTPT
Albertina 900M PTBR
Albertina 100M PTPT
Albertina 100M PTBR

Albertina 1.5B PTPT 256 is a version for the European variant of Portuguese, and to the best of our knowledge, this is an encoder specifically for this language and variant that, at the time of its initial distribution, with its 1.5 billion parameters and performance scores sets a new state of the art for it, and is made publicly available and distributed for reuse.

It is an encoder of the BERT family, based on the neural architecture Transformer and developed over the DeBERTa model, with most competitive performance for this language. It is distributed free of charge and under a most permissible license.

Albertina 1.5B PTPT 256 is developed by a joint team from the University of Lisbon and the University of Porto, Portugal. For a fully detailed description, check the respective publication:

@misc{albertina-pt-fostering,
      title={Fostering the Ecosystem of Open Neural Encoders
            for Portuguese with Albertina PT-* family}, 
      author={Rodrigo Santos and João Rodrigues and Luís Gomes
              and João Silva and António Branco
              and Henrique Lopes Cardoso and Tomás Freitas Osório
              and Bernardo Leite},
      year={2024},
      eprint={2403.01897},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Please use the above cannonical reference when using or citing this model.

Model Description

This model card is for Albertina 1.5B PTPT 256, with 1.5 billion parameters, 48 layers and a hidden size of 1536.

Albertina 1.5B PTPT 256 is distributed under an MIT license.

DeBERTa is distributed under an MIT license.

Training Data

Albertina 1.5B PTPT 256 was trained over a 4 billion token data set that resulted from gathering some openly available corpora of European Portuguese from the following sources:

  • CulturaX: the CulturaX is a multilingual corpus, freely available for research and AI development, created by combining and extensively cleaning two other large datasets, mC4 and OSCAR. It is the result of a selection performed over the Common Crawl data set, crawled from the Web, that retains only pages whose metadata indicates permission to be crawled, that performs deduplication, and that removes some boilerplate, among other filters. Given that it does not discriminate between the Portuguese variants, we performed extra filtering by retaining only documents whose meta-data indicate the Internet country code top-level domain of Portugal.
  • DCEP: the Digital Corpus of the European Parliament is a multilingual corpus including documents in all official EU languages published on the European Parliament's official website. We retained its European Portuguese portion.
  • Europarl: the European Parliament Proceedings Parallel Corpus is extracted from the proceedings of the European Parliament from 1996 to 2011. We retained its European Portuguese portion.
  • ParlamentoPT: the ParlamentoPT is a data set we obtained by gathering the publicly available documents with the transcription of the debates in the Portuguese Parliament.

Preprocessing

We filtered the PTPT corpora using the BLOOM pre-processing pipeline. We skipped the default filtering of stopwords since it would disrupt the syntactic structure, and also the filtering for language identification given the corpus was pre-selected as Portuguese.

Training

As codebase, we resorted to the DeBERTa V2 xxlarge, for English.

To train Albertina 1.5B PTPT 256, the data set was tokenized with the original DeBERTa tokenizer with a 128-token sequence truncation and dynamic padding for 250k steps and 256-token sequence-truncation for 80k steps. These steps correspond to the equivalent setup of 48 hours on a2-megagpu-16gb Google Cloud A2 node for the 128-token input sequences and 24 hours of computation for the 256-token input sequences. We opted for a learning rate of 1e-5 with linear decay and 10k warm-up steps.

Performance

We resorted to extraGLUE, a PTPT version of the GLUE and SUPERGLUE benchmark. We automatically translated the tasks from GLUE and SUPERGLUE using DeepL Translate, which specifically provides translation from English to PTPT or PTBR as possible options.

ModelRTE (Accuracy)WNLI (Accuracy)MRPC (F1)STS-B (Pearson)COPA (Accuracy)CB (F1)MultiRC (F1)BoolQ (Accuracy)
Albertina 1.5B PTPT0.88090.47420.84570.90340.84330.78400.76880.8602
Albertina 1.5B PTPT 2560.88090.54930.87520.87950.84000.58320.67910.8496
Albertina 900M PTPT0.83390.42250.91710.88010.70330.60180.67280.8224
Albertina 100M PTPT0.69190.47420.80470.8590n.a.0.45290.64810.7578
DeBERTa 1.5B (English)0.81470.45540.86960.85570.51670.49010.66870.8347
DeBERTa 100M (English)0.60290.56340.78020.8320n.a.0.46980.63680.6829

How to use

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

>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='PORTULAN/albertina-1b5-portuguese-ptpt-encoder-256')
>>> unmasker("A culinária portuguesa é rica em sabores e [MASK], tornando-se um dos maiores tesouros do país.")

[{'score': 0.8332648277282715, 'token': 14690, 'token_str': ' costumes', 'sequence': 'A culinária portuguesa é rica em sabores e costumes, tornando-se um dos maiores tesouros do país.'},
{'score': 0.07860890030860901, 'token': 29829, 'token_str': ' cores', 'sequence': 'A culinária portuguesa é rica em sabores e cores, tornando-se um dos maiores tesouros do país.'},
{'score': 0.03278181701898575, 'token': 35277, 'token_str': ' arte', 'sequence': 'A culinária portuguesa é rica em sabores e arte, tornando-se um dos maiores tesouros do país.'},
{'score': 0.009515956044197083, 'token': 9240, 'token_str': ' cor', 'sequence': 'A culinária portuguesa é rica em sabores e cor, tornando-se um dos maiores tesouros do país.'},
{'score': 0.009381960146129131, 'token': 33455, 'token_str': ' nuances', 'sequence': 'A culinária portuguesa é rica em sabores e nuances, tornando-se um dos maiores tesouros do país.'}]



The model can be used by fine-tuning it for a specific task:

>>> from transformers import AutoTokenizer, AutoModelForSequenceClassification, TrainingArguments, Trainer
>>> from datasets import load_dataset

>>> model = AutoModelForSequenceClassification.from_pretrained("PORTULAN/albertina-1b5-portuguese-ptpt-encoder-256", num_labels=2)
>>> tokenizer = AutoTokenizer.from_pretrained("PORTULAN/albertina-1b5-portuguese-ptpt-encoder-256")
>>> dataset = load_dataset("PORTULAN/glue-ptpt", "rte")

>>> def tokenize_function(examples):
...     return tokenizer(examples["sentence1"], examples["sentence2"], padding="max_length", truncation=True)

>>> tokenized_datasets = dataset.map(tokenize_function, batched=True)

>>> training_args = TrainingArguments(output_dir="albertina-ptpt-rte", evaluation_strategy="epoch")
>>> trainer = Trainer(
...     model=model,
...     args=training_args,
...     train_dataset=tokenized_datasets["train"],
...     eval_dataset=tokenized_datasets["validation"],
... )

>>> trainer.train()

Citation

When using or citing this model, kindly cite the following publication:

@misc{albertina-pt-fostering,
      title={Fostering the Ecosystem of Open Neural Encoders
            for Portuguese with Albertina PT-* family}, 
      author={Rodrigo Santos and João Rodrigues and Luís Gomes
              and João Silva and António Branco
              and Henrique Lopes Cardoso and Tomás Freitas Osório
              and Bernardo Leite},
      year={2024},
      eprint={2403.01897},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Acknowledgments

The research reported here was partially supported by: PORTULAN CLARIN—Research Infrastructure for the Science and Technology of Language, funded by Lisboa 2020, Alentejo 2020 and FCT—Fundação para a Ciência e Tecnologia under the grant PINFRA/22117/2016; research project ALBERTINA - Foundation Encoder Model for Portuguese and AI, funded by FCT—Fundação para a Ciência e Tecnologia under the grant CPCA-IAC/AV/478394/2022; innovation project ACCELERAT.AI - Multilingual Intelligent Contact Centers, funded by IAPMEI, I.P. - Agência para a Competitividade e Inovação under the grant C625734525-00462629, of Plano de Recuperação e Resiliência, call RE-C05-i01.01 – Agendas/Alianças Mobilizadoras para a Reindustrialização; and LIACC - Laboratory for AI and Computer Science, funded by FCT—Fundação para a Ciência e Tecnologia under the grant FCT/UID/CEC/0027/2020.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
DebertaV2ForMaskedLM
Ревизия весов
49bf025

0 моделей