pub fn chamfer(query: &[f32], doc: &[f32], dim: usize) -> f32Expand description
The Chamfer similarity of a query’s tokens against a document’s: for each query token, the best it does against any document token, averaged over the query.
This is the score the encoding approximates, and it is what to rerank the
candidates with once the index has narrowed the collection down, the same
way crate::Partitions::search reranks estimates against the full
precision vectors. It is quadratic in the token counts, which is why it runs
on the handful the index handed back and not on the collection.
§Panics
If dim is zero, or if either side is not a whole number of dim
dimensional vectors.