🚀 用于零样本分类的瑞典语Megatron - BERT - large 165k模型
本模型基于Megatron - BERT - large - 165k(https://huggingface.co/KBLab/megatron - bert - large - swedish - cased - 165k)构建。它在QNLI任务上进行了微调,并在MNLI任务上进一步微调。该模型可与Hugging Face的零样本分类管道一起使用。
你可以在我们的[博客](https://kb - labb.github.io/posts/2023 - 02 - 12 - zero - shot - text - classification/)上了解更多关于此模型的信息。
🚀 快速开始
本模型基于Megatron - BERT - large - 165k构建,经过QNLI和MNLI任务的微调,可用于零样本分类。
✨ 主要特性
- 基于Megatron - BERT - large - 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]}
📚 详细文档
你可以在我们的[博客](https://kb - labb.github.io/posts/2023 - 02 - 12 - zero - shot - text - classification/)上了解更多关于此模型的信息。
📄 许可证
文档未提供许可证信息,跳过此章节。
📚 引用
@misc{sikora2023swedish,
author = {Sikora, Justyna},
title = {The KBLab Blog: Swedish zero-shot classification model},
url = {https://kb-labb.github.io/posts/2023-02-12-zero-shot-text-classification/},
year = {2023}
}