capreolus.reranker.TFCEDRKNRM

Module Contents

Classes

TFCEDRKNRM_Class

TFCEDRKNRM

Base class for Reranker modules. The purpose of a Reranker is to predict relevance scores for input documents. Rerankers are generally supervised methods implemented in PyTorch or TensorFlow.

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

Bases: tensorflow.keras.layers.Layer

masked_simmats(self, embeddings, bert_mask, bert_segments)[source]
knrm(self, bert_output, bert_mask, bert_segments, batch_size)[source]
call(self, x, **kwargs)[source]
predict_step(self, data)[source]
score(self, x, **kwargs)[source]
score_pair(self, x, **kwargs)[source]
class capreolus.reranker.TFCEDRKNRM.TFCEDRKNRM(config=None, provide=None, share_dependency_objects=False, build=True)[source]

Bases: capreolus.reranker.Reranker

Base class for Reranker modules. The purpose of a Reranker is to predict relevance scores for input documents. Rerankers are generally supervised methods implemented in PyTorch or TensorFlow.

Modules should provide:
  • a build_model method that initializes the model used

  • a score and a test method that take a representation created by an Extractor module as input and return document scores

  • a load_weights and a save_weights method, if the base class’ PyTorch methods cannot be used

module_name = TFCEDRKNRM[source]
dependencies[source]
config_spec[source]
build_model(self)[source]