🚀 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句子的文本蕴含信息 |