Reranking library for search & retrieval pipelines
Top 43.3% on sourcepulse
FlashRank is a Python library designed to integrate state-of-the-art re-ranking capabilities into search and retrieval pipelines. It offers both lightweight, CPU-compatible pairwise re-rankers and more powerful, listwise LLM-based re-rankers, targeting developers and researchers seeking to enhance search result relevance without significant overhead.
How It Works
FlashRank leverages pre-trained cross-encoder and LLM models for re-ranking. Cross-encoder models process query-passage pairs directly for high accuracy, while LLM-based listwise re-rankers consider the entire list of passages simultaneously for potentially better contextual understanding. The library emphasizes minimal dependencies, with its smallest model requiring no PyTorch or Transformers, enabling CPU execution and small deployment footprints.
Quick Start & Requirements
pip install flashrank
for pairwise re-rankers or pip install flashrank[listwise]
for LLM-based re-rankers.Highlighted Details
Maintenance & Community
The project is maintained by Prithiviraj Damodaran and is open for contributions. Links to relevant papers and citation information are provided.
Licensing & Compatibility
The library is licensed under the Apache 2.0 license, permitting commercial use and integration with closed-source projects.
Limitations & Caveats
The rank_zephyr_7b_v1_full
model currently supports a maximum of 20 passages per pass, with sliding window logic yet to be implemented. Users should adjust max_length
based on their passage token counts for optimal performance.
1 month ago
Inactive