bi_encoder_model

Model module for bi-encoder models.

This module defines the model class used to implement bi-encoder models.

Classes

BiEncoderEmbedding(embeddings, scoring_mask, ...)

Dataclass containing embeddings and the encoding for single-vector bi-encoder models.

BiEncoderModel(config, *args, **kwargs)

A bi-encoder model that encodes queries and documents separately and computes a relevance score between them.

BiEncoderOutput([scores, query_embeddings, ...])

Dataclass containing the output of a bi-encoder model.

MultiVectorBiEncoderModel(config, *args, ...)

SingleVectorBiEncoderModel(config, *args, ...)

A bi-encoder model that encodes queries and documents separately, pools the contextualized embeddings into a single vector, and computes a relevance score based on the similarities between the two vectors.