🚀 deberta-v3-large-zeroshot-v1
このモデルは、Hugging Faceパイプラインを用いたゼロショット分類に特化しています。Hugging Faceハブ上の他のゼロショットモデルよりも、ゼロショット分類タスクで優れた性能を発揮します。
🚀 クイックスタート
このモデルは、与えられたテキストに基づいて、仮説が true
または not_true
であるかを判断することができます。このタスク形式は、自然言語推論タスク(NLI)に基づいています。
✨ 主な機能
- ゼロショット分類に特化したモデルです。
- 様々な分類タスクを、仮説の真偽判断タスクに変換して処理することができます。
📦 インストール
このモデルはHugging Faceのパイプラインを通じて使用できます。以下のコードで簡単にインストールできます。
from transformers import pipeline
classifier = pipeline("zero-shot-classification", model="MoritzLaurer/deberta-v3-large-zeroshot-v1")
💻 使用例
基本的な使用法
from transformers import pipeline
classifier = pipeline("zero-shot-classification", model="MoritzLaurer/deberta-v3-large-zeroshot-v1")
sequence_to_classify = "Angela Merkel is a politician in Germany and leader of the CDU"
candidate_labels = ["politics", "economy", "entertainment", "environment"]
output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
print(output)
高度な使用法
このモデルは、ゼロショット分類タスクにおいて、多様なラベルを用いた分類が可能です。また、multi_label
パラメータを True
に設定することで、複数のラベルを同時に予測することもできます。
📚 ドキュメント
データとトレーニングの詳細
データの準備、モデルのトレーニングと評価に関するコードは、すべてオープンソースで公開されています。詳細はこちらを参照してください。
https://github.com/MoritzLaurer/zeroshot-classifier/tree/main
制限事項とバイアス
このモデルは、テキスト分類タスクのみを行うことができます。潜在的なバイアスについては、元のDeBERTa論文および各データセットの論文を参照してください。
🔧 技術詳細
トレーニングデータ
このモデルは、27のタスクと310のクラスを混合したデータセットでトレーニングされています。
- 約400kのテキストを含む26の分類タスク
- 'amazonpolarity', 'imdb', 'appreviews', 'yelpreviews', 'rottentomatoes',
- 'emotiondair', 'emocontext', 'empathetic',
- 'financialphrasebank', 'banking77', 'massive',
- 'wikitoxic_toxicaggregated', 'wikitoxic_obscene', 'wikitoxic_threat', 'wikitoxic_insult', 'wikitoxic_identityhate',
- 'hateoffensive', 'hatexplain', 'biasframes_offensive', 'biasframes_sex', 'biasframes_intent',
- 'agnews', 'yahootopics',
- 'trueteacher', 'spam', 'wellformedquery'.
各データセットの詳細はこちらを参照してください。
https://docs.google.com/spreadsheets/d/1Z18tMh02IiWgh6o8pfoMiI_LH4IXpr78wd_nmNd5FaE/edit?usp=sharing
- 約885kのテキストを含む5つのNLIデータセット
- "mnli", "anli", "fever", "wanli", "ling"
他のNLIモデルとは異なり、このモデルは2つのクラス(entailment
と not_entailment
)を予測します。
📄 ライセンス
ベースモデル(DeBERTa-v3)は、MITライセンスの下で公開されています。モデルがファインチューニングされたデータセットは、様々なライセンスの下で公開されています。ファインチューニングに使用された非NLIデータセットのライセンス情報などは、以下のスプレッドシートを参照してください。
https://docs.google.com/spreadsheets/d/1Z18tMh02IiWgh6o8pfoMiI_LH4IXpr78wd_nmNd5FaE/edit?usp=sharing
また、このモデルは、MNLI、ANLI、WANLI、LING-NLI、FEVER-NLIなどのNLIデータセットでもトレーニングされています。
引用
このモデルを使用する場合は、以下の文献を引用してください。
@article{laurer_less_2023,
title = {Less {Annotating}, {More} {Classifying}: {Addressing} the {Data} {Scarcity} {Issue} of {Supervised} {Machine} {Learning} with {Deep} {Transfer} {Learning} and {BERT}-{NLI}},
issn = {1047-1987, 1476-4989},
shorttitle = {Less {Annotating}, {More} {Classifying}},
url = {https://www.cambridge.org/core/product/identifier/S1047198723000207/type/journal_article},
doi = {10.1017/pan.2023.20},
language = {en},
urldate = {2023-06-20},
journal = {Political Analysis},
author = {Laurer, Moritz and Van Atteveldt, Wouter and Casas, Andreu and Welbers, Kasper},
month = jun,
year = {2023},
pages = {1--33},
}
コラボレーションのアイデアや質問は?
コラボレーションのアイデアや質問がある場合は、m{dot}laurer{at}vu{dot}nl または LinkedIn までご連絡ください。
デバッグと問題点
DeBERTa-v3は2021年12月6日にリリースされました。古いバージョンのHF Transformersでは、このモデルを実行する際に問題が発生する場合があります(例えば、トークナイザに関する問題)。Transformers >= 4.13を使用することで、一部の問題を解決できる可能性があります。