/ Модель

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

Параметры
660 млн
Лицензия
BigScience BLOOM RAIL 1.0
Архитектура
bloom · dense
Опубликована
17 мар 2024

bloomz-560m-nli

Классификация текстаТекст → label5 профессий

Дообученная BloomZ-560m модель для распознавания текстового следования и классификации текстов по заданным меткам без отдельного обучения.

4 066скачиваний за 30 дней1лайквеса обновлены22 мар 2024

Бенчмарки

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

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

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

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

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

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

cmarkea/bloomz-560m-nli — модель классификации текстов на основе BloomZ-560m, дообученная командой cmarkea на задаче распознавания текстового следования (NLI) от Bloomz-560m-chat-dpo. Она определяет, противоречит ли гипотеза посылке, следует ли из неё или нейтральна к ней; этот подход также позволяет классифицировать тексты по произвольным меткам без отдельного обучения, сопоставляя текст с формулировками гипотез для каждого класса.

Модель содержит около 659,6 млн параметров и предназначена для задач классификации, в том числе анализа тональности и тематической категоризации. В обучении использовались пары посылок и гипотез на английском и французском языках, включая комбинации языков. В README приведены результаты на NLI и французских отзывах, но они уступают ряду специализированных моделей в указанных сравнениях. Модель опубликована в форматах PyTorch и Safetensors под лицензией BigScience BLOOM RAIL 1.0; следует учитывать её условия использования и ограничения.

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

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

Ограничения

В приведённых сравнениях на французских отзывах модель уступает специализированным NLI-моделям; опубликованные результаты ограничены указанными датасетами и сценариями. Лицензия BigScience BLOOM RAIL 1.0 устанавливает условия использования.

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

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

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

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

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

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

Открыть на Hugging Face

Presentation

We introduce the Bloomz-560m-NLI model, fine-tuned from the Bloomz-560m-chat-dpo foundation model. This model is trained on a Natural Language Inference (NLI) task in a language-agnostic manner. The NLI task involves determining the semantic relationship between a hypothesis and a set of premises, often expressed as pairs of sentences.

The goal is to predict textual entailment (does sentence A imply/contradict/neither sentence B?) and is a classification task (given two sentences, predict one of the three labels). If sentence A is called premise, and sentence B is called hypothesis, then the goal of the modelization is to estimate the following: $$P(premise=c\in{contradiction, entailment, neutral}\vert hypothesis)$$

Language-agnostic approach

It should be noted that hypotheses and premises are randomly chosen between English and French, with each language combination representing a probability of 25%.

Performance

classprecision (%)f1-score (%)support
global69.2068.355,010
contradiction63.6670.601,670
entailment73.4573.011,670
neutral70.7561.451,670

Benchmark

Here are the performances for both the hypothesis and premise in French:

modelaccuracy (%)MCC (x100)
cmarkea/distilcamembert-base-nli77.4566.24
BaptisteDoyen/camembert-base-xnli81.7272.67
MoritzLaurer/mDeBERTa-v3-base-mnli-xnli83.4375.15
cmarkea/bloomz-560m-nli68.7053.57
cmarkea/bloomz-3b-nli81.0871.66
cmarkea/bloomz-7b1-mt-nli83.1374.89

And now the hypothesis in French and the premise in English (cross-language context):

modelaccuracy (%)MCC (x100)
cmarkea/distilcamembert-base-nli16.89-26.82
BaptisteDoyen/camembert-base-xnli74.5961.97
MoritzLaurer/mDeBERTa-v3-base-mnli-xnli85.1577.74
cmarkea/bloomz-560m-nli68.8453.55
cmarkea/bloomz-3b-nli82.1273.22
cmarkea/bloomz-7b1-mt-nli85.4378.25

Zero-shot Classification

The primary interest of training such models lies in their zero-shot classification performance. This means that the model is able to classify any text with any label without a specific training. What sets the Bloomz-560m-NLI LLMs apart in this domain is their ability to model and extract information from significantly more complex and lengthy text structures compared to models like BERT, RoBERTa, or CamemBERT.

The zero-shot classification task can be summarized by: $$P(hypothesis=i\in\mathcal{C}|premise)=\frac{e^{P(premise=entailment\vert hypothesis=i)}}{\sum_{j\in\mathcal{C}}e^{P(premise=entailment\vert hypothesis=j)}}$$ With i representing a hypothesis composed of a template (for example, "This text is about {}.") and #C candidate labels ("cinema", "politics", etc.), the set of hypotheses is composed of {"This text is about cinema.", "This text is about politics.", ...}. It is these hypotheses that we will measure against the premise, which is the sentence we aim to classify.

Performance

The model is evaluated based on sentiment analysis evaluation on the French film review site Allociné. The dataset is labeled into 2 classes, positive comments and negative comments in 20,000 reviews. We then use the hypothesis template "Ce commentaire est {}." and the candidate classes "positif" and "negatif".

modelaccuracy (%)MCC (x100)
cmarkea/distilcamembert-base-nli80.5963.71
BaptisteDoyen/camembert-base-xnli86.3773.74
MoritzLaurer/mDeBERTa-v3-base-mnli-xnli84.9770.05
cmarkea/bloomz-560m-nli71.1346.3
cmarkea/bloomz-3b-nli89.0678.10
cmarkea/bloomz-7b1-mt-nli95.1290.27

How to use Bloomz-560m-NLI

from transformers import pipeline

classifier = pipeline(
    task='zero-shot-classification',
    model="cmarkea/bloomz-560m-nli"
)
result = classifier (
    sequences="Le style très cinéphile de Quentin Tarantino "
    "se reconnaît entre autres par sa narration postmoderne "
    "et non linéaire, ses dialogues travaillés souvent "
    "émaillés de références à la culture populaire, et ses "
    "scènes hautement esthétiques mais d'une violence "
    "extrême, inspirées de films d'exploitation, d'arts "
    "martiaux ou de western spaghetti.",
    candidate_labels="cinéma, technologie, littérature, politique",
    hypothesis_template="Ce texte parle de {}."
)

result
{"labels": ["cinéma",
            "littérature",
            "technologie",
            "politique"],
 "scores": [0.6797838807106018,
            0.1440986692905426,
            0.09773541986942291,
            0.07838203758001328]}

# Resilience in cross-language French/English context
result = classifier (
    sequences="Quentin Tarantino's very cinephile style is "
    "recognized, among other things, by his postmodern and "
    "non-linear narration, his elaborate dialogues often "
    "peppered with references to popular culture, and his "
    "highly aesthetic but extremely violent scenes, inspired by "
    "exploitation films, martial arts or spaghetti western.",
    candidate_labels="cinéma, technologie, littérature, politique",
    hypothesis_template="Ce texte parle de {}."
)

result
{"labels": ["cinéma",
            "littérature",
            "technologie",
            "politique"],
 "scores": [0.6970456838607788,
            0.17720822989940643,
            0.06449680775403976,
            0.0612492673099041]}

Citation

@online{DeBloomzNLI,
  AUTHOR = {Cyrile Delestre},
  URL = {https://huggingface.co/cmarkea/bloomz-560m-nli},
  YEAR = {2024},
  KEYWORDS = {NLP ; Transformers ; LLM ; Bloomz},
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей