Zero-Shot Classification
sentence-transformers
PyTorch
JAX
ONNX
Safetensors
OpenVINO
Transformers
English
roberta
text-classification
Instructions to use cross-encoder/nli-roberta-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use cross-encoder/nli-roberta-base with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("cross-encoder/nli-roberta-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-roberta-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="cross-encoder/nli-roberta-base")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("cross-encoder/nli-roberta-base") model = AutoModelForSequenceClassification.from_pretrained("cross-encoder/nli-roberta-base") - Notebooks
- Google Colab
- Kaggle
VORTEXRAG: 7-Layer RAG — Causal Drift Filtering + Context Poison Guard [paper + code + demo]
#4
by vigneshwar234 - opened
Relevant for anyone researching hallucination and faithfulness in RAG.
VORTEXRAG attacks hallucination at two stages — retrieval and generation:
- Retrieval stage: SDC layer scores causal drift (SDS = 1−tanh(‖D‖/τ)) and rejects chunks drifting from query causality. CPG layer purges context until Effective Signal Ratio ≥ 3.5.
- Generation stage: FV layer computes ΔR = 1−ROUGE-L×NLI ≤ 0.15. If violated, it reranks context and retries up to 3×.
Faithfulness results: 0.94 (vs Self-RAG 0.81, Naive RAG 0.71). Semantic Drift Rate: 14% (down from 36%). Context Poisoning Rate: 7% (down from 24%).
The FV layer uses DeBERTa-v3-small CrossEncoder for NLI — same family as models on this repo.
Paper: https://doi.org/10.5281/zenodo.20579702
Code (MIT, 229 tests): https://github.com/vignesh2027/VORTEXRAG
Demo: https://huggingface.co/spaces/vigneshwar234/VORTEXRAG