pipeline_tag: text-classification
tags:
- vidore
- reranker
- qwen2_vl
language:
- multilingual
base_model:
- Qwen/Qwen2-VL-2B-Instruct
inference: false
license: cc-by-nc-4.0
library_name: transformers
Trained by Jina AI.
jina-reranker-v3
Intended Usage & Model Info
The Jina Reranker v3 (jina-reranker-v3
) is multi-lingual, and multi-modal model that has been fine-tuned for text and visual document reranking task, which is a crucial component in many information retrieval systems. It takes a query and a document pair as input and outputs a score indicating the relevance of the document to the query. The model is trained on a large dataset of query-document pairs and is capable of reranking documents in multiple languages with high accuracy.
Usage
This model repository is licenced for research and evaluation purposes under CC-BY-NC-4.0. For commercial usage, please refer to Jina AI's APIs, AWS Sagemaker or Azure Marketplace offerings. Please contact us for any further clarifications.
- The easiest way to use
jina-reranker-v3
is to call Jina AI's Reranker API.
curl https://api.jina.ai/v1/rerank \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "jina-reranker-v3",
"query": "Organic skincare products for sensitive skin",
"documents": [
{"text": "Organic skincare for sensitive skin with aloe vera and chamomile."},
{"text": "New makeup trends focus on bold colors and innovative techniques"},
{"text": "Bio-Hautpflege für empfindliche Haut mit Aloe Vera und Kamille"},
{"text": "Neue Make-up-Trends setzen auf kräftige Farben und innovative Techniken"},
{"text": "Cuidado de la piel orgánico para piel sensible con aloe vera y manzanilla"},
{"text": "Las nuevas tendencias de maquillaje se centran en colores vivos y técnicas innovadoras"},
{"text": "针对敏感肌专门设计的天然有机护肤产品"},
{"text": "新的化妆趋势注重鲜艳的颜色和创新的技巧"},
{"text": "敏感肌のために特別に設計された天然有機スキンケア製品"},
{"text": "新しいメイクのトレンドは鮮やかな色と革新的な技術に焦点を当てています"}
],
"top_n": 3
}'
- You can also use the
transformers
library to interact with the model programmatically.
Before you start, install the transformers
libraries:
pip install transformers >= 4.47.3
And then:
from transformers import AutoModel
model = AutoModel.from_pretrained(
'jinaai/jina-reranker-v3',
torch_dtype="auto",
trust_remote_code=True,
)
model.to('cuda') # or 'cpu' if no GPU is available
model.eval()
# Example query and documents
query = "Organic skincare products for sensitive skin"
documents = [
"Organic skincare for sensitive skin with aloe vera and chamomile.",
"New makeup trends focus on bold colors and innovative techniques",
"Bio-Hautpflege für empfindliche Haut mit Aloe Vera und Kamille",
"Neue Make-up-Trends setzen auf kräftige Farben und innovative Techniken",
"Cuidado de la piel orgánico para piel sensible con aloe vera y manzanilla",
"Las nuevas tendencias de maquillaje se centran en colores vivos y técnicas innovadoras",
"针对敏感肌专门设计的天然有机护肤产品",
"新的化妆趋势注重鲜艳的颜色和创新的技巧",
"敏感肌のために特別に設計された天然有機スキンケア製品",
"新しいメイクのトレンドは鮮やかな色と革新的な技術に焦点を当てています",
]
# construct sentence pairs
sentence_pairs = [[query, doc] for doc in documents]
scores = model.compute_score(sentence_pairs, max_length=1024)
The scores will be a list of floats, where each float represents the relevance score of the corresponding document to the query. Higher scores indicate higher relevance. For instance the returning scores in this case will be:
[0.8311430811882019, 0.09401018172502518,
0.6334102749824524, 0.08269733935594559,
0.7620701193809509, 0.09947021305561066,
0.9263036847114563, 0.05834583938121796,
0.8418256044387817, 0.11124119907617569]