Class LMDirichletSimilarity
java.lang.Object
org.apache.lucene.search.similarities.Similarity
org.apache.lucene.search.similarities.SimilarityBase
org.apache.lucene.search.similarities.LMSimilarity
org.apache.lucene.search.similarities.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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.similarities.LMSimilarity
LMSimilarity.CollectionModel, LMSimilarity.DefaultCollectionModel, LMSimilarity.LMStatsNested classes/interfaces inherited from class org.apache.lucene.search.similarities.Similarity
Similarity.SimScorer, Similarity.SimWeight -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates the similarity with the default μ value of 2000.LMDirichletSimilarity(float mu) Instantiates the similarity with the provided μ parameter.LMDirichletSimilarity(LMSimilarity.CollectionModel collectionModel) Instantiates the similarity with the default μ value of 2000.LMDirichletSimilarity(LMSimilarity.CollectionModel collectionModel, float mu) Instantiates the similarity with the provided μ parameter. -
Method Summary
Methods inherited from class org.apache.lucene.search.similarities.LMSimilarity
toStringMethods inherited from class org.apache.lucene.search.similarities.SimilarityBase
computeNorm, computeWeight, getDiscountOverlaps, log2, setDiscountOverlaps, simScorerMethods inherited from class org.apache.lucene.search.similarities.Similarity
coord, queryNorm
-
Constructor Details
-
LMDirichletSimilarity
Instantiates the similarity with the provided μ parameter. -
LMDirichletSimilarity
public LMDirichletSimilarity(float mu) Instantiates the similarity with the provided μ parameter. -
LMDirichletSimilarity
Instantiates the similarity with the default μ value of 2000. -
LMDirichletSimilarity
public LMDirichletSimilarity()Instantiates the similarity with the default μ value of 2000.
-
-
Method Details
-
getMu
public float getMu()Returns the μ parameter. -
getName
Description copied from class:LMSimilarityReturns the name of the LM method. The values of the parameters should be included as well.Used in
.LMSimilarity.toString()- Specified by:
getNamein classLMSimilarity
-