CrossEncoderConfig
- class lightning_ir.cross_encoder.cross_encoder_config.CrossEncoderConfig(query_length: int | None = 32, doc_length: int | None = 512, pooling_strategy: 'first' | 'mean' | 'max' | 'sum' = 'first', linear_bias: bool = False, **kwargs)[source]
Bases:
LightningIRConfig- __init__(query_length: int | None = 32, doc_length: int | None = 512, pooling_strategy: 'first' | 'mean' | 'max' | 'sum' = 'first', linear_bias: bool = False, **kwargs)[source]
Configuration class for a cross-encoder model
- Parameters:
query_length (int | None) – Maximum number of tokens per query. If None does not truncate. Defaults to 32.
doc_length (int | None) – Maximum number of tokens per document. If None does not truncate. Defaults to 512.
pooling_strategy (Literal['first', 'mean', 'max', 'sum']) – Pooling strategy to aggregate the contextualized embeddings into a single vector for computing a relevance score. Defaults to “first”.
linear_bias (bool) – Whether to use a bias in the prediction linear layer. Defaults to False.
Methods
__init__([query_length, doc_length, ...])Configuration class for a cross-encoder model
Attributes
Model type for cross-encoder models.