antoinelouis / crossencoder-camembert-L2-mmarcoFR

huggingface.co
Total runs: 27
24-hour runs: -1
7-day runs: 2
30-day runs: -12
Model's Last Updated: April 21 2025
text-ranking

Introduction of crossencoder-camembert-L2-mmarcoFR

Model Details of crossencoder-camembert-L2-mmarcoFR

crossencoder-camembert-L2-mmarcoFR

This is a cross-encoder model for French. It performs cross-attention between a question-passage pair and outputs a relevance score. The model should be used as a reranker for semantic search: given a query and a set of potentially relevant passages retrieved by an efficient first-stage retrieval system (e.g., BM25 or a fine-tuned dense single-vector bi-encoder), encode each query-passage pair and sort the passages in a decreasing order of relevance according to the model's predicted scores.

Usage

Here are some examples for using the model with Sentence-Transformers , FlagEmbedding , or Huggingface Transformers .

Using Sentence-Transformers

Start by installing the library : pip install -U sentence-transformers . Then, you can use the model like this:

from sentence_transformers import CrossEncoder

pairs = [('Question', 'Paragraphe 1'), ('Question', 'Paragraphe 2') , ('Question', 'Paragraphe 3')]

model = CrossEncoder('antoinelouis/crossencoder-camembert-L2-mmarcoFR')
scores = model.predict(pairs)
print(scores)
Using FlagEmbedding

Start by installing the library : pip install -U FlagEmbedding . Then, you can use the model like this:

from FlagEmbedding import FlagReranker

pairs = [('Question', 'Paragraphe 1'), ('Question', 'Paragraphe 2') , ('Question', 'Paragraphe 3')]

reranker = FlagReranker('antoinelouis/crossencoder-camembert-L2-mmarcoFR')
scores = reranker.compute_score(pairs)
print(scores)
Using HuggingFace Transformers

Start by installing the library : pip install -U transformers . Then, you can use the model like this:

import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

pairs = [('Question', 'Paragraphe 1'), ('Question', 'Paragraphe 2') , ('Question', 'Paragraphe 3')]

tokenizer = AutoTokenizer.from_pretrained('antoinelouis/crossencoder-camembert-L2-mmarcoFR')
model = AutoModelForSequenceClassification.from_pretrained('antoinelouis/crossencoder-camembert-L2-mmarcoFR')
model.eval()

with torch.no_grad():
    inputs = tokenizer(pairs, padding=True, truncation=True, return_tensors='pt', max_length=512)
    scores = model(**inputs, return_dict=True).logits.view(-1, ).float()
print(scores)

Evaluation

The model is evaluated on the smaller development set of mMARCO-fr , which consists of 6,980 queries for which an ensemble of 1000 passages containing the positive(s) and ColBERTv2 hard negatives need to be reranked. We report the mean reciprocal rank (MRR) and recall at various cut-offs (R@k). To see how it compares to other neural retrievers in French, check out the DécouvrIR leaderboard.


Training
Data

We use the French training samples from the mMARCO dataset, a multilingual machine-translated version of MS MARCO that contains 8.8M passages and 539K training queries. We do not use the BM25 negatives provided by the official dataset but instead sample harder negatives mined from 12 distinct dense retrievers, using the msmarco-hard-negatives distillation dataset. Eventually, we sample 2.6M training triplets of the form (query, passage, relevance) with a positive-to-negative ratio of 1 (i.e., 50% of the pairs are relevant and 50% are irrelevant).

Implementation

The model is initialized from the antoinelouis/camembert-L2 checkpoint and optimized via the binary cross-entropy loss (as in monoBERT ). It is fine-tuned on one 80GB NVIDIA H100 GPU for 20k steps using the AdamW optimizer with a batch size of 128 and a constant learning rate of 2e-5. We set the maximum sequence length of the concatenated question-passage pairs to 256 tokens. We use the sigmoid function to get scores between 0 and 1.


Citation
@online{louis2024decouvrir,
    author    = 'Antoine Louis',
    title     = 'DécouvrIR: A Benchmark for Evaluating the Robustness of Information Retrieval Models in French',
    publisher = 'Hugging Face',
    month     = 'mar',
    year      = '2024',
    url       = 'https://huggingface.co/spaces/antoinelouis/decouvrir',
}

Runs of antoinelouis crossencoder-camembert-L2-mmarcoFR on huggingface.co

27
Total runs
-1
24-hour runs
1
3-day runs
2
7-day runs
-12
30-day runs

More Information About crossencoder-camembert-L2-mmarcoFR huggingface.co Model

More crossencoder-camembert-L2-mmarcoFR license Visit here:

https://choosealicense.com/licenses/mit

crossencoder-camembert-L2-mmarcoFR huggingface.co

crossencoder-camembert-L2-mmarcoFR huggingface.co is an AI model on huggingface.co that provides crossencoder-camembert-L2-mmarcoFR's model effect (), which can be used instantly with this antoinelouis crossencoder-camembert-L2-mmarcoFR model. huggingface.co supports a free trial of the crossencoder-camembert-L2-mmarcoFR model, and also provides paid use of the crossencoder-camembert-L2-mmarcoFR. Support call crossencoder-camembert-L2-mmarcoFR model through api, including Node.js, Python, http.

crossencoder-camembert-L2-mmarcoFR huggingface.co Url

https://huggingface.co/antoinelouis/crossencoder-camembert-L2-mmarcoFR

antoinelouis crossencoder-camembert-L2-mmarcoFR online free

crossencoder-camembert-L2-mmarcoFR huggingface.co is an online trial and call api platform, which integrates crossencoder-camembert-L2-mmarcoFR's modeling effects, including api services, and provides a free online trial of crossencoder-camembert-L2-mmarcoFR, you can try crossencoder-camembert-L2-mmarcoFR online for free by clicking the link below.

antoinelouis crossencoder-camembert-L2-mmarcoFR online free url in huggingface.co:

https://huggingface.co/antoinelouis/crossencoder-camembert-L2-mmarcoFR

crossencoder-camembert-L2-mmarcoFR install

crossencoder-camembert-L2-mmarcoFR is an open source model from GitHub that offers a free installation service, and any user can find crossencoder-camembert-L2-mmarcoFR on GitHub to install. At the same time, huggingface.co provides the effect of crossencoder-camembert-L2-mmarcoFR install, users can directly use crossencoder-camembert-L2-mmarcoFR installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

crossencoder-camembert-L2-mmarcoFR install url in huggingface.co:

https://huggingface.co/antoinelouis/crossencoder-camembert-L2-mmarcoFR

Url of crossencoder-camembert-L2-mmarcoFR

crossencoder-camembert-L2-mmarcoFR huggingface.co Url

Provider of crossencoder-camembert-L2-mmarcoFR huggingface.co

antoinelouis
ORGANIZATIONS

Other API from antoinelouis

huggingface.co

Total runs: 538
Run Growth: 274
Growth Rate: 50.93%
Updated:March 22 2024
huggingface.co

Total runs: 40
Run Growth: -126
Growth Rate: -315.00%
Updated:March 26 2024