Conversation

Learning

XPM Configxpmir.conversation.learning.DatasetConversationEntrySampler(*, datasets)[source]

Bases: BaseSampler, DatasetConversationBase

Submit type: xpmir.conversation.learning.DatasetConversationEntrySampler

Uses a conversation dataset and topic records entries

datasets: List[datamaestro_text.data.conversation.base.ConversationDataset]

The conversation datasets

XPM Configxpmir.conversation.learning.reformulation.ConversationRepresentationEncoder[source]

Bases: TextEncoderBase[List[Record], RepresentationOutput], ABC

Submit type: xpmir.conversation.learning.reformulation.ConversationRepresentationEncoder

XPM Configxpmir.conversation.learning.reformulation.DecontextualizedQueryConverter[source]

Bases: Converter[Record, str]

Submit type: xpmir.conversation.learning.reformulation.DecontextualizedQueryConverter

XPM Configxpmir.conversation.learning.DatasetConversationBase(*, datasets)[source]

Bases: Config

Submit type: xpmir.conversation.learning.DatasetConversationBase

datasets: List[datamaestro_text.data.conversation.base.ConversationDataset]

The conversation datasets

XPM Configxpmir.conversation.learning.DatasetConversationIterator(*, datasets)[source]

Bases: SampleIterator, DatasetConversationBase

Submit type: xpmir.conversation.learning.DatasetConversationIterator

datasets: List[datamaestro_text.data.conversation.base.ConversationDataset]

The conversation datasets

CoSPLADE

XPM Configxpmir.conversation.models.cosplade.AsymetricMSEContextualizedRepresentationLoss(*, weight)[source]

Bases: AlignmentLoss[CoSPLADEOutput, TextsRepresentationOutput]

Submit type: xpmir.conversation.models.cosplade.AsymetricMSEContextualizedRepresentationLoss

Computes the asymetric loss for CoSPLADE

weight: float = 1.0

Weight for this loss

version: int = 3constant

Current version version 3: uses q_answers and not q_cosplade

XPM Configxpmir.conversation.models.cosplade.CoSPLADE(*, history_size, queries_encoder, history_encoder, reverse_queries)[source]

Bases: ConversationRepresentationEncoder

Submit type: xpmir.conversation.models.cosplade.CoSPLADE

CoSPLADE model

history_size: int = 0

Size of history to take into account (0 for infinite)

queries_encoder: xpmir.neural.splade.SpladeTextEncoderV2[List[List[str]]]

Encoder for the query history (the first one being the current one)

history_encoder: xpmir.neural.splade.SpladeTextEncoderV2[Tuple[str, str]]

Encoder for (query, answer) pairs

version: int = 2constant

Current version

reverse_queries: bool = False

If True, use the order q_n, q_1, …, q_{n-1}. If False, q_n, q_{n-1}, …, q_1 The original CoSPLADE uses True for this parameter