Text Classification
Transformers
Safetensors
English
deberta-v2
natural-language-inference
nli
text-embeddings-inference
Instructions to use chincyk/deberta-v3-base-nli with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
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")# pip install -U transformers accelerate # 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", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from chincyk/deberta-v3-base-nli: direct link, hf CLI and curl.
- Browser
- Download file 1.65 kB
-
https://huggingface.co/chincyk/deberta-v3-base-nli/resolve/main/README.md
- Command line
-
hf download hf://chincyk/deberta-v3-base-nli/README.md
-
curl -L -o README.md https://huggingface.co/chincyk/deberta-v3-base-nli/resolve/main/README.md
1.65 kB
metadata
library_name: transformers
tags:
- natural-language-inference
- nli
license: mit
datasets:
- nyu-mll/multi_nli
language:
- en
base_model: microsoft/deberta-v3-base
deberta v3 base - Natural Language Inference
Model overview
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.
Results
After fine-tuning on the dataset, the model achieved the following results:
- Loss: 0.276
- Accuracy: 0.899
- F1-Score: 0.899
These metrics were evaluated on the validation_mismatched split of the dataset.
Usage
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}")