nyu-mll/multi_nli
Viewer • Updated • 412k • 12.8k • 112
How to use chincyk/deberta-v3-base-nli with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="chincyk/deberta-v3-base-nli") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("chincyk/deberta-v3-base-nli")
model = AutoModelForSequenceClassification.from_pretrained("chincyk/deberta-v3-base-nli")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}")
Base model
microsoft/deberta-v3-base