capreolus.searcher

Submodules

Package Contents

Classes

Searcher

Base class for Searcher modules. The purpose of a Searcher is to query a collection via an Index module.

Functions

list2str(l, delimiter='-')

Attributes

logger

MAX_THREADS

capreolus.searcher.logger[source]
capreolus.searcher.MAX_THREADS[source]
capreolus.searcher.list2str(l, delimiter='-')[source]
class capreolus.searcher.Searcher(config=None, provide=None, share_dependency_objects=False, build=True)[source]

Bases: capreolus.ModuleBase

Base class for Searcher modules. The purpose of a Searcher is to query a collection via an Index module.

Similar to Rerankers, Searchers return a list of documents and their relevance scores for a given query. Searchers are unsupervised and efficient, whereas Rerankers are supervised and do not use an inverted index directly.

Modules should provide:
  • a query(string) and a query_from_file(path) method that return document scores

module_type = searcher[source]
static load_trec_run(fn)[source]
static write_trec_run(preds, outfn)[source]
query_from_file(self, topicsfn, output_path)[source]
query(self, query, **kwargs)[source]

search document based on given query, using parameters in config as default