Skip to content

Why don't sparse vectors support negative values? #38038

Discussion options

You must be logged in to vote

I looked a bit into the model, seems the output ColBert vector are a bunch of dense vectors, instead of sparse vectors?

from colbert.modeling.checkpoint import Checkpoint
from colbert.infra import Run, RunConfig, ColBERTConfig

ckpt = Checkpoint("answerdotai/answerai-colbert-small-v1", colbert_config=ColBERTConfig())

s = '''answerai-colbert-small-v1 is a new'''

embedded_query = ckpt.queryFromText([s], bsize=16)
print(embedded_query.shape)
# torch.Size([1, 32, 96])
# did a few experiment with different text length, seems the query shape is always 32*96: 32 dense embs with dim=96

embedded_doc = ckpt.docFromText([s], bsize=16)
print(embedded_doc[0].shape)
# torch.Size([1, 15, 96])
# doc …

Replies: 5 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@zhengbuqian
Comment options

@xiaofan-luan
Comment options

@xiaofan-luan
Comment options

Answer selected by csalg
@zhengbuqian
Comment options

Comment options

You must be logged in to vote
2 replies
@zhengbuqian
Comment options

@csalg
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants