jinaai/jina-colbert-v2-64
<br><br>
<p align="center"> <img src="https://huggingface.co/datasets/jinaai/documentation-images/resolve/main/logo.webp" alt="Jina AI: Your Search Foundation, Supercharged!" width="150px"> </p>
<p align="center"> <b>Trained by <a href="https://jina.ai/"><b>Jina AI</b></a>.</b> </p>
<p align="center"> <b>JinaColBERT V2: your multilingual late interaction retriever!</b> </p>
JinaColBERT V2 (jina-colbert-v2) is a new model based on the JinaColBERT V1 that expands on the capabilities and performance of the `jina-colbert-v1-en` model. Like the previous release, it has Jina AI’s 8192 token input context and the improved efficiency, performance, and explainability of token-level embeddings and late interaction.
This new release adds new functionality and performance improvements:
- Multilingual support for dozens of languages, with strong performance on major global languages.
- Matryoshka embeddings, which allow users to trade between efficiency and precision flexibly.
- Superior retrieval performance when compared to the English-only `jina-colbert-v1-en`.
JinaColBERT V2 offers three different versions for different embeddings dimensions: `jinaai/jina-colbert-v2`: 128 dimension embeddings `jinaai/jina-colbert-v2-96`: 96 dimension embeddings `jinaai/jina-colbert-v2-64`: 64 dimension embeddings
Usage
Installation
jina-colbert-v2 is trained with flash attention and therefore requires einops and flash_attn to be installed.
To use the model, you could either use the Standford ColBERT library or use the ragatouille package that we provide.
pip install -U einops flash_attn
pip install -U ragatouille
pip install -U colbert-aiRAGatouille
from ragatouille import RAGPretrainedModel
RAG = RAGPretrainedModel.from_pretrained("jinaai/jina-colbert-v2")
docs = [
"ColBERT is a novel ranking model that adapts deep LMs for efficient retrieval.",
"Jina-ColBERT is a ColBERT-style model but based on JinaBERT so it can support both 8k context length, fast and accurate retrieval.",
]
RAG.index(docs, index_name="demo")
query = "What does ColBERT do?"
results = RAG.search(query)Stanford ColBERT
from colbert.infra import ColBERTConfig
from colbert.modeling.checkpoint import Checkpoint
ckpt = Checkpoint("jinaai/jina-colbert-v2", colbert_config=ColBERTConfig())
docs = [
"ColBERT is a novel ranking model that adapts deep LMs for efficient retrieval.",
"Jina-ColBERT is a ColBERT-style model but based on JinaBERT so it can support both 8k context length, fast and accurate retrieval.",
]
query_vectors = ckpt.queryFromText(docs, bsize=2)Evaluation Results
Retrieval Benchmarks
BEIR
MS MARCO Passage Retrieval
Multilingual Benchmarks
MIRACLE
mMARCO
Matryoshka Representation Benchmarks
BEIR
MSMARCO
Other Models
Additionally, we provide the following embedding models, you can also use them for retrieval.
- `jina-embeddings-v2-base-en`: 137 million parameters.
- `jina-embeddings-v2-base-zh`: 161 million parameters Chinese-English bilingual model.
- `jina-embeddings-v2-base-de`: 161 million parameters German-English bilingual model.
- `jina-embeddings-v2-base-es`: 161 million parameters Spanish-English bilingual model.
- `jina-reranker-v2`: multilingual reranker model.
- `jina-clip-v1`: English multimodal (text-image) embedding model.
Contact
Join our Discord community and chat with other community members about ideas.
