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.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) |
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 void |
sortByScore(ScoreDoc[] reranked) |
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
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
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
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.