primeqa.ir.dense.dpr_top.dpr.dataloader_biencoder.BiEncoderBatches#

class primeqa.ir.dense.dpr_top.dpr.dataloader_biencoder.BiEncoderBatches(insts: List[primeqa.ir.dense.dpr_top.dpr.dataloader_biencoder.BiEncoderInst], hypers: primeqa.ir.dense.dpr_top.dpr.biencoder_hypers.BiEncoderHypers, qry_tokenizer: transformers.tokenization_utils_fast.PreTrainedTokenizerFast, ctx_tokenizer: transformers.tokenization_utils_fast.PreTrainedTokenizerFast)#

Bases: primeqa.ir.dense.dpr_top.dataloader.distloader_base.DistBatchesBase

Methods

create_conflict_free_batches

Since we do batch negatives we want to ensure that the batch does not contain instances where the batch negatives contain positives.

make_batch

post_init

create_conflict_free_batches(random)#

Since we do batch negatives we want to ensure that the batch does not contain instances where the batch negatives contain positives. :return: