Text Ranking
Transformers
Safetensors
sentence-transformers
qwen2
text-generation
text-embeddings-inference
Instructions to use mixedbread-ai/mxbai-rerank-large-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mixedbread-ai/mxbai-rerank-large-v2 with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mixedbread-ai/mxbai-rerank-large-v2") model = AutoModelForCausalLM.from_pretrained("mixedbread-ai/mxbai-rerank-large-v2") - sentence-transformers
How to use mixedbread-ai/mxbai-rerank-large-v2 with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("mixedbread-ai/mxbai-rerank-large-v2") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Notebooks
- Google Colab
- Kaggle
The score ratio is very vague.
#9
by AoiEugeo - opened
I found that the score range is not 0 - 1. When I input two identical sentences, the score is sometimes 13 and sometimes 14. For completely unrelated sentences, the scores could be 6, 4, etc. I want to know what the maximum and minimum scores are and how to determine a high similarity.
Filter out scores below 7.5
Yes, this model doesn't use a Sigmoid or some other function to map the scores to 0...1. You can either apply your own, or use a score threshold matching what the model usually outputs, like @xldistance proposes.
- Tom Aarsen