Package it.unimi.di.mg4j.search.score

Classes for assigning scores to documents.

See:
          Description

Interface Summary
DelegatingScorer A marker interface for those scorers that delegate all IntIterator's method to the underlying DocumentIterator.
Scorer A wrapper for a DocumentIterator returning scored document pointers.
 

Class Summary
AbstractAggregator A Scorer that aggregates a number of underlying delegating scorers, providing equalisation if required.
AbstractScorer An abstract implementation of Scorer.
AbstractWeightedScorer An abstract subclass of AbstractScorer providing internal storage and copy of the weight map and a default implementation of AbstractWeightedScorer.score().
BM25FScorer A scorer that implements the BM25F ranking scheme.
BM25FScorer.Visitor  
BM25Scorer A scorer that implements the BM25 ranking scheme.
ClarkeCormackScorer Computes the Clarke–Cormack score of all interval iterators of a document.
ConstantScorer A scorer assigning a constant score (0 by default) to all documents.
CountScorer A trivial scorer that computes the score by adding the counts (the number of occurrences within the current document) of each term multiplied by the weight of the relative index.
DecreasingDocumentRankScorer Compute scores that do not depend on intervals, but that just assign a fixed score to each document starting from 1; scores are read from a file whose name is passed to the constructor.
DocumentRankScorer Compute scores that do not depend on intervals, but that just assign a fixed score to each document; scores are read from a file whose name is passed to the constructor.
DocumentScoreInfo<T> A container used to return scored results with additional information.
LinearAggregator An aggregator that computes a linear combination of the component scorers.
ScoredDocumentBoundedSizeQueue<T> A queue of scored documents with fixed maximum capacity.
TfIdfScorer A scorer that implements the TF/IDF ranking formula.
VignaScorer Computes the Vigna score of all interval iterators of a document.
 

Package it.unimi.di.mg4j.search.score Description

Classes for assigning scores to documents.

A Scorer is an object that wraps an underlying DocumentIterator and assigns scores to the documents returned by the underlying iterator. In general, once a scorer has wrapped a document iterator one just calls nextInt() and Scorer.score() to get scored documents (some iterators might support index-restricted scoring, but this is optional).

If the scorer is a DelegatingScorer, then by contract it just delegates all IntIterator's methods to the underlying iterator. In this case, it is possible to advance manually the underlying iterator and call Scorer.score(). While this behaviour is useless for general users, it is essential for aggregated scorers, which combine several delegating scorers and provide services such as equalisation and interval caching (in case more than one component scorer uses intervals). See, for instance, LinearAggregator.

Creating scorers from string descriptions

Scorers should provide, whenever possible, constructors accepting exclusively strings. Such constructors makes it possible to create easily instances using the ObjectParser conventions, so that instances can be specified on a command line interface.