🚀 DeBERTa-v3-large-mnli
本模型主要用於文本分類和零樣本分類任務,通過在MultiNLI數據集上進行訓練,能夠有效處理文本蘊含信息,在自然語言理解方面具有較高的準確性。
🚀 快速開始
下面是一個使用該模型進行文本蘊含預測的示例代碼:
premise = "The Movie have been criticized for the story. However, I think it is a great movie."
hypothesis = "I liked the movie."
input = tokenizer(premise, hypothesis, truncation=True, return_tensors="pt")
output = model(input["input_ids"].to(device))
prediction = torch.softmax(output["logits"][0], -1)
label_names = ["entailment", "neutral", "contradiction"]
print(label_names[prediction.argmax(0).tolist()])
✨ 主要特性
- 該模型在Multi - Genre Natural Language Inference (MultiNLI)數據集上進行訓練,此數據集包含433k句子對的文本蘊含信息。
- 採用了微軟的DeBERTa - v3 - large模型,通過解耦注意力和增強掩碼解碼器,在大多數NLU基準測試中優於Bert和RoBERTa的結果。
📚 詳細文檔
模型描述
此模型在Multi - Genre Natural Language Inference (MultiNLI)數據集上進行訓練,該數據集由433k句子對的文本蘊含信息組成。所使用的模型是微軟的DeBERTa - v3 - large。v3版本的DeBERTa通過使用解耦注意力和增強掩碼解碼器,在大多數NLU基準測試中優於Bert和RoBERTa的結果。有關原始模型的更多信息,請參閱官方倉庫和論文。
預期用途和限制
如何使用模型
示例代碼展示瞭如何使用該模型進行文本蘊含預測,具體代碼如下:
premise = "The Movie have been criticized for the story. However, I think it is a great movie."
hypothesis = "I liked the movie."
input = tokenizer(premise, hypothesis, truncation=True, return_tensors="pt")
output = model(input["input_ids"].to(device))
prediction = torch.softmax(output["logits"][0], -1)
label_names = ["entailment", "neutral", "contradiction"]
print(label_names[prediction.argmax(0).tolist()])
訓練數據
該模型在MultiNLI數據集上進行訓練,該數據集由392K句子的文本蘊含信息組成。
訓練過程
DeBERTa - v3 - large - mnli使用Hugging Face訓練器進行訓練,使用了以下超參數:
train_args = TrainingArguments(
learning_rate=2e-5,
per_device_train_batch_size=8,
per_device_eval_batch_size=8,
num_train_epochs=3,
warmup_ratio=0.06,
weight_decay=0.1,
fp16=True,
seed=42,
)
BibTeX引用和引用信息
如果您使用此模型,請引用DeBERTa論文和MultiNLI數據集,幷包含此Huggingface倉庫。
信息表格
屬性 |
詳情 |
模型類型 |
DeBERTa - v3 - large - mnli |
訓練數據 |
MultiNLI數據集,包含392K句子的文本蘊含信息 |