Class BM25FScorer.Visitor
- java.lang.Object
-
- it.unimi.di.big.mg4j.search.visitor.AbstractDocumentIteratorVisitor
-
- it.unimi.di.big.mg4j.search.score.BM25FScorer.Visitor
-
- All Implemented Interfaces:
DocumentIteratorVisitor<Boolean>
- Enclosing class:
- BM25FScorer
protected static final class BM25FScorer.Visitor extends AbstractDocumentIteratorVisitor
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanexpectedIDFWhether we are running Boldi's variant.protected double[]idfPartPrecomputed IDF part.protected double[]index2BFor each index, the associated parameter b.protected double[]index2BDividedByAvgDocumentSizeCached value.protected intnumberOfIndicesThe length ofTermCollectionVisitor.indices()cached.protected intnumberOfOffsetsSeenThe number of valid entries inseenOffsetsList.protected intnumberOfTermsSeenThe number of terms (irrespective of the index) seen up to now and accumulated inseenTermIdsList.protected int[]offset2IndexAn array indexed by offsets mapping each offset to the corresponding index number.protected int[]offset2TermIdFor each offset, the corresponding term id in the query.protected boolean[]seenWhether we have already seen a specific term/index pair.protected int[]seenOffsetsListAn array accumulating the indices inseenthat have been set to true, so to acceleratereset(long).protected int[]seenTermIdsListThe list ofnumberOfTermsSeenterm ids that we have seen so far.protected IntBigList[]sizesFor each index, its list of document sizes.protected double[]sizeWeightComponentCached fromBM25Scorer.protected int[]termId2VirtualCounterFor each term id, its virtual-counter index (to be used to accessvirtualCountandvirtualIdfCount).protected double[]virtualCountAn array indexed by term ids used byBM25FScorer.score()to compute virtual counts.protected double[]virtualIdfCountFor expected IDF runs, an array indexed by term ids used byBM25FScorer.score()to compute virtual counts combined with IDF scoring.protected double[]weightFor each index, its weight.
-
Constructor Summary
Constructors Constructor Description Visitor(boolean expectedIDF, double[] idfPart, int[] offset2TermId, int[] offset2Index, double[] weight, double[] index2B, IntBigList[] sizes, double[] index2BDividedByAvgDocumentSize)
-
Method Summary
Modifier and Type Method Description voidreset(long document)Booleanvisit(IndexIterator indexIterator)Visits anIndexIteratorleaf.
-
-
-
Field Detail
-
sizeWeightComponent
protected final double[] sizeWeightComponent
Cached fromBM25Scorer.
-
numberOfIndices
protected final int numberOfIndices
The length ofTermCollectionVisitor.indices()cached.
-
seenOffsetsList
protected final int[] seenOffsetsList
An array accumulating the indices inseenthat have been set to true, so to acceleratereset(long).
-
numberOfOffsetsSeen
protected int numberOfOffsetsSeen
The number of valid entries inseenOffsetsList.
-
seen
protected final boolean[] seen
Whether we have already seen a specific term/index pair.
-
numberOfTermsSeen
protected int numberOfTermsSeen
The number of terms (irrespective of the index) seen up to now and accumulated inseenTermIdsList.
-
seenTermIdsList
protected final int[] seenTermIdsList
The list ofnumberOfTermsSeenterm ids that we have seen so far.
-
termId2VirtualCounter
protected final int[] termId2VirtualCounter
For each term id, its virtual-counter index (to be used to accessvirtualCountandvirtualIdfCount).
-
sizes
protected final IntBigList[] sizes
For each index, its list of document sizes.
-
weight
protected final double[] weight
For each index, its weight.
-
index2B
protected final double[] index2B
For each index, the associated parameter b.
-
expectedIDF
protected final boolean expectedIDF
Whether we are running Boldi's variant.
-
offset2TermId
protected final int[] offset2TermId
For each offset, the corresponding term id in the query.
-
offset2Index
protected final int[] offset2Index
An array indexed by offsets mapping each offset to the corresponding index number.
-
virtualCount
protected final double[] virtualCount
An array indexed by term ids used byBM25FScorer.score()to compute virtual counts.
-
virtualIdfCount
protected final double[] virtualIdfCount
For expected IDF runs, an array indexed by term ids used byBM25FScorer.score()to compute virtual counts combined with IDF scoring.
-
index2BDividedByAvgDocumentSize
protected final double[] index2BDividedByAvgDocumentSize
Cached value.
-
idfPart
protected final double[] idfPart
Precomputed IDF part.
-
-
Constructor Detail
-
Visitor
public Visitor(boolean expectedIDF, double[] idfPart, int[] offset2TermId, int[] offset2Index, double[] weight, double[] index2B, IntBigList[] sizes, double[] index2BDividedByAvgDocumentSize)
-
-
Method Detail
-
visit
public Boolean visit(IndexIterator indexIterator) throws IOException
Description copied from interface:DocumentIteratorVisitorVisits anIndexIteratorleaf.- Parameters:
indexIterator- the leaf to be visited.- Returns:
- an appropriate return value if the visit should continue, or
null. - Throws:
IOException
-
reset
public void reset(long document)
-
-