Package org.terrier.matching
Class LearnedModelMatching
- java.lang.Object
-
- org.terrier.matching.LearnedModelMatching
-
- All Implemented Interfaces:
Matching
- Direct Known Subclasses:
JforestsModelMatching
,LinearModelMatching
public abstract class LearnedModelMatching extends java.lang.Object implements Matching
An abstract class for applying a learned model onto aFeaturedResultSet
.- Since:
- 4.0
- Author:
- Craig Macdonald
-
-
Field Summary
Fields Modifier and Type Field Description protected int
increment
protected org.slf4j.Logger
logger
protected Matching
parent
protected boolean
score_is_feature
-
Constructor Summary
Constructors Modifier Constructor Description protected
LearnedModelMatching(Matching _parent)
protected
LearnedModelMatching(Index _index, Matching _parent)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
applyModel(int N, double[] in_scores, int F, double[][] features, double[] out_scores)
Apply the loaded learned model for identifying the top N documents.java.lang.String
getInfo()
Return a human readable description of this Matching classResultSet
match(java.lang.String queryNumber, MatchingQueryTerms queryTerms)
Get a ResultSet for the given query terms.void
setCollectionStatistics(CollectionStatistics cs)
Update the collection statistics being used by this matching instance
-
-
-
Field Detail
-
parent
protected final Matching parent
-
logger
protected org.slf4j.Logger logger
-
score_is_feature
protected final boolean score_is_feature
-
increment
protected final int increment
-
-
Method Detail
-
applyModel
protected abstract void applyModel(int N, double[] in_scores, int F, double[][] features, double[] out_scores)
Apply the loaded learned model for identifying the top N documents.- Parameters:
N
- - number of documentsin_scores
- - sample scoresF
- number of featuresfeatures
- indexed by feature THEN documentout_scores
- - final scores
-
match
public ResultSet match(java.lang.String queryNumber, MatchingQueryTerms queryTerms) throws java.io.IOException
Description copied from interface:Matching
Get a ResultSet for the given query terms.
-
setCollectionStatistics
public void setCollectionStatistics(CollectionStatistics cs)
Description copied from interface:Matching
Update the collection statistics being used by this matching instance- Specified by:
setCollectionStatistics
in interfaceMatching
- Parameters:
cs
- CollectionStatistics to use during matching
-
-