ONNX Model Zoo

cross-encoder/qnli-distilroberta-base

By cross-encoder · ↓ 3.9K · ♥ 0 · Updated 2025-04-11

What's in this repo

This page lists the files in cross-encoder/qnli-distilroberta-base, including model.onnx, model_O1.onnx, model_O2.onnx and more.

  • 9 ONNX models (.onnx files)
  • 25 files, including 9 .onnx, 5 .json, 3 .bin, 2 .xml, 1 .csv, 1 .md
  • Repository size ~3.0 GB
  • Last updated 2025-04-11

ONNX files

File Size Download
onnx/model.onnx 313 MB Download
onnx/model_O1.onnx 313 MB Download
onnx/model_O2.onnx 313 MB Download
onnx/model_O3.onnx 313 MB Download
onnx/model_O4.onnx 157 MB Download
onnx/model_qint8_arm64.onnx 79.0 MB Download
onnx/model_qint8_avx512.onnx 79.0 MB Download
onnx/model_qint8_avx512_vnni.onnx 79.0 MB Download
onnx/model_quint8_avx2.onnx 79.0 MB Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

Cross-Encoder for SQuAD (QNLI)

This model was trained using SentenceTransformers Cross-Encoder class.

Training Data

Given a question and paragraph, can the question be answered by the paragraph? The models have been trained on the GLUE QNLI dataset, which transformed the SQuAD dataset into an NLI task.

Performance

For performance results of this model, see [SBERT.net Pre-trained Cross-Encoder][https://www.sbert.net/docs/pretrained_cross-encoders.html].

Usage

Pre-trained models can be used like this:

from sentence_transformers import CrossEncoder

model = CrossEncoder('cross-encoder/qnli-distilroberta-base')
scores = model.predict([('Query1', 'Paragraph1'), ('Query2', 'Paragraph2')])

#e.g.
scores = model.predict([('How many people live in Berlin?', 'Berlin had a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.'), ('What is the size of New York?', 'New York City is famous for the Metropolitan Museum of Art.')])

Usage with Transformers AutoModel

You can use the model also directly with Transformers library (without SentenceTransformers library):

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model = AutoModelForSequenceClassification.from_pretrained('cross-encoder/qnli-distilroberta-base')
tokenizer = AutoTokenizer.from_pretrained('cross-encoder/qnli-distilroberta-base')

features = tokenizer(['How many people live in Berlin?', 'What is the size of New York?'], ['Berlin had a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers.', 'New York City is famous for the Metropolitan Museum of Art.'],  padding=True, truncation=True, return_tensors="pt")

model.eval()
with torch.no_grad():
    scores = torch.nn.functional.sigmoid(model(**features).logits)
    print(scores)

Model info

text-ranking sentence-transformers
sentence-transformers pytorch jax onnx safetensors openvino roberta text-classification transformers text-ranking en arxiv:1804.07461
↓ 3.9K ♥ 0

Created: 2022-03-02

Updated: 2025-04-11

View on Hugging Face

Files (25)

.gitattributes
CEBinaryAccuracyEvaluator_qnli-dev_results.csv
README.md
config.json
flax_model.msgpack
merges.txt
model.safetensors
onnx/model.onnx 313 MB ONNX
onnx/model_O1.onnx 313 MB ONNX
onnx/model_O2.onnx 313 MB ONNX
onnx/model_O3.onnx 313 MB ONNX
onnx/model_O4.onnx 157 MB ONNX
onnx/model_qint8_arm64.onnx 79.0 MB ONNX
onnx/model_qint8_avx512.onnx 79.0 MB ONNX
onnx/model_qint8_avx512_vnni.onnx 79.0 MB ONNX
onnx/model_quint8_avx2.onnx 79.0 MB ONNX
openvino/openvino_model.bin
openvino/openvino_model.xml
openvino/openvino_model_qint8_quantized.bin
openvino/openvino_model_qint8_quantized.xml
pytorch_model.bin
special_tokens_map.json
tokenizer.json
tokenizer_config.json
vocab.json

Related models