This is a
ColBERT model finetuned from
google/bert_uncased_L-2_H-128_A-2 on the
msmarco-bm25 dataset. It maps sentences & paragraphs to sequences of 128-dimensional dense vectors and can be used for semantic textual similarity using the MaxSim operator.
This model is primarily designed for unit tests in limited compute environments such as GitHub Actions. But it does work to an extent for basic use cases.
As of
Sentence Transformers v6.0.0, this model loads directly as a multi-vector (ColBERT-style late interaction) retriever via the
MultiVectorEncoder:
1from sentence_transformers import MultiVectorEncoder
2
3model = MultiVectorEncoder("NeuML/colbert-bert-tiny")
4
5query = "What is the capital of France?"
6documents = [
7 "Paris is the capital and largest city of France.",
8 "Berlin is the capital of Germany.",
9]
10
11query_embeddings = model.encode_query(query)
12document_embeddings = model.encode_document(documents)
13print(query_embeddings.shape, document_embeddings[0].shape)
14# torch.Size([32, 128]) torch.Size([12, 128])
15
16# MaxSim late-interaction scoring (higher is more relevant)
17scores = model.similarity(query_embeddings, document_embeddings)
18print(scores)
19# tensor([[25.9327, 23.9168]], device='cuda:0')