Skip to content

Latest commit

 

History

History
95 lines (59 loc) · 6.92 KB

File metadata and controls

95 lines (59 loc) · 6.92 KB
graph LR
    TransformerRanker["TransformerRanker"]
    ColBERTRanker["ColBERTRanker"]
    MonoVLMRanker["MonoVLMRanker"]
    MXBAIV2Ranker["MXBAIV2Ranker"]
    T5Ranker["T5Ranker"]
    UPRRanker["UPRRanker"]
    TransformerRanker -- "calls tokenize" --> TransformerRanker
    TransformerRanker -- "tokenize provides processed input to rank" --> TransformerRanker
    ColBERTRanker -- "delegates rank to _colbert_rank for core processing" --> ColBERTRanker
    ColBERTRanker -- "_colbert_rank orchestrates encoding and scoring" --> ColBERTRanker
    MonoVLMRanker -- "delegates rank to internal scoring logic (_get_scores)" --> MonoVLMRanker
    MXBAIV2Ranker -- "delegates rank to _predict" --> MXBAIV2Ranker
    MXBAIV2Ranker -- "_predict calls _prepare_batch" --> MXBAIV2Ranker
    T5Ranker -- "delegates rank to _get_scores" --> T5Ranker
    T5Ranker -- "_get_scores calls _greedy_decode" --> T5Ranker
    UPRRanker -- "delegates rank to _get_scores" --> UPRRanker
Loading

CodeBoardingDemoContact

Details

The rerankers subsystem provides a modular framework for various transformer-based reranking models. At its core, the TransformerRanker serves as a generic base, handling common operations like tokenization and the overall ranking process. Specialized rerankers, such as ColBERTRanker, MonoVLMRanker, MXBAIV2Ranker, T5Ranker, and UPRRanker, extend this functionality by implementing their unique model-specific inference and scoring mechanisms. For instance, ColBERTRanker delegates its primary rank operation to an internal _colbert_rank method, which then orchestrates the distinct encoding of queries and documents, followed by interaction-based scoring. Similarly, MXBAIV2Ranker relies on an internal _predict method, which in turn prepares batches for efficient processing. This design ensures that each reranker component encapsulates its specific logic while leveraging a common interface for integration.

TransformerRanker

Implements a generic reranking strategy for transformer models (e.g., CrossEncoder). It handles the core logic for model loading, tokenization, and inference common to many transformer-based rerankers.

Related Classes/Methods:

ColBERTRanker

Provides a specific reranking strategy based on the ColBERT architecture, including distinct query and document encoding, and interaction-based scoring.

Related Classes/Methods:

MonoVLMRanker

Implements the reranking strategy for MonoVLM models, focusing on their specific inference and scoring mechanisms.

Related Classes/Methods:

MXBAIV2Ranker

Encapsulates the reranking logic for MXBAI V2 models, managing batch preparation and prediction.

Related Classes/Methods:

T5Ranker

Implements the reranking strategy specific to T5 models, including their unique scoring mechanism via decoding.

Related Classes/Methods:

UPRRanker

Implements the reranking strategy for UPR (Unsupervised Passage Reranking) models, focusing on their distinct scoring methodology.

Related Classes/Methods: