/ Модель

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

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

bernice

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

Bernice — мультиязычный энкодер RoBERTa, обученный на твитах для представления и анализа публикаций в Twitter.

1 377скачиваний за 30 дней5лайковвеса обновлены5 апр 2023

Бенчмарки

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

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

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

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

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

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

Bernice — мультиязычный предварительно обученный энкодер семейства RoBERTa, разработанный исследователями Университета Джонса Хопкинса и представленный в статье EMNLP 2022 года. Модель обучена с нуля исключительно на данных Twitter: 2,5 млрд твитов на 66 языках, с токенизатором, адаптированным к твитам, эмодзи и хештегам. В репозитории представлена версия XLM-RoBERTa для заполнения пропусков, содержащая около 305 млн параметров; формат — PyTorch и safetensors, контекст — 130 токенов.

Модель предназначена для получения представлений твитов и как основа для задач анализа публикаций в социальных сетях. Авторы оценивали её на наборах TweetEval, UMSAB и Multilingual Hate Speech; результаты показывают сильные показатели в мультиязычном анализе тональности и токсичности, хотя на TweetEval Bernice уступает BERTweet. Лицензия — MIT.

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

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Bernice

Bernice is a multilingual pre-trained encoder exclusively for Twitter data. The model was released with the EMNLP 2022 paper Bernice: A Multilingual Pre-trained Encoder for Twitter by Alexandra DeLucia, Shijie Wu, Aaron Mueller, Carlos Aguirre, Mark Dredze, and Philip Resnik.

Please reach out to Alexandra DeLucia (aadelucia at jhu.edu) or open an issue if there are questions.

Model description

The language of Twitter differs significantly from that of other domains commonly included in large language model training. While tweets are typically multilingual and contain informal language, including emoji and hashtags, most pre-trained language models for Twitter are either monolingual, adapted from other domains rather than trained exclusively on Twitter, or are trained on a limited amount of in-domain Twitter data. We introduce Bernice, the first multilingual RoBERTa language model trained from scratch on 2.5 billion tweets with a custom tweet-focused tokenizer. We evaluate on a variety of monolingual and multilingual Twitter benchmarks, finding that our model consistently exceeds or matches the performance of a variety of models adapted to social media data as well as strong multilingual baselines, despite being trained on less data overall. We posit that it is more efficient compute- and data-wise to train completely on in-domain data with a specialized domain-specific tokenizer.

Training data

2.5 billion tweets with 56 billion subwords in 66 languages (as identified in Twitter metadata). The tweets are collected from the 1% public Twitter stream between January 2016 and December 2021. See Bernice pretrain dataset for details.

Training procedure

RoBERTa pre-training (i.e., masked language modeling) with BERT-base architecture.

Evaluation results

We evaluated Bernice on three Twitter benchmarks: TweetEval, Unified Multilingual Sentiment Analysis Benchmark (UMSAB), and Multilingual Hate Speech. Summary results are shown below, see the paper appendix for details.

BerniceBERTweetXLM-RXLM-TTwHIN-BERT-MLMTwHIN-BERT
TweetEval64.8067.9057.6064.4064.8063.10
UMSAB70.34-67.7166.7468.1067.53
Hate Speech76.20-74.5473.3173.4174.32

How to use

You can use this model for tweet representation. To use with HuggingFace PyTorch interface:

from transformers import AutoTokenizer, AutoModel
import re

# Load model
model = AutoModel("jhu-clsp/bernice")
tokenizer = AutoTokenizer.from_pretrained("jhu-clsp/bernice", model_max_length=128)

# Data
raw_tweets = [
  "So, Nintendo and Illimination's upcoming animated #SuperMarioBrosMovie is reportedly titled 'The Super Mario Bros. Movie'. Alrighty. :)",
  "AMLO se vio muy indignado porque propusieron al presidente de Ucrania para el premio nobel de la paz. ¿Qué no hay otros que luchen por la paz? ¿Acaso se quería proponer él?"
]

# Pre-process tweets for tokenizer
URL_RE = re.compile(r"https?:\/\/[\w\.\/\?\=\d&#%_:/-]+")
HANDLE_RE = re.compile(r"@\w+")
tweets = []
for t in raw_tweets:
  t = HANDLE_RE.sub("@USER", t)
  t = URL_RE.sub("HTTPURL", t)
  tweets.append(t)

with torch.no_grad():
  embeddings = model(tweets)

Limitations and bias

Presence of Hate Speech: As with all social media data, there exists spam and hate speech. We cleaned our data by filtering for tweet length, but the possibility of this spam remains. Hate speech is difficult to detect, especially across languages and cultures thus we leave its removal for future work.

Low-resource Language Evaluation: Within languages, even with language sampling during training, Bernice is still not exposed to the same variety of examples in low-resource languages as high-resource languages like English and Spanish. It is unclear whether enough Twitter data exists in these languages, such as Tibetan and Telugu, to ever match the performance on high-resource languages. Only models more efficient at generalizing can pave the way for better performance in the wide variety of languages in this low-resource category.

See the paper for a more detailed discussion.

BibTeX entry and citation info

@inproceedings{delucia-etal-2022-bernice,
    title = "Bernice: A Multilingual Pre-trained Encoder for {T}witter",
    author = "DeLucia, Alexandra  and
      Wu, Shijie  and
      Mueller, Aaron  and
      Aguirre, Carlos  and
      Resnik, Philip  and
      Dredze, Mark",
    booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
    month = dec,
    year = "2022",
    address = "Abu Dhabi, United Arab Emirates",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2022.emnlp-main.415",
    pages = "6191--6205",
    abstract = "The language of Twitter differs significantly from that of other domains commonly included in large language model training. While tweets are typically multilingual and contain informal language, including emoji and hashtags, most pre-trained language models for Twitter are either monolingual, adapted from other domains rather than trained exclusively on Twitter, or are trained on a limited amount of in-domain Twitter data.We introduce Bernice, the first multilingual RoBERTa language model trained from scratch on 2.5 billion tweets with a custom tweet-focused tokenizer. We evaluate on a variety of monolingual and multilingual Twitter benchmarks, finding that our model consistently exceeds or matches the performance of a variety of models adapted to social media data as well as strong multilingual baselines, despite being trained on less data overall.We posit that it is more efficient compute- and data-wise to train completely on in-domain data with a specialized domain-specific tokenizer.",
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей