模型:

KBLab/megatron-bert-large-swedish-cased-165-zero-shot

英文

Megatron-BERT-large Swedish 165k零样本分类

此模型基于Megatron-BERT-large-165k( https://huggingface.co/KBLab/megatron-bert-large-swedish-cased-165k )。它在QNLI任务上进行了微调,然后在MNLI任务上进一步微调。该模型可与Hugging Face的零样本分类流程一起使用。

用法

>>> from transformers import pipeline
>>> classifier = pipeline(
...     "zero-shot-classification",
...     model="KBlab/megatron-bert-large-swedish-cased-165-zero-shot"
... )
>>> classifier(
...     "Ruben Östlunds ”Triangle of sadness” nomineras till en Golden Globe i kategorin bästa musikal eller komedi.",
...     candidate_labels=["hälsa", "politik", "sport", "religion", "nöje"],
...     hypothesis_template="Detta exempel handlar om {}.",
... )
{'sequence': 'Ruben Östlunds ”Triangle of sadness” nomineras till en Golden Globe i kategorin bästa musikal eller komedi.',
 'labels': ['nöje', 'sport', 'religion', 'hälsa', 'politik'],
 'scores': [0.9274595379829407,
  0.025105971843004227,
  0.018440095707774162,
  0.017049923539161682,
  0.011944468133151531]}