Views
No views yet

jina-reranker-v2-base-multilingual, jina-reranker-m0 also improves text reranking for multilingual content, long documents, and code searching tasks.Qwen2-VL-2B-Instruct, utilizing its vision encoder, projection layer, and language model| jina-reranker-m0 | jina-reranker-v2 | |
|---|---|---|
| Architecture | Vision Language Model | Cross-Encoder |
| Base model | Qwen2-VL-2B | Jina-XLM-RoBERTa |
| Parameters | 2.4 B | 278 M |
| Max context length | 10,240 tokens (query + document) | 8,192 tokens |
| Image processing | 768 × 28 × 28 patches (dynamic resolution) | ❌ |
| Multilingual support | 29+ languages | Multiple languages |
| Tasks supported | Text2Text, Text2Image, Image2Text, Text2Mixed | Text2Text |
jina-reranker-v2-base-multilingual, jina-reranker-m0 significantly improves text reranking for multilingual content, long documents, and code searching tasks, while adding powerful new capabilities for visual document understanding.jina-reranker-m0 is to call Jina AI's Reranker API.1curl -X POST \
2 https://api.jina.ai/v1/rerank \
3 -H "Content-Type: application/json" \
4 -H "Authorization: Bearer JINA_API_KEY" \
5 -d '{
6 "model": "jina-reranker-m0",
7 "query": "slm markdown",
8 "documents": [
9 {
10 "image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/handelsblatt-preview.png"
11 },
12 {
13 "image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
14 },
15 {
16 "image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/wired-preview.png"
17 },
18 {
19 "text": "We present ReaderLM-v2, a compact 1.5 billion parameter language model designed for efficient web content extraction. Our model processes documents up to 512K tokens, transforming messy HTML into clean Markdown or JSON formats with high accuracy -- making it an ideal tool for grounding large language models. The models effectiveness results from two key innovations: (1) a three-stage data synthesis pipeline that generates high quality, diverse training data by iteratively drafting, refining, and critiquing web content extraction; and (2) a unified training framework combining continuous pre-training with multi-objective optimization. Intensive evaluation demonstrates that ReaderLM-v2 outperforms GPT-4o-2024-08-06 and other larger models by 15-20% on carefully curated benchmarks, particularly excelling at documents exceeding 100K tokens, while maintaining significantly lower computational requirements."
20 },
21 {
22 "image": "https://jina.ai/blog-banner/using-deepseek-r1-reasoning-model-in-deepsearch.webp"
23 },
24 {
25 "text": "数据提取么?为什么不用正则啊,你用正则不就全解决了么?"
26 },
27 {
28 "text": "During the California Gold Rush, some merchants made more money selling supplies to miners than the miners made finding gold."
29 },
30 {
31 "text": "Die wichtigsten Beiträge unserer Arbeit sind zweifach: Erstens führen wir eine neuartige dreistufige Datensynthese-Pipeline namens Draft-Refine-Critique ein, die durch iterative Verfeinerung hochwertige Trainingsdaten generiert; und zweitens schlagen wir eine umfassende Trainingsstrategie vor, die kontinuierliches Vortraining zur Längenerweiterung, überwachtes Feintuning mit spezialisierten Kontrollpunkten, direkte Präferenzoptimierung (DPO) und iteratives Self-Play-Tuning kombiniert. Um die weitere Forschung und Anwendung der strukturierten Inhaltsextraktion zu erleichtern, ist das Modell auf Hugging Face öffentlich verfügbar."
32 }
33 ],
34 "return_documents": false
35}'1{
2 "model":"jina-reranker-m0",
3 "usage": {
4 "total_tokens":2813
5 },
6 "results":[
7 {
8 "index":1,
9 "relevance_score":0.9310624287463884
10 },
11 {
12 "index":4,
13 "relevance_score":0.8982678574191957
14 },
15 {
16 "index":0,
17 "relevance_score":0.890233167219021
18 },
19 ...
20 ]
21}relevance_score field indicates the relevance of each document to the query, with higher scores indicating greater relevance.sentence_transformers library.pip install sentence_transformers1from sentence_transformers import CrossEncoder
2
3model = CrossEncoder("jinaai/jina-reranker-m0", trust_remote_code=True)1query = "slm markdown"
2documents = [
3 "We present ReaderLM-v2, a compact 1.5 billion parameter language model designed for efficient web content extraction. Our model processes documents up to 512K tokens, transforming messy HTML into clean Markdown or JSON formats with high accuracy -- making it an ideal tool for grounding large language models. The models effectiveness results from two key innovations: (1) a three-stage data synthesis pipeline that generates high quality, diverse training data by iteratively drafting, refining, and critiquing web content extraction; and (2) a unified training framework combining continuous pre-training with multi-objective optimization. Intensive evaluation demonstrates that ReaderLM-v2 outperforms GPT-4o-2024-08-06 and other larger models by 15-20% on carefully curated benchmarks, particularly excelling at documents exceeding 100K tokens, while maintaining significantly lower computational requirements.",
4 "数据提取么?为什么不用正则啊,你用正则不就全解决了么?",
5 "During the California Gold Rush, some merchants made more money selling supplies to miners than the miners made finding gold.",
6 "Die wichtigsten Beiträge unserer Arbeit sind zweifach: Erstens führen wir eine neuartige dreistufige Datensynthese-Pipeline namens Draft-Refine-Critique ein, die durch iterative Verfeinerung hochwertige Trainingsdaten generiert; und zweitens schlagen wir eine umfassende Trainingsstrategie vor, die kontinuierliches Vortraining zur Längenerweiterung, überwachtes Feintuning mit spezialisierten Kontrollpunkten, direkte Präferenzoptimierung (DPO) und iteratives Self-Play-Tuning kombiniert. Um die weitere Forschung und Anwendung der strukturierten Inhaltsextraktion zu erleichtern, ist das Modell auf Hugging Face öffentlich verfügbar.",
7]
8
9rankings = model.rank(query, documents)
10print(rankings)
11# [{'corpus_id': 0, 'score': 0.6875}, {'corpus_id': 2, 'score': 0.5938},
12# {'corpus_id': 3, 'score': 0.4590}, {'corpus_id': 1, 'score': 0.4434}]1query = "slm markdown"
2documents = [
3 "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/handelsblatt-preview.png",
4 "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png",
5 "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/wired-preview.png",
6 "https://jina.ai/blog-banner/using-deepseek-r1-reasoning-model-in-deepsearch.webp",
7]
8
9scores = model.predict([(query, doc) for doc in documents])
10print(scores)
11# [0.4980 0.7813 0.4824 0.5039]1query = "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
2documents = [
3 "We present ReaderLM-v2, a compact 1.5 billion parameter language model designed for efficient web content extraction. Our model processes documents up to 512K tokens, transforming messy HTML into clean Markdown or JSON formats with high accuracy -- making it an ideal tool for grounding large language models. The models effectiveness results from two key innovations: (1) a three-stage data synthesis pipeline that generates high quality, diverse training data by iteratively drafting, refining, and critiquing web content extraction; and (2) a unified training framework combining continuous pre-training with multi-objective optimization. Intensive evaluation demonstrates that ReaderLM-v2 outperforms GPT-4o-2024-08-06 and other larger models by 15-20% on carefully curated benchmarks, particularly excelling at documents exceeding 100K tokens, while maintaining significantly lower computational requirements.",
4 "数据提取么?为什么不用正则啊,你用正则不就全解决了么?",
5 "During the California Gold Rush, some merchants made more money selling supplies to miners than the miners made finding gold.",
6 "Die wichtigsten Beiträge unserer Arbeit sind zweifach: Erstens führen wir eine neuartige dreistufige Datensynthese-Pipeline namens Draft-Refine-Critique ein, die durch iterative Verfeinerung hochwertige Trainingsdaten generiert; und zweitens schlagen wir eine umfassende Trainingsstrategie vor, die kontinuierliches Vortraining zur Längenerweiterung, überwachtes Feintuning mit spezialisierten Kontrollpunkten, direkte Präferenzoptimierung (DPO) und iteratives Self-Play-Tuning kombiniert. Um die weitere Forschung und Anwendung der strukturierten Inhaltsextraktion zu erleichtern, ist das Modell auf Hugging Face öffentlich verfügbar.",
7]
8
9scores = model.predict([(query, doc) for doc in documents])
10print(scores)
11# [0.9805 0.7773 0.5664 0.9297]1query = "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
2documents = [
3 "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/handelsblatt-preview.png",
4 "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png",
5 "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/wired-preview.png",
6 "https://jina.ai/blog-banner/using-deepseek-r1-reasoning-model-in-deepsearch.webp",
7]
8
9scores = model.predict([(query, doc) for doc in documents])
10print(scores)
11# [0.6250 0.9922 0.8125 0.7930]trust_remote_code=True using the transformers library.transformers libraries:pip install transformers >= 4.47.3pip install flash-attn --no-build-isolation1from transformers import AutoModel
2
3# comment out the flash_attention_2 line if you don't have a compatible GPU
4model = AutoModel.from_pretrained(
5 'jinaai/jina-reranker-m0',
6 torch_dtype="auto",
7 trust_remote_code=True,
8 attn_implementation="flash_attention_2"
9)
10
11model.to('cuda') # or 'cpu' if no GPU is available
12model.eval()compute_score to compute the relevance scores for a query and a list of documents. The function takes a list of sentence pairs, where each pair consists of a query and a document. The model will return a list of scores indicating the relevance of each document to the query.1# Example query and documents
2query = "slm markdown"
3documents = [
4 "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/handelsblatt-preview.png",
5 "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png",
6 "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/wired-preview.png",
7 "https://jina.ai/blog-banner/using-deepseek-r1-reasoning-model-in-deepsearch.webp"
8]
9
10# construct sentence pairs
11image_pairs = [[query, doc] for doc in documents]
12
13scores = model.compute_score(image_pairs, max_length=2048, doc_type="image")
14# [0.49375027418136597, 0.7889736890792847, 0.47813892364501953, 0.5210812091827393]1query = "slm markdown"
2documents = [
3 "We present ReaderLM-v2, a compact 1.5 billion parameter language model designed for efficient web content extraction. Our model processes documents up to 512K tokens, transforming messy HTML into clean Markdown or JSON formats with high accuracy -- making it an ideal tool for grounding large language models. The models effectiveness results from two key innovations: (1) a three-stage data synthesis pipeline that generates high quality, diverse training data by iteratively drafting, refining, and critiquing web content extraction; and (2) a unified training framework combining continuous pre-training with multi-objective optimization. Intensive evaluation demonstrates that ReaderLM-v2 outperforms GPT-4o-2024-08-06 and other larger models by 15-20% on carefully curated benchmarks, particularly excelling at documents exceeding 100K tokens, while maintaining significantly lower computational requirements.",
4 "数据提取么?为什么不用正则啊,你用正则不就全解决了么?",
5 "During the California Gold Rush, some merchants made more money selling supplies to miners than the miners made finding gold.",
6 "Die wichtigsten Beiträge unserer Arbeit sind zweifach: Erstens führen wir eine neuartige dreistufige Datensynthese-Pipeline namens Draft-Refine-Critique ein, die durch iterative Verfeinerung hochwertige Trainingsdaten generiert; und zweitens schlagen wir eine umfassende Trainingsstrategie vor, die kontinuierliches Vortraining zur Längenerweiterung, überwachtes Feintuning mit spezialisierten Kontrollpunkten, direkte Präferenzoptimierung (DPO) und iteratives Self-Play-Tuning kombiniert. Um die weitere Forschung und Anwendung der strukturierten Inhaltsextraktion zu erleichtern, ist das Modell auf Hugging Face öffentlich verfügbar.",
7]
8
9# construct sentence pairs
10text_pairs = [[query, doc] for doc in documents]
11
12scores = model.compute_score(text_pairs, max_length=1024, doc_type="text")[0.6839263439178467, 0.4432148039340973, 0.5904013514518738, 0.45481112599372864]1query = "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
2
3documents = [
4 "We present ReaderLM-v2, a compact 1.5 billion parameter language model designed for efficient web content extraction. Our model processes documents up to 512K tokens, transforming messy HTML into clean Markdown or JSON formats with high accuracy -- making it an ideal tool for grounding large language models. The models effectiveness results from two key innovations: (1) a three-stage data synthesis pipeline that generates high quality, diverse training data by iteratively drafting, refining, and critiquing web content extraction; and (2) a unified training framework combining continuous pre-training with multi-objective optimization. Intensive evaluation demonstrates that ReaderLM-v2 outperforms GPT-4o-2024-08-06 and other larger models by 15-20% on carefully curated benchmarks, particularly excelling at documents exceeding 100K tokens, while maintaining significantly lower computational requirements.",
5 "数据提取么?为什么不用正则啊,你用正则不就全解决了么?",
6 "During the California Gold Rush, some merchants made more money selling supplies to miners than the miners made finding gold.",
7 "Die wichtigsten Beiträge unserer Arbeit sind zweifach: Erstens führen wir eine neuartige dreistufige Datensynthese-Pipeline namens Draft-Refine-Critique ein, die durch iterative Verfeinerung hochwertige Trainingsdaten generiert; und zweitens schlagen wir eine umfassende Trainingsstrategie vor, die kontinuierliches Vortraining zur Längenerweiterung, überwachtes Feintuning mit spezialisierten Kontrollpunkten, direkte Präferenzoptimierung (DPO) und iteratives Self-Play-Tuning kombiniert. Um die weitere Forschung und Anwendung der strukturierten Inhaltsextraktion zu erleichtern, ist das Modell auf Hugging Face öffentlich verfügbar.",
8]
9# reverse the order of the query and document
10image_pairs = [[query, doc] for doc in documents]
11scores = model.compute_score(image_pairs, max_length=2048, query_type="image", doc_type="text")
12
13# [0.98099285364151, 0.7701883316040039, 0.5637142062187195, 0.9308615922927856]1query = "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
2
3documents = [
4 "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/handelsblatt-preview.png",
5 "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png",
6 "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/wired-preview.png",
7 "https://jina.ai/blog-banner/using-deepseek-r1-reasoning-model-in-deepsearch.webp"
8]
9
10image_pairs = [[query, doc] for doc in documents]
11scores = model.compute_score(image_pairs, max_length=2048, doc_type="image", query_type='image')
12# [0.6275860667228699, 0.9922324419021606, 0.8090347051620483, 0.7941296100616455]
jina-reranker-m0 on ViDoRe, MBEIR, and Winoground visual retrieval benchmarks showcases its capabilities across diverse multimodal retrieval tasks spanning multiple domains and languages. Each dot represents performance scores for different types of visual documents. The boxplots illustrate the distribution of these scores, with the highlighted numbers indicating the average (mean) performance.jina-reranker-m0 across four text-to-text reranking benchmarks. Each benchmark may include multiple datasets, languages, or tasks, represented by individual dots inside the boxplot. The boxplot shows the distribution of these scores, with the highlighted number showing the average (mean) performance. While most benchmarks use NDCG@10 as their performance metric, MKQA uses recall@10 instead, as MKQA's annotation data doesn't support NDCG calculation (the official evaluation uses recall, which determines document relevance through heuristics).
jina-reranker-m0 is listed on AWS & Azure. If you need to use it beyond those platforms or on-premises within your company, note that the models is licensed under CC BY-NC 4.0. For commercial usage inquiries, feel free to contact us.