public abstract class StaticScoreModifierWeightingModel extends WeightingModel
ObjectOutputStream
file of float[] or double[] arrayTIntDoubleHashMap
saved in an ObjectOutputStream
fileModifier and Type | Field and Description |
---|---|
protected boolean |
asFloat |
protected gnu.trove.TIntFloatHashMap |
FstaticMap |
protected float[] |
FstaticScores |
protected boolean |
map |
protected String |
source |
protected gnu.trove.TIntDoubleHashMap |
staticMap |
protected double[] |
staticScores |
averageDocumentLength, c, cs, documentFrequency, es, i, keyFrequency, numberOfDocuments, numberOfPointers, numberOfTokens, numberOfUniqueTerms, rq, termFrequency
Constructor and Description |
---|
StaticScoreModifierWeightingModel(String[] params) |
Modifier and Type | Method and Description |
---|---|
protected static double[] |
castToDoubleArr(float[] f) |
protected static double[] |
castToDoubleArr(short[] f) |
protected static float[] |
castToFloatArr(double[] f) |
protected static float[] |
castToFloatArr(short[] f) |
String |
getInfo()
Returns the name of the model.
|
double |
getScoreD(int docid) |
float |
getScoreF(int docid) |
String |
getSource() |
protected void |
loadDocid2score(int numDocs,
String inputFile,
int column) |
protected void |
loadfloatOOS(String inputFile) |
protected void |
loadOOS(String inputFile) |
protected void |
loadScorefile(int numDocs,
String inputFile,
int column) |
static float |
max(float[] a)
Return the max of the specified array
|
static float |
min(float[] a)
Return the min of the specified array
|
protected static void |
printStats(double[] ar) |
double |
score(double tf,
double docLength)
This method provides the contract for implementing weighting models.
|
abstract double |
score(Posting p)
Returns score
|
static float[] |
standardNormalisation(float[] data)
Normalises the data in the specified array to be in range [0,1], with
0 as the minimum, and 1 as the maximum.
|
clone, getOverflowed, getParameter, prepare, setCollectionStatistics, setEntryStatistics, setKeyFrequency, setParameter, setRequest
protected double[] staticScores
protected float[] FstaticScores
protected final boolean asFloat
protected final boolean map
protected gnu.trove.TIntDoubleHashMap staticMap
protected gnu.trove.TIntFloatHashMap FstaticMap
protected String source
public StaticScoreModifierWeightingModel(String[] params)
public final double getScoreD(int docid)
public final float getScoreF(int docid)
public final String getSource()
public abstract double score(Posting p)
WeightingModel
score
in class WeightingModel
public String getInfo()
WeightingModel
getInfo
in interface Model
getInfo
in class WeightingModel
public double score(double tf, double docLength)
WeightingModel
score
in class WeightingModel
tf
- The term frequency in the documentdocLength
- the document's lengthprotected void loadDocid2score(int numDocs, String inputFile, int column)
protected void loadScorefile(int numDocs, String inputFile, int column)
protected void loadOOS(String inputFile)
protected void loadfloatOOS(String inputFile)
protected static void printStats(double[] ar)
protected static double[] castToDoubleArr(float[] f)
protected static double[] castToDoubleArr(short[] f)
protected static float[] castToFloatArr(double[] f)
protected static float[] castToFloatArr(short[] f)
public static float[] standardNormalisation(float[] data)
data
- public static final float min(float[] a)
a
- the arraypublic static final float max(float[] a)
a
- the arrayTerrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow