View Source Vettore.MultiVector (Vettore v0.3.0)
Multi-vector scoring helpers.
Link to this section Summary
Link to this section Types
@type metric() :: Vettore.Distance.metric() | atom()
@type vector() :: [number()]
Link to this section Functions
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}
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}