CoolFace
Modelpublic

jinaai/jina-colbert-v2-64

sourceHugging Facecc-by-nc-4.0updated 2y agoView on Hugging Face
10likes509downloads
Model Card

<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.

bash
pip install -U einops flash_attn
pip install -U ragatouille
pip install -U colbert-ai

RAGatouille

python
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

python
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
**NDCG@10****jina-colbert-v2****jina-colbert-v1****ColBERTv2.0****BM25**
avg0.5310.5020.4960.440
nfcorpus0.3460.3380.3370.325
fiqa0.4080.3680.3540.236
trec-covid0.8340.7500.7260.656
arguana0.3660.4940.4650.315
quora0.8870.8230.8550.789
scidocs0.1860.1690.1540.158
scifact0.6780.7010.6890.665
webis-touche0.2740.2700.2600.367
dbpedia-entity0.4710.4130.4520.313
fever0.8050.7950.7850.753
climate-fever0.2390.1960.1760.213
hotpotqa0.7660.6560.6750.603
nq0.6400.5490.5240.329
MS MARCO Passage Retrieval
**MRR@10****jina-colbert-v2****jina-colbert-v1****ColBERTv2.0****BM25**
MSMARCO0.3960.3900.3970.187

Multilingual Benchmarks

MIRACLE
**NDCG@10****jina-colbert-v2****mDPR (zero shot)**
avg0.6270.427
ar0.7530.499
bn0.7500.443
de0.5040.490
es0.5380.478
en0.5700.394
fa0.5630.480
fi0.7400.472
fr0.5410.435
hi0.6000.383
id0.5470.272
ja0.6320.439
ko0.6710.419
ru0.6430.407
sw0.4990.299
te0.7420.356
th0.7720.358
yo0.6230.396
zh0.5230.512
mMARCO
**MRR@10****jina-colbert-v2****BM-25****ColBERT-XM**
avg0.3130.1410.254
ar0.2720.1110.195
de0.3310.1360.270
nl0.3300.1400.275
es0.3410.1580.285
fr0.3350.1550.269
hi0.3090.1340.238
id0.3190.1490.263
it0.3370.1530.265
ja0.2760.1410.241
pt0.3370.1520.276
ru0.2980.1240.251
vi0.2870.1360.226
zh0.3020.1160.246

Matryoshka Representation Benchmarks

BEIR
**NDCG@10****dim=128****dim=96****dim=64**
avg0.5990.5910.589
nfcorpus0.3460.3400.347
fiqa0.4080.4040.404
trec-covid0.8340.8080.805
hotpotqa0.7660.7640.756
nq0.6400.6400.635
MSMARCO
**MRR@10****dim=128****dim=96****dim=64**
msmarco0.3960.3910.388

Other Models

Additionally, we provide the following embedding models, you can also use them for retrieval.

Contact

Join our Discord community and chat with other community members about ideas.