Expand description
FlashRank cross-encoder reranking for frankensearch.
Provides the FlashRankReranker implementation of the Reranker trait,
using ONNX Runtime for cross-encoder scoring with sigmoid activation on raw
logits. Gracefully falls back to original scores if the model is unavailable.
§Model Layout
Required files in the model directory:
onnx/model.onnx(preferred) ORmodel.onnx(legacy)tokenizer.json
§Architecture
Cross-encoders differ from bi-encoders: instead of comparing pre-computed embeddings, they process the query and document together through a transformer, producing direct token-level attention between them. This is dramatically more accurate but cannot pre-compute anything.
(query, document) → tokenize → ONNX → logit → sigmoid → score ∈ [0, 1]Re-exports§
pub use pipeline::DEFAULT_MIN_CANDIDATES;pub use pipeline::DEFAULT_TOP_K_RERANK;pub use pipeline::rerank_step;
Modules§
- pipeline
- Rerank pipeline step: integrates cross-encoder reranking into the search pipeline.
Structs§
- Flash
Rank Reranker FlashRankcross-encoder reranker backed by ONNX Runtime.
Constants§
- DEFAULT_
MAX_ LENGTH - Default maximum input token length for cross-encoder pairs.
- DEFAULT_
MODEL_ NAME - Default model directory name for the
FlashRanknano cross-encoder.
Functions§
- find_
model_ dir - Search for a
FlashRankmodel directory in standard locations.