Text Ranking
Transformers.js
ONNX
French
camembert
text-classification
cross-encoder
reranker
french
Instructions to use sneko/crossencoder-camembert-base-mmarcoFR-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use sneko/crossencoder-camembert-base-mmarcoFR-onnx with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-ranking', 'sneko/crossencoder-camembert-base-mmarcoFR-onnx');
crossencoder-camembert-base-mmarcoFR (ONNX)
ONNX export of antoinelouis/crossencoder-camembert-base-mmarcoFR — a French cross-encoder (CamemBERT-base) trained on mMARCO-fr for passage reranking.
All credit for the model goes to the original author. This repository only adds ONNX weights so the model can run with Transformers.js / ONNX Runtime in JavaScript.
ℹ️ Unlike some other ONNX uploads of this model, this export includes the sequence-classification head, so it outputs a relevance score (
logitsof shape[batch, 1]) and can actually be used for reranking — not the rawlast_hidden_state.
Files
| File | Description |
|---|---|
onnx/model.onnx |
full precision (fp32), ~443 MB |
onnx/model_quantized.onnx |
int8 dynamic quantization (~111 MB) — loaded by default by Transformers.js |
Usage (Transformers.js)
import { AutoModelForSequenceClassification, AutoTokenizer } from '@xenova/transformers';
const model_id = '<your-username>/crossencoder-camembert-base-mmarcoFR_ONNX';
const tokenizer = await AutoTokenizer.from_pretrained(model_id);
const model = await AutoModelForSequenceClassification.from_pretrained(model_id); // uses model_quantized.onnx
const query = 'projets dans la police';
const passages = ['Police nationale : métiers, recrutement et concours', 'Plateforme de photographie'];
const inputs = tokenizer(new Array(passages.length).fill(query), { text_pair: passages, padding: true, truncation: true });
const { logits } = await model(inputs);
const scores = logits
.sigmoid()
.tolist()
.map(([s]) => s); // higher = more relevant
How it was produced
optimum-cli export onnx \
--model antoinelouis/crossencoder-camembert-base-mmarcoFR \
--task text-classification --opset 14 ./out/
# then int8 dynamic quantization (onnxruntime, QUInt8) -> onnx/model_quantized.onnx
License
MIT, following the original model.
- Downloads last month
- 14
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Model tree for sneko/crossencoder-camembert-base-mmarcoFR-onnx
Base model
almanach/camembert-base