Module Contents


POSITDRMM_basic(extractor, pipeline_config)
POSITDRMM_class(extractor, config)
POSITDRMM(config=None, provide=None, share_dependency_objects=False, build=True) Base class for profane modules.
class capreolus.reranker.POSITDRMM.POSITDRMM_basic(extractor, pipeline_config)[source]

Bases: torch.nn.Module

forward(self, sentence, query_sentence, query_idf, extra)[source]
class capreolus.reranker.POSITDRMM.POSITDRMM_class(extractor, config)[source]

Bases: torch.nn.Module

forward(self, query_sentence, query_idf, pos_sentence, neg_sentence, posdoc_extra, negdoc_extra)[source]
test_forward(self, query_sentence, query_idf, pos_sentence, extras)[source]
class capreolus.reranker.POSITDRMM.POSITDRMM(config=None, provide=None, share_dependency_objects=False, build=True)[source]

Bases: capreolus.reranker.Reranker

Base class for profane modules. Module construction proceeds as follows: 1) Any config options not present in config are filled in with their default values. Config options and their defaults are specified in the config_spec class attribute. 2) Any dependencies declared in the dependencies class attribute are recursively instantiated. If the dependency object is present in provide, this object will be used instead of instantiating a new object for the dependency. 3) The module object’s config variable is updated to reflect the configs of its dependencies and then frozen.

After construction is complete, the module’s dependencies are available as instance variables: self.`dependency key`.

  • config – dictionary containing a config to apply to this module and its dependencies
  • provide – dictionary mapping dependency keys to module objects
  • share_dependency_objects – if true, dependencies will be cached in the registry based on their configs and reused. See the share_objects argument of ModuleBase.create.
description = Ryan McDonald, George Brokos, and Ion Androutsopoulos. 2018. Deep Relevance Ranking Using Enhanced Document-Query Interactions. In EMNLP'18.[source]
module_name = POSITDRMM[source]
score(self, data)[source]
test(self, data)[source]
zero_grad(self, *args, **kwargs)[source]
get_searcher_scores(self, qids, doc_ids)[source]
clean(self, text)[source]

Remove pad tokens from the text

get_bigrams(self, text)[source]
get_bigram_match_count(self, query, doc)[source]
get_exact_match_count(self, query, single_doc, query_idf)[source]
get_exact_match_stats(self, query_idf_batch, query_batch, doc_batch)[source]

The extra 4 features that must be combined to the relevant score. See section 4.1 beginning.