Skip to main content

Module score

Module score 

Source
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_rerank score per-token (ColBERT) vectors via late interaction (sum of per-query-token maxima).
  • sparse_dot scores 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 docs against query by max_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.