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 boolean
expectedIDF
Whether we are running Boldi's variant.protected double[]
idfPart
Precomputed IDF part.protected double[]
index2B
For each index, the associated parameter b.protected double[]
index2BDividedByAvgDocumentSize
Cached value.protected int
numberOfIndices
The length ofTermCollectionVisitor.indices()
cached.protected int
numberOfOffsetsSeen
The number of valid entries inseenOffsetsList
.protected int
numberOfTermsSeen
The number of terms (irrespective of the index) seen up to now and accumulated inseenTermIdsList
.protected int[]
offset2Index
An array indexed by offsets mapping each offset to the corresponding index number.protected int[]
offset2TermId
For each offset, the corresponding term id in the query.protected boolean[]
seen
Whether we have already seen a specific term/index pair.protected int[]
seenOffsetsList
An array accumulating the indices inseen
that have been set to true, so to acceleratereset(long)
.protected int[]
seenTermIdsList
The list ofnumberOfTermsSeen
term ids that we have seen so far.protected IntBigList[]
sizes
For each index, its list of document sizes.protected double[]
sizeWeightComponent
Cached fromBM25Scorer
.protected int[]
termId2VirtualCounter
For each term id, its virtual-counter index (to be used to accessvirtualCount
andvirtualIdfCount
).protected double[]
virtualCount
An array indexed by term ids used byBM25FScorer.score()
to compute virtual counts.protected double[]
virtualIdfCount
For expected IDF runs, an array indexed by term ids used byBM25FScorer.score()
to compute virtual counts combined with IDF scoring.protected double[]
weight
For 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 void
reset(long document)
Boolean
visit(IndexIterator indexIterator)
Visits anIndexIterator
leaf.
-
-
-
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 inseen
that 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 ofnumberOfTermsSeen
term ids that we have seen so far.
-
termId2VirtualCounter
protected final int[] termId2VirtualCounter
For each term id, its virtual-counter index (to be used to accessvirtualCount
andvirtualIdfCount
).
-
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:DocumentIteratorVisitor
Visits anIndexIterator
leaf.- 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)
-
-