Menu

Query Processing Model

sjh John Foley

Query Processing Model

A query processing model is an interface that allows the execution of a query. In general, the input is a fully transformed, fully annotated query node, and the query parameter object. It also has a reference to a local retrieval, because it is instantiated locally.

Using your own processing model

Retrieval retrieval = RetrievalFactory.instance(.../*something clever here*/);

Parameters queryParameters = new Parameters();
queryParameters.set("processingModel", MyProcessingModel.class.getCanonicalName());

// use StructuredQuery to parse galago/indri style queries.
Node parsedQuery = StructuredQuery.parse("Who let the dogs out?");

// transform the query using all the traversals, one of which annotates statistics into the dirichlet nodes...
Node finalQuery = retrieval.transformQuery(parsedQuery, queryParameters);

// run the query, your processing model will be invoked
List<ScoredDocument> docs = retrieval.executeQuery(finalQuery, queryParameters).scoredDocuments;

Processing models that are good examples:

The built-in ones can be found in this package, in general, but there seems to be a convention of naming them *Model

org.lemurproject.galago.core.retrieval.processing.*
  • RankedDocumentModel, document at a time processing
  • WorkingSetPassageModel, scores passages from a "working" set of documents

All of them extend the abstract class ProcessingModel, which is a simple interface.


Related

Wiki: Galago Query Language

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.