RRF - Reciprocal Rank Fusion in Rust
A lightweight, efficient implementation of the Reciprocal Rank Fusion (RRF) algorithm in Rust.
What is RRF?
Reciprocal Rank Fusion (RRF) is a simple but effective method for combining multiple ranked lists. It's commonly used in information retrieval, search engines, and recommendation systems to fuse results from different ranking algorithms.
RRF works by assigning a score to each document based on its position in each ranked list, then combining these scores to create a final ranking. The formula is:
RRF_score(document) = ∑ 1/(k + rank_i)
where k is a constant (commonly 60) that mitigates the impact of high rankings in individual lists.
Features
- Standard RRF algorithm implementation
- Weighted RRF variant for assigning different importance to different ranking sources
- Generic implementation that works with any hashable, comparable type
- Zero external dependencies
- Thoroughly tested
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Usage
Basic Usage
use fuse;
Weighted RRF
If some ranking algorithms are more trustworthy than others, you can assign weights:
use fuse_weighted;
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Feel free to open issues or pull requests.