Zero-Shot Classification
sentence-transformers
PyTorch
ONNX
Safetensors
Transformers
English
deberta-v2
text-classification
Instructions to use cross-encoder/nli-deberta-v3-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use cross-encoder/nli-deberta-v3-base with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("cross-encoder/nli-deberta-v3-base") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Transformers
How to use cross-encoder/nli-deberta-v3-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="cross-encoder/nli-deberta-v3-base")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("cross-encoder/nli-deberta-v3-base") model = AutoModelForSequenceClassification.from_pretrained("cross-encoder/nli-deberta-v3-base") - Notebooks
- Google Colab
- Kaggle
| { | |
| "added_tokens_decoder": { | |
| "0": { | |
| "content": "[PAD]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "1": { | |
| "content": "[CLS]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "2": { | |
| "content": "[SEP]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "3": { | |
| "content": "[UNK]", | |
| "lstrip": false, | |
| "normalized": true, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "128000": { | |
| "content": "[MASK]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| } | |
| }, | |
| "bos_token": "[CLS]", | |
| "clean_up_tokenization_spaces": false, | |
| "cls_token": "[CLS]", | |
| "do_lower_case": false, | |
| "eos_token": "[SEP]", | |
| "extra_special_tokens": {}, | |
| "mask_token": "[MASK]", | |
| "model_max_length": 512, | |
| "pad_token": "[PAD]", | |
| "sep_token": "[SEP]", | |
| "sp_model_kwargs": {}, | |
| "split_by_punct": false, | |
| "tokenizer_class": "DebertaV2Tokenizer", | |
| "unk_token": "[UNK]", | |
| "vocab_type": "spm" | |
| } | |