capreolus.reranker.CEDRKNRM

Module Contents

Classes

CEDRKNRM_Class

CEDRKNRM

PyTorch implementation of CEDR-KNRM.

Attributes

logger

capreolus.reranker.CEDRKNRM.logger[source]
class capreolus.reranker.CEDRKNRM.CEDRKNRM_Class(extractor, config, *args, **kwargs)[source]

Bases: torch.nn.Module

masked_simmats(self, embeddings, bert_mask, bert_segments)[source]
knrm(self, bert_output, bert_mask, bert_segments, batch_size)[source]
forward(self, bert_input, bert_mask, bert_segments)[source]
class capreolus.reranker.CEDRKNRM.CEDRKNRM(config=None, provide=None, share_dependency_objects=False, build=True)[source]

Bases: capreolus.reranker.Reranker

PyTorch implementation of CEDR-KNRM. Equivalant to BERT-KNRM when cls=None.

CEDR: Contextualized Embeddings for Document Ranking Sean MacAvaney, Andrew Yates, Arman Cohan, and Nazli Goharian. SIGIR 2019. https://arxiv.org/pdf/1904.07094

module_name = CEDRKNRM[source]
dependencies[source]
config_spec[source]
build_model(self)[source]
score(self, d)[source]
test(self, d)[source]