public class LTRRescorer extends Rescorer
LTRScoringQuery
that will assign a
new score to each document. The top documents will be resorted based on the
new score.Modifier and Type | Field and Description |
---|---|
protected static Comparator<ScoreDoc> |
scoreComparator |
Constructor and Description |
---|
LTRRescorer() |
LTRRescorer(LTRScoringQuery scoringQuery) |
Modifier and Type | Method and Description |
---|---|
Explanation |
explain(IndexSearcher searcher,
Explanation firstPassExplanation,
int docID) |
static LTRScoringQuery.FeatureInfo[] |
extractFeaturesInfo(LTRScoringQuery.ModelWeight modelWeight,
int docid,
Float originalDocScore,
List<LeafReaderContext> leafContexts) |
protected static Explanation |
getExplanation(IndexSearcher searcher,
int docID,
LTRScoringQuery rerankingQuery) |
protected static ScoreDoc[] |
getFirstPassDocsRanked(TopDocs firstPassTopDocs) |
protected static void |
heapAdjust(ScoreDoc[] hits,
int size,
int root) |
protected static void |
heapify(ScoreDoc[] hits,
int size) |
protected static void |
logSingleHit(IndexSearcher indexSearcher,
LTRScoringQuery.ModelWeight modelWeight,
int docid,
LTRScoringQuery scoringQuery)
Call this method if the
scoreSingleHit(int, int, int, ScoreDoc, int, org.apache.solr.ltr.LTRScoringQuery.ModelWeight.ModelScorer, ScoreDoc[])
method indicated that the document's feature info should be logged. |
TopDocs |
rescore(IndexSearcher searcher,
TopDocs firstPassTopDocs,
int topN)
rescores the documents:
|
void |
scoreFeatures(IndexSearcher indexSearcher,
int topN,
LTRScoringQuery.ModelWeight modelWeight,
ScoreDoc[] hits,
List<LeafReaderContext> leaves,
ScoreDoc[] reranked) |
protected static void |
scoreSingleHit(IndexSearcher indexSearcher,
int topN,
LTRScoringQuery.ModelWeight modelWeight,
int docBase,
int hitUpto,
ScoreDoc hit,
int docID,
LTRScoringQuery rerankingQuery,
LTRScoringQuery.ModelWeight.ModelScorer scorer,
ScoreDoc[] reranked)
|
protected static boolean |
scoreSingleHit(int topN,
int docBase,
int hitUpto,
ScoreDoc hit,
int docID,
LTRScoringQuery.ModelWeight.ModelScorer scorer,
ScoreDoc[] reranked)
Scores a single document and returns true if the document's feature info should be logged via the
logSingleHit(IndexSearcher, org.apache.solr.ltr.LTRScoringQuery.ModelWeight, int, LTRScoringQuery)
method. |
protected static void |
sortByScore(ScoreDoc[] reranked)
Deprecated.
|
protected static final Comparator<ScoreDoc> scoreComparator
public LTRRescorer()
public LTRRescorer(LTRScoringQuery scoringQuery)
protected static void heapAdjust(ScoreDoc[] hits, int size, int root)
protected static void heapify(ScoreDoc[] hits, int size)
public TopDocs rescore(IndexSearcher searcher, TopDocs firstPassTopDocs, int topN) throws IOException
rescore
in class Rescorer
searcher
- current IndexSearcherfirstPassTopDocs
- documents to rerank;topN
- documents to return;IOException
@Deprecated protected static void sortByScore(ScoreDoc[] reranked)
public void scoreFeatures(IndexSearcher indexSearcher, int topN, LTRScoringQuery.ModelWeight modelWeight, ScoreDoc[] hits, List<LeafReaderContext> leaves, ScoreDoc[] reranked) throws IOException
IOException
@Deprecated protected static void scoreSingleHit(IndexSearcher indexSearcher, int topN, LTRScoringQuery.ModelWeight modelWeight, int docBase, int hitUpto, ScoreDoc hit, int docID, LTRScoringQuery rerankingQuery, LTRScoringQuery.ModelWeight.ModelScorer scorer, ScoreDoc[] reranked) throws IOException
scoreSingleHit(int, int, int, ScoreDoc, int, org.apache.solr.ltr.LTRScoringQuery.ModelWeight.ModelScorer, ScoreDoc[])
and logSingleHit(IndexSearcher, org.apache.solr.ltr.LTRScoringQuery.ModelWeight, int, LTRScoringQuery)
instead.IOException
protected static void logSingleHit(IndexSearcher indexSearcher, LTRScoringQuery.ModelWeight modelWeight, int docid, LTRScoringQuery scoringQuery)
scoreSingleHit(int, int, int, ScoreDoc, int, org.apache.solr.ltr.LTRScoringQuery.ModelWeight.ModelScorer, ScoreDoc[])
method indicated that the document's feature info should be logged.protected static boolean scoreSingleHit(int topN, int docBase, int hitUpto, ScoreDoc hit, int docID, LTRScoringQuery.ModelWeight.ModelScorer scorer, ScoreDoc[] reranked) throws IOException
logSingleHit(IndexSearcher, org.apache.solr.ltr.LTRScoringQuery.ModelWeight, int, LTRScoringQuery)
method. Feature info logging is only necessary for the topN documents.IOException
public Explanation explain(IndexSearcher searcher, Explanation firstPassExplanation, int docID) throws IOException
explain
in class Rescorer
IOException
protected static Explanation getExplanation(IndexSearcher searcher, int docID, LTRScoringQuery rerankingQuery) throws IOException
IOException
public static LTRScoringQuery.FeatureInfo[] extractFeaturesInfo(LTRScoringQuery.ModelWeight modelWeight, int docid, Float originalDocScore, List<LeafReaderContext> leafContexts) throws IOException
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.