🚀 用於零樣本分類的瑞典語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}
}