Configuraiton

This module contains functionality related to the the configuraiton module for augmentation.components.postprocessors.colbert_rerank.

Configuraiton

ColbertRerankConfiguration

Bases: PostProcessorConfiguration

Configuration for the ColBERT reranking postprocessor.

This class defines the settings needed to perform document reranking using the ColBERT retrieval model, which improves search quality through late interaction between queries and documents.

Source code in src/augmentation/components/postprocessors/colbert_rerank/configuraiton.py
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
class ColbertRerankConfiguration(PostProcessorConfiguration):
    """
    Configuration for the ColBERT reranking postprocessor.

    This class defines the settings needed to perform document reranking
    using the ColBERT retrieval model, which improves search quality through
    late interaction between queries and documents.
    """

    class Models(str, Enum):
        """Supported ColBERT models for reranking."""

        COLBERTV2 = "colbert-ir/colbertv2.0"

    class Tokenizers(str, Enum):
        """Supported tokenizers for ColBERT reranking."""

        COLBERTV2 = "colbert-ir/colbertv2.0"

    name: Literal[PostProcessorName.COLBERT_RERANK] = Field(
        ..., description="The name of the postprocessor."
    )
    model: Models = Field(
        Models.COLBERTV2, description="Model used for reranking"
    )
    tokenizer: Tokenizers = Field(
        Tokenizers.COLBERTV2, description="Tokenizer used for reranking"
    )
    top_n: int = Field(5, description="Number of documents to be reranked")
    keep_retrieval_score: bool = Field(
        True,
        description="Toggle to keep the retrieval score after the reranking",
    )

Models

Bases: str, Enum

Supported ColBERT models for reranking.

Source code in src/augmentation/components/postprocessors/colbert_rerank/configuraiton.py
21
22
23
24
class Models(str, Enum):
    """Supported ColBERT models for reranking."""

    COLBERTV2 = "colbert-ir/colbertv2.0"

Tokenizers

Bases: str, Enum

Supported tokenizers for ColBERT reranking.

Source code in src/augmentation/components/postprocessors/colbert_rerank/configuraiton.py
26
27
28
29
class Tokenizers(str, Enum):
    """Supported tokenizers for ColBERT reranking."""

    COLBERTV2 = "colbert-ir/colbertv2.0"