File size: 2,070 Bytes
ea31ad4 16ad9d0 14990b2 d770fea 14990b2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
---
license: bigscience-bloom-rail-1.0
datasets:
- xnli
language:
- fr
- en
pipeline_tag: zero-shot-classification
---
## Presentation
We introduce the Bloomz-560m-NLI model, fine-tuned on the [Bloomz-560m-chat-dpo](https://huggingface.co/cmarkea/bloomz-560m-dpo-chat) 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. It should be noted that hypotheses and premises are randomly chosen between English and French, with each language combination representing a probability of 25%.
## Zero-shot Classification
The primary appeal of training such models lies in their zero-shot classification performance. This means the model is capable of classifying any text with any label without specific training. What sets the Bloomz-560m-NLI LLMs apart in this realm is their ability to model and extract information from significantly more complex and lengthy test structures compared to models like BERT, RoBERTa, or CamemBERT.
```python
from transformers import pipeline
classifier = pipeline(
task='zero-shot-classification',
model="cmarkea/bloomz-3b-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]}
``` |