Package it.unimi.di.big.mg4j.search.score
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.
-
Interface Summary Interface Description DelegatingScorer A marker interface for those scorers that delegate allIntIterator
's method to the underlyingDocumentIterator
.Scorer A wrapper for aDocumentIterator
returning scored document pointers. -
Class Summary Class Description AbstractAggregator AScorer
that aggregates a number of underlyingdelegating scorers
, providing equalisation if required.AbstractScorer An abstract implementation ofScorer
.AbstractWeightedScorer An abstract subsclass ofAbstractScorer
providing internal storage and copy of the weight map and a default implementation ofAbstractWeightedScorer.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.