/ Модель

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

Контекст
16 384 токена
Параметры
113 млн
Лицензия
Apache 2.0
Архитектура
canine · dense
Опубликована
2 мар 2022

canine-s

ЭмбеддингиТекст → embedding7 профессий

Многоязычная символьная модель Google для извлечения признаков и последующей настройки на задачи понимания текста.

25 248скачиваний за 30 дней33лайкавеса обновлены29 апр 2024

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Эмбеддинги» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

CANINE-s — многоязычная предварительно обученная модель Google для представления текста. Она использует архитектуру CANINE и принимает текст на уровне символов: вместо отдельного токенизатора символы представляются кодовыми точками Unicode. Модель содержит 113,2 млн параметров и обучалась на 104 языках с целями masked language modeling и предсказания следующего предложения; для masked language modeling применялся subword loss. В метаданных указан контекст до 16 384 токенов.

Модель предназначена прежде всего для извлечения признаков, которые затем используют в задачах классификации последовательностей и токенов, ответов на вопросы и других задачах понимания текста. Она может работать с многоязычными текстами, включая языки с разными письменностями, без предварительной настройки границ токенов. Для генерации текста модель не предназначена. Распространяется по лицензии Apache-2.0.

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

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

Ограничения

Предназначена в основном для последующей настройки на задачи понимания текста и сама по себе не подходит для генерации текста. Для практической точности на конкретной задаче может потребоваться дообучение.

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

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

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

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

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

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

Открыть на Hugging Face

CANINE-s (CANINE pre-trained with subword loss)

Pretrained CANINE model on 104 languages using a masked language modeling (MLM) objective. It was introduced in the paper CANINE: Pre-training an Efficient Tokenization-Free Encoder for Language Representation and first released in this repository.

What's special about CANINE is that it doesn't require an explicit tokenizer (such as WordPiece or SentencePiece) as other models like BERT and RoBERTa. Instead, it directly operates at a character level: each character is turned into its Unicode code point.

This means that input processing is trivial and can typically be accomplished as:

input_ids = [ord(char) for char in text]

The ord() function is part of Python, and turns each character into its Unicode code point.

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

Model description

CANINE is a transformers model pretrained on a large corpus of multilingual data in a self-supervised fashion, similar to BERT. 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 two objectives:

  • Masked language modeling (MLM): one randomly masks part of the inputs, which the model needs to predict. This model (CANINE-s) is trained with a subword loss, meaning that the model needs to predict the identities of subword tokens, while taking characters as input. By reading characters yet predicting subword tokens, the hard token boundary constraint found in other models such as BERT is turned into a soft inductive bias in CANINE.
  • Next sentence prediction (NSP): the model concatenates two sentences as inputs during pretraining. Sometimes they correspond to sentences that were next to each other in the original text, sometimes not. The model then has to predict if the two sentences were following each other or not.

This way, the model learns an inner representation of multiple 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 CANINE model as inputs.

Intended uses & limitations

You can use the raw model for either masked language modeling or next sentence prediction, 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.

How to use

Here is how to use this model:

from transformers import CanineTokenizer, CanineModel

model = CanineModel.from_pretrained('google/canine-s')
tokenizer = CanineTokenizer.from_pretrained('google/canine-s')

inputs = ["Life is like a box of chocolates.", "You never know what you gonna get."]
encoding = tokenizer(inputs, padding="longest", truncation=True, return_tensors="pt")

outputs = model(**encoding) # forward pass
pooled_output = outputs.pooler_output
sequence_output = outputs.last_hidden_state

Training data

The CANINE model was pretrained on on the multilingual Wikipedia data of mBERT, which includes 104 languages.

BibTeX entry and citation info

@article{DBLP:journals/corr/abs-2103-06874,
  author    = {Jonathan H. Clark and
               Dan Garrette and
               Iulia Turc and
               John Wieting},
  title     = {{CANINE:} Pre-training an Efficient Tokenization-Free Encoder for
               Language Representation},
  journal   = {CoRR},
  volume    = {abs/2103.06874},
  year      = {2021},
  url       = {https://arxiv.org/abs/2103.06874},
  archivePrefix = {arXiv},
  eprint    = {2103.06874},
  timestamp = {Tue, 16 Mar 2021 11:26:59 +0100},
  biburl    = {https://dblp.org/rec/journals/corr/abs-2103-06874.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

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

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

GPU в ailist

Универсальный рантайм

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

Подбираем GPU…

Класс архитектуры
CanineModel
Ревизия весов
75d6d0b

0 моделей