View Source Vettore.MultiVector (Vettore v0.3.1)

Multi-vector scoring helpers.

Link to this section Summary

Functions

Computes Chamfer/MaxSim similarity.

Computes a ColBERT-style late interaction score.

Link to this section Types

Link to this section Functions

Link to this function

chamfer(query_vectors, document_vectors, opts \\ [])

View Source
@spec chamfer([vector()], [vector()], keyword()) :: {:ok, float()} | {:error, term()}

Computes Chamfer/MaxSim similarity.

For each query vector, this finds the best matching document vector and sums those best scores.

examples

Examples

iex> Vettore.MultiVector.chamfer(
...>   [[1.0, 0.0], [0.0, 1.0]],
...>   [[1.0, 0.0], [1.0, 1.0]],
...>   metric: :inner_product
...> )
{:ok, 2.0}
Link to this function

colbert_score(query_vectors, document_vectors, opts \\ [])

View Source
@spec colbert_score([vector()], [vector()], keyword()) ::
  {:ok, float()} | {:error, term()}

Computes a ColBERT-style late interaction score.

This is an explicit alias for Chamfer/MaxSim scoring: each query vector takes its best match from the document vectors, then the best-match scores are summed.

examples

Examples

iex> Vettore.MultiVector.colbert_score(
...>   [[1.0, 0.0], [0.0, 1.0]],
...>   [[1.0, 0.0], [0.0, 1.0], [-1.0, 0.0]],
...>   metric: :inner_product
...> )
{:ok, 2.0}