Downloads · 30 days
10
1% of all-time downloads
chincyk/deberta-v3-base-nli
deberta-v3-base-nli is a text classification model from chincyk. 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 for the Natural Language Inference task. It takes two sentences as input (a premise and a hypothesis) and predicts the relationship between them by assigning one of three labels: "entailment," "n…
Downloads · 30 days
10
1% of all-time downloads
All-time downloads
1.2K
Public
Parameters
184M
738 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors738 MB · 99%
From the Hugging Face model README
This model is trained for the Natural Language Inference task. It takes two sentences as input (a premise and a hypothesis) and predicts the relationship between them by assigning one of three labels: "entailment," "neutral," or "contradiction." The model is based on the microsoft/deberta-v3-base model, fine-tuned on the nyu-mll/multi_nli dataset, and returns scores corresponding to the labels.
After fine-tuning on the dataset, the model achieved the following results:
These metrics were evaluated on the validation_mismatched split of the dataset.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "chincyk/deberta-v3-base-nli"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
premise = "The flight arrived on time at the airport."
hypothesis = "The flight was delayed by several hours."
inputs = tokenizer(premise, hypothesis, return_tensors='pt')
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
probs = torch.softmax(logits, dim=-1).squeeze()
id2label = model.config.id2label
for i, prob in enumerate(probs):
print(f"{id2label[i]}: {prob:.4f}")