capreolus.reranker.birch

Module Contents

Classes

Birch_Class

Birch

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.

Attributes

logger

capreolus.reranker.birch.logger[source]
class capreolus.reranker.birch.Birch_Class(extractor, config)[source]

Bases: torch.nn.Module

forward(self, doc, seg, mask)[source]
score_passages(self, doc, seg, mask, batch)[source]
class capreolus.reranker.birch.Birch(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 = birch[source]
config_spec[source]
dependencies[source]
build_model(self)[source]
score(self, d)[source]
test(self, d)[source]