Downloads · 30 days
10
2% of all-time downloads
zayn1111/deberta-v3-dnli
deberta-v3-dnli is a text classification model from zayn1111. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model is trained on Dialogue-NLI. Test Result:
Downloads · 30 days
10
2% of all-time downloads
All-time downloads
484
Public
Parameters
435M
5.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.7 GB · 100%
From the Hugging Face model README
This model is trained on Dialogue-NLI. Test Result:
| Accuracy | |
|---|---|
| dev | 89.44 |
| test | 91.22 |
| verified_test | 95.36 |
To use this model:
import torch
import numpy as np
from transformers import AutoTokenizer, AutoModelForSequenceClassification
device = "cuda"
model_path = "zayn1111/deberta-v3-dnli"
tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False, model_max_length=512)
model = AutoModelForSequenceClassification.from_pretrained(model_path).to(device)
premise = "i work with a lot of kids in the healthcare industry ."
hypothesis = "i work in the healthcare industry ."
input = tokenizer(premise, hypothesis, truncation=True, return_tensors="pt")
output = model(input["input_ids"].to(device))
prediction = torch.softmax(output["logits"][0], -1).tolist()
label_names = ["entailment", "neutral", "contradiction"]
prediction = {name: round(float(pred) * 100, 1) for pred, name in zip(prediction, label_names)}
print(prediction)