Class LMDirichletSimilarity
Bayesian smoothing using Dirichlet priors. From Chengxiang Zhai and John Lafferty. 2001. A study of smoothing methods for language models applied to Ad Hoc information retrieval. In Proceedings of the 24th annual international ACM SIGIR conference on Research and development in information retrieval (SIGIR '01). ACM, New York, NY, USA, 334-342.
The formula as defined the paper assigns a negative score to documents that
contain the term, but with fewer occurrences than predicted by the collection
language model. The Lucene implementation returns 0
for such
documents.
Note
This API is experimental and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Search.Similarities
Assembly: Lucene.Net.dll
Syntax
public class LMDirichletSimilarity : LMSimilarity
Constructors
| Improve this Doc View SourceLMDirichletSimilarity()
Instantiates the similarity with the default μ value of 2000.
Declaration
public LMDirichletSimilarity()
LMDirichletSimilarity(LMSimilarity.ICollectionModel)
Instantiates the similarity with the default μ value of 2000.
Declaration
public LMDirichletSimilarity(LMSimilarity.ICollectionModel collectionModel)
Parameters
Type | Name | Description |
---|---|---|
LMSimilarity.ICollectionModel | collectionModel |
LMDirichletSimilarity(LMSimilarity.ICollectionModel, Single)
Instantiates the similarity with the provided μ parameter.
Declaration
public LMDirichletSimilarity(LMSimilarity.ICollectionModel collectionModel, float mu)
Parameters
Type | Name | Description |
---|---|---|
LMSimilarity.ICollectionModel | collectionModel | |
System.Single | mu |
LMDirichletSimilarity(Single)
Instantiates the similarity with the provided μ parameter.
Declaration
public LMDirichletSimilarity(float mu)
Parameters
Type | Name | Description |
---|---|---|
System.Single | mu |
Properties
| Improve this Doc View SourceMu
Returns the μ parameter.
Declaration
public virtual float Mu { get; }
Property Value
Type | Description |
---|---|
System.Single |
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 SourceGetName()
Declaration
public override string GetName()
Returns
Type | Description |
---|---|
System.String |
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 |