Text Ranking
Transformers
PyTorch
ONNX
Safetensors
Transformers.js
sentence-transformers
multilingual
text-classification
reranker
cross-encoder
custom_code
🇪🇺 Region: EU
Instructions to use jinaai/jina-reranker-v2-base-multilingual with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jinaai/jina-reranker-v2-base-multilingual with Transformers:
# Load model directly from transformers import AutoModelForSequenceClassification model = AutoModelForSequenceClassification.from_pretrained("jinaai/jina-reranker-v2-base-multilingual", trust_remote_code=True, device_map="auto") - Transformers.js
How to use jinaai/jina-reranker-v2-base-multilingual with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-ranking', 'jinaai/jina-reranker-v2-base-multilingual'); - sentence-transformers
How to use jinaai/jina-reranker-v2-base-multilingual with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("jinaai/jina-reranker-v2-base-multilingual", trust_remote_code=True) 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
position embedding 1026 while sequence length allowed 1024?
#34
by wahaha1987 - opened
I am confused with the discrepancy among the following three numbers:
- the max sequence length is 1024
- the token id max length of a pair of query and document is 1026
- the position embedding is 1026
How come?