public class DFRSimilarity extends SimilarityBase
The DFR scoring formula is composed of three separate components: the
basic model, the aftereffect and an additional
normalization component, represented by the classes
BasicModel, AfterEffect and Normalization,
respectively. The names of these classes were chosen to match the names of
their counterparts in the Terrier IR engine.
Note that qtf, the multiplicity of term-occurrence in the query, is not handled by this implementation.
BasicModel,
AfterEffect,
NormalizationSimilarity.ExactSimScorer, Similarity.SimWeight, Similarity.SloppySimScorer| Modifier and Type | Field and Description |
|---|---|
protected AfterEffect |
afterEffect
The first normalization of the information content.
|
protected BasicModel |
basicModel
The basic model for information content.
|
protected Normalization |
normalization
The term frequency normalization.
|
discountOverlaps| Constructor and Description |
|---|
DFRSimilarity(BasicModel basicModel,
AfterEffect afterEffect,
Normalization normalization) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
explain(Explanation expl,
BasicStats stats,
int doc,
float freq,
float docLen)
Subclasses should implement this method to explain the score.
|
AfterEffect |
getAfterEffect() |
BasicModel |
getBasicModel() |
Normalization |
getNormalization() |
protected float |
score(BasicStats stats,
float freq,
float docLen)
Scores the document
doc. |
String |
toString()
Subclasses must override this method to return the name of the Similarity
and preferably the values of parameters (if any) as well.
|
computeNorm, computeWeight, decodeNormValue, encodeNormValue, exactSimScorer, explain, fillBasicStats, getDiscountOverlaps, log2, newStats, setDiscountOverlaps, sloppySimScorercoord, queryNormprotected final BasicModel basicModel
protected final AfterEffect afterEffect
protected final Normalization normalization
public DFRSimilarity(BasicModel basicModel, AfterEffect afterEffect, Normalization normalization)
protected float score(BasicStats stats, float freq, float docLen)
SimilarityBasedoc.
Subclasses must apply their scoring formula in this class.
score in class SimilarityBasestats - the corpus level statistics.freq - the term frequency.docLen - the document length.protected void explain(Explanation expl, BasicStats stats, int doc, float freq, float docLen)
SimilarityBaseexpl
already contains the score, the name of the class and the doc id, as well
as the term frequency and its explanation; subclasses can add additional
clauses to explain details of their scoring formulae.
The default implementation does nothing.
explain in class SimilarityBaseexpl - the explanation to extend with details.stats - the corpus level statistics.doc - the document id.freq - the term frequency.docLen - the document length.public String toString()
SimilarityBasetoString in class SimilarityBasepublic BasicModel getBasicModel()
public AfterEffect getAfterEffect()
public Normalization getNormalization()
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.