Zero-Shot Classification
sentence-transformers
PyTorch
JAX
ONNX
Safetensors
OpenVINO
Transformers
English
roberta
text-classification
Run this model with HF Jobs
Run cross-encoder/nli-distilroberta-base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/cross-encoder/nli-distilroberta-base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/cross-encoder/nli-distilroberta-base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use cross-encoder/nli-distilroberta-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use cross-encoder/nli-distilroberta-base with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("cross-encoder/nli-distilroberta-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-distilroberta-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="cross-encoder/nli-distilroberta-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("cross-encoder/nli-distilroberta-base") model = AutoModelForSequenceClassification.from_pretrained("cross-encoder/nli-distilroberta-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update model metadata
Browse files1 unmodified line23456789101112131448 unmodified lines636465661 unmodified linelanguage: enpipeline_tag: zero-shot-classificationtags:- distilroberta-basedatasets:- multi_nli- snlimetrics:- accuracylicense: apache-2.0---# Cross-Encoder for Natural Language Inference48 unmodified linescandidate_labels = ["technology", "sports", "politics"]res = classifier(sent, candidate_labels)print(res)```1 unmodified line23456789101112131415161748 unmodified lines666768691 unmodified linelanguage: enpipeline_tag: zero-shot-classificationtags:- transformersdatasets:- nyu-mll/multi_nli- stanfordnlp/snlimetrics:- accuracylicense: apache-2.0base_model:- distilbert/distilroberta-baselibrary_name: sentence-transformers---# Cross-Encoder for Natural Language Inference48 unmodified linescandidate_labels = ["technology", "sports", "politics"]res = classifier(sent, candidate_labels)print(res)```
README.md+7-4