cross-encoder / monoelectra-base

huggingface.co
Total runs: 122
24-hour runs: 0
7-day runs: 13
30-day runs: 91
Model's Last Updated: April 15 2025
text-ranking

Introduction of monoelectra-base

Model Details of monoelectra-base

Cross-Encoder for Text Ranking

This model is a port of the webis/monoelectra-base model from lightning-ir to Sentence Transformers and Transformers .

The original model was introduced in the paper A Systematic Investigation of Distilling Large Language Models into Cross-Encoders for Passage Re-ranking . See https://github.com/webis-de/rank-distillm for code used to train the original model.

The model can be used as a reranker in a 2-stage "retrieve-rerank" pipeline, where it reorders passages returned by a retriever model (e.g. an embedding model or BM25) given some query. See SBERT.net Retrieve & Re-rank for more details.

Usage with Sentence Transformers

The usage is easy when you have SentenceTransformers installed.

pip install sentence-transformers

Then you can use the pre-trained model like this:

from sentence_transformers import CrossEncoder

model = CrossEncoder("cross-encoder/monoelectra-base", trust_remote_code=True)
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."),
    ("How many people live in Berlin?", "Berlin is well known for its museums."),
])
print(scores)
# [ 8.122868 -4.292924]
Usage with Transformers
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model = AutoModelForSequenceClassification.from_pretrained("cross-encoder/monoelectra-base", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("cross-encoder/monoelectra-base")

features = tokenizer(
    [
        ("How many people live in Berlin?", "Berlin had a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers."),
        ("How many people live in Berlin?", "Berlin is well known for its museums."),
    ],
    padding=True,
    truncation=True,
    return_tensors="pt",
)

model.eval()
with torch.no_grad():
    scores = model(**features).logits.view(-1)
print(scores)
# tensor([ 8.1229, -4.2929])

Runs of cross-encoder monoelectra-base on huggingface.co

122
Total runs
0
24-hour runs
8
3-day runs
13
7-day runs
91
30-day runs

More Information About monoelectra-base huggingface.co Model

More monoelectra-base license Visit here:

https://choosealicense.com/licenses/apache-2.0

monoelectra-base huggingface.co

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

cross-encoder monoelectra-base online free

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

cross-encoder monoelectra-base online free url in huggingface.co:

https://huggingface.co/cross-encoder/monoelectra-base

monoelectra-base install

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

monoelectra-base install url in huggingface.co:

https://huggingface.co/cross-encoder/monoelectra-base

Url of monoelectra-base

Provider of monoelectra-base huggingface.co

cross-encoder
ORGANIZATIONS

Other API from cross-encoder