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]