rerank-blend 0.1.0

Blend N RAG reranker score streams (dense, BM25, cross-encoder) with configurable weights and rank-aware normalization. Zero deps.
Documentation
  • Coverage
  • 100%
    5 out of 5 items documented1 out of 4 items with examples
  • Size
  • Source code size: 20.37 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 316.91 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 26s Average build duration of successful builds.
  • all releases: 26s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • MukundaKatta/rerank-blend
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MukundaKatta

rerank-blend

crates.io

Blend N RAG reranker score streams with weighted normalization or Reciprocal Rank Fusion.

use rerank_blend::{blend_weighted, blend_rrf, RrfOpts};

let dense = vec![("a", 0.91), ("b", 0.88), ("c", 0.55)];
let bm25  = vec![("a", 12.3), ("c", 8.1),  ("b", 3.4)];

let weighted = blend_weighted(&[(&dense[..], 0.7), (&bm25[..], 0.3)]);
let rrf      = blend_rrf(&[&dense[..], &bm25[..]], RrfOpts::default());

blend_weighted min-max normalizes each stream so scale differences don't dominate. blend_rrf is score-free (Cormack et al. 2009 RRF; default k=60). Zero deps. MIT or Apache-2.0.