Class DFRSimilarity
Implements the divergence from randomness (DFR) framework introduced in Gianni Amati and Cornelis Joost Van Rijsbergen. 2002. Probabilistic models of information retrieval based on measuring the divergence from randomness. ACM Trans. Inf. Syst. 20, 4 (October 2002), 357-389.
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.
To construct a DFRSimilarity, you must specify the implementations for all three components of DFR:
ComponentImplementations | |
---|---|
BasicModel: Basic model of information content:
| |
AfterEffect: First normalization of information gain:
| |
Normalization: Second (length) normalization:
|
Note that qtf, the multiplicity of term-occurrence in the query, is not handled by this implementation.
Inherited Members
Namespace: Lucene.Net.Search.Similarities
Assembly: Lucene.Net.dll
Syntax
public class DFRSimilarity : SimilarityBase
Constructors
| Improve this Doc View SourceDFRSimilarity(BasicModel, AfterEffect, Normalization)
Creates DFRSimilarity from the three components.
Note that null
values are not allowed:
if you want no normalization or after-effect, instead pass
Normalization.NoNormalization or AfterEffect.NoAfterEffect respectively.
Declaration
public DFRSimilarity(BasicModel basicModel, AfterEffect afterEffect, Normalization normalization)
Parameters
Type | Name | Description |
---|---|---|
BasicModel | basicModel | Basic model of information content |
AfterEffect | afterEffect | First normalization of information gain |
Normalization | normalization | Second (length) normalization |
Fields
| Improve this Doc View Sourcem_afterEffect
The first normalization of the information content.
Declaration
protected readonly AfterEffect m_afterEffect
Field Value
Type | Description |
---|---|
AfterEffect |
m_basicModel
The basic model for information content.
Declaration
protected readonly BasicModel m_basicModel
Field Value
Type | Description |
---|---|
BasicModel |
m_normalization
The term frequency normalization.
Declaration
protected readonly Normalization m_normalization
Field Value
Type | Description |
---|---|
Normalization |
Properties
| Improve this Doc View SourceAfterEffect
Returns the first normalization
Declaration
public virtual AfterEffect AfterEffect { get; }
Property Value
Type | Description |
---|---|
AfterEffect |
BasicModel
Returns the basic model of information content
Declaration
public virtual BasicModel BasicModel { get; }
Property Value
Type | Description |
---|---|
BasicModel |
Normalization
Returns the second normalization
Declaration
public virtual Normalization Normalization { get; }
Property Value
Type | Description |
---|---|
Normalization |
Methods
| Improve this Doc View SourceExplain(Explanation, BasicStats, Int32, Single, Single)
Declaration
protected override void Explain(Explanation expl, BasicStats stats, int doc, float freq, float docLen)
Parameters
Type | Name | Description |
---|---|---|
Explanation | expl | |
BasicStats | stats | |
System.Int32 | doc | |
System.Single | freq | |
System.Single | docLen |
Overrides
| Improve this Doc View SourceScore(BasicStats, Single, Single)
Declaration
public override float Score(BasicStats stats, float freq, float docLen)
Parameters
Type | Name | Description |
---|---|---|
BasicStats | stats | |
System.Single | freq | |
System.Single | docLen |
Returns
Type | Description |
---|---|
System.Single |
Overrides
| Improve this Doc View SourceToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |