capreolus.reranker.TFVanillaBert

Module Contents

Classes

TFVanillaBert_Class

TFVanillaBERT

TensorFlow implementation of Vanilla BERT.

Attributes

logger

capreolus.reranker.TFVanillaBert.logger[source]
class capreolus.reranker.TFVanillaBert.TFVanillaBert_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]
score(self, x, **kwargs)[source]
score_pair(self, x, **kwargs)[source]
class capreolus.reranker.TFVanillaBert.TFVanillaBERT(config=None, provide=None, share_dependency_objects=False, build=True)[source]

Bases: capreolus.reranker.Reranker

TensorFlow implementation of Vanilla BERT. Input is of the form [CLS] sentence A [SEP] sentence B [SEP] The “score” of a query (sentence A) - document (sentence B) pair is the probability that the document is relevant to the query. This is achieved through a linear classifier layer attached to BERT’s last layer and using the logits[1] as the score.

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