SetEncoderConfig

class lightning_ir.models.cross_encoders.set_encoder.SetEncoderConfig(*args, depth: int = 100, add_extra_token: bool = False, sample_missing_docs: bool = True, **kwargs)[source]

Bases: MonoConfig

Configuration class for a SetEncoder model.

__init__(*args, depth: int = 100, add_extra_token: bool = False, sample_missing_docs: bool = True, **kwargs)[source]

A SetEncoder model encodes a query and a set of documents jointly. Each document’s embedding is updated with context from the entire set, and a relevance score is computed per document using a linear layer.

Parameters:
  • depth (int) – Number of documents to encode per query. Defaults to 100.

  • add_extra_token (bool) – Whether to add an extra token to the input sequence to separate the query from the documents. Defaults to False.

  • sample_missing_docs (bool) – Whether to sample missing documents when the number of documents is less than the specified depth. Defaults to True.

Methods

__init__(*args[, depth, add_extra_token, ...])

A SetEncoder model encodes a query and a set of documents jointly.

Attributes

model_type

Model type for a SetEncoder model.

model_type: str = 'set-encoder'

Model type for a SetEncoder model.