capreolus.extractor

Package Contents

Classes

Extractor(config=None, provide=None, share_dependency_objects=False, build=True) Base class for Extractor modules. The purpose of an Extractor is to convert queries and documents to a representation suitable for use with a Reranker module.
capreolus.extractor.logger[source]
class capreolus.extractor.Extractor(config=None, provide=None, share_dependency_objects=False, build=True)[source]

Bases: capreolus.ModuleBase

Base class for Extractor modules. The purpose of an Extractor is to convert queries and documents to a representation suitable for use with a Reranker module.

Modules should provide:
  • an id2vec(qid, posid, negid=None) method that converts the given query and document ids to an appropriate representation
module_type = extractor[source]
cache_state(self, qids, docids)[source]
load_state(self, qids, docids)[source]
get_state_cache_file_path(self, qids, docids)[source]

Returns the path to the cache file used to store the extractor state, regardless of whether it exists or not

is_state_cached(self, qids, docids)[source]

Returns a boolean indicating whether the state corresponding to the qids and docids passed has already been cached

build_from_benchmark(self, *args, **kwargs)[source]