1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Re-ranking with cross-encoders for improved search quality
//!
//! This module implements two-stage retrieval:
//! 1. Fast retrieval with bi-encoders (semantic search)
//! 2. Precise re-ranking with cross-encoders
//!
//! Cross-encoders jointly encode query and document for more accurate
//! relevance scoring, but at higher computational cost. By applying them
//! only to top-k candidates, we get both speed and accuracy.
//!
//! ## Features
//! - Multiple cross-encoder backends (local models, API-based)
//! - Score fusion strategies (linear, rank-based, learned)
//! - Batch processing for efficiency
//! - Result caching
//! - Diversity-aware re-ranking
//!
//! ## Example
//! ```rust,ignore
//! use oxirs_vec::reranking::{CrossEncoderReranker, RerankingConfig};
//!
//! let config = RerankingConfig::default();
//! let reranker = CrossEncoderReranker::new(config)?;
//!
//! // First stage: fast retrieval
//! let candidates = vector_store.search("machine learning", 100)?;
//!
//! // Second stage: precise re-ranking
//! let reranked = reranker.rerank("machine learning", &candidates, 10)?;
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;