public abstract class StaticScoreModifierWeightingModel extends WeightingModel
ObjectOutputStream
file of float[] or double[] arrayTIntDoubleHashMap
saved in an ObjectOutputStream
fileaverageDocumentLength, c, cs, documentFrequency, es, i, keyFrequency, numberOfDocuments, numberOfPointers, numberOfTokens, numberOfUniqueTerms, rq, termFrequency
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.
|
double |
score(double tf,
double docLength,
double n_t,
double F_t,
double _keyFrequency)
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
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 lengthpublic double score(double tf, double docLength, double n_t, double F_t, double _keyFrequency)
WeightingModel
score
in class WeightingModel
tf
- The term frequency in the documentdocLength
- the document's lengthn_t
- The document frequency of the termF_t
- the term frequency in the collection_keyFrequency
- the term frequency in the queryprotected 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 4.0. Copyright © 2004-2014 University of Glasgow