Expand description
Host-side similarity scoring for sparse and multi-vector embeddings.
uni-xervo emits sparse and multi-vector embeddings but deliberately does not own an index — native multi-vector / inverted-index storage is a downstream concern. These pure, dependency-free helpers close that gap for the common case of reranking a small top-k candidate set in the host process:
max_sim/colbert_rerankscore per-token (ColBERT) vectors via late interaction (sum of per-query-token maxima).sparse_dotscores two learned-sparse vectors.
They make these embeddings useful immediately, without waiting on a native index. For large corpora, prefer a real index over scoring every candidate here.
Functions§
- colbert_
rerank - Rank
docsagainstquerybymax_sim, returning one score per document. - max_sim
- Compute the MaxSim late-interaction score between query and document tokens.
- sparse_
dot - Compute the dot product of two learned-sparse vectors.