:mod:`capreolus.reranker.TFKNRM` ================================ .. py:module:: capreolus.reranker.TFKNRM Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: capreolus.reranker.TFKNRM.TFKNRM_Class capreolus.reranker.TFKNRM.TFKNRM .. py:class:: TFKNRM_Class(extractor, config, **kwargs) Bases: :class:`tensorflow.keras.Model` .. method:: get_score(self, doc_tok, query_tok, query_idf) .. method:: call(self, x, **kwargs) During training, both posdoc and negdoc are passed During eval, both posdoc and negdoc are passed but negdoc would be a zero tensor Whether negdoc is a legit doc tensor or a dummy zero tensor is determined by which sampler is used (eg: sampler.TrainDataset) as well as the extractor (eg: EmbedText) Unlike the pytorch KNRM model, KNRMTF accepts both the positive and negative document in its forward pass. It scores them separately and returns the score difference (i.e posdoc_score - negdoc_score). .. py:class:: TFKNRM Bases: :class:`capreolus.reranker.Reranker` .. attribute:: module_name :annotation: = TFKNRM .. attribute:: dependencies .. attribute:: config_spec .. method:: build_model(self)