capreolus.reranker.TFBERTMaxP

Module Contents

Classes

TFElectraRelevanceHead BERT-style ClassificationHead (i.e., out_proj only – no dense). See transformers.TFElectraClassificationHead
TFBERTMaxP_Class
TFBERTMaxP TensorFlow implementation of BERT-MaxP.
class capreolus.reranker.TFBERTMaxP.TFElectraRelevanceHead(dropout, out_proj, *args, **kwargs)[source]

Bases: tensorflow.keras.layers.Layer

BERT-style ClassificationHead (i.e., out_proj only – no dense). See transformers.TFElectraClassificationHead

call(self, inputs, **kwargs)[source]
class capreolus.reranker.TFBERTMaxP.TFBERTMaxP_Class(extractor, config, *args, **kwargs)[source]

Bases: tensorflow.keras.layers.Layer

call(self, x, **kwargs)[source]

Returns logits of shape [2]

predict_step(self, data)[source]

Scores each passage and applies max pooling over it.

score(self, x, **kwargs)[source]
score_pair(self, x, **kwargs)[source]
class capreolus.reranker.TFBERTMaxP.TFBERTMaxP(config=None, provide=None, share_dependency_objects=False, build=True)[source]

Bases: capreolus.reranker.Reranker

TensorFlow implementation of BERT-MaxP.

Deeper Text Understanding for IR with Contextual Neural Language Modeling. Zhuyun Dai and Jamie Callan. SIGIR 2019. https://arxiv.org/pdf/1905.09217.pdf

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