Zero-Shot Classification
sentence-transformers
PyTorch
ONNX
Safetensors
OpenVINO
Transformers
English
roberta
text-classification
Instructions to use cross-encoder/nli-MiniLM2-L6-H768 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use cross-encoder/nli-MiniLM2-L6-H768 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("cross-encoder/nli-MiniLM2-L6-H768") 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-MiniLM2-L6-H768 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="cross-encoder/nli-MiniLM2-L6-H768")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("cross-encoder/nli-MiniLM2-L6-H768") model = AutoModelForSequenceClassification.from_pretrained("cross-encoder/nli-MiniLM2-L6-H768", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 134 Bytes
26940a7 | 1 2 3 4 | version https://git-lfs.github.com/spec/v1
oid sha256:1e320643f4e1dec3a1d2d2566b3b1e61b13427b106281442ccf862a39efae820
size 328507853
|