Class LMJelinekMercerSimilarity
- 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.LMJelinekMercerSimilarity
-
public class LMJelinekMercerSimilarity extends LMSimilarity
Language model based on the Jelinek-Mercer smoothing method. 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 model has a single parameter, λ. According to said paper, the optimal value depends on both the collection and the query. The optimal value is around
0.1
for title queries and0.7
for long queries.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.search.similarities.LMSimilarity
LMSimilarity.CollectionModel, LMSimilarity.DefaultCollectionModel, LMSimilarity.LMStats
-
Nested classes/interfaces inherited from class org.apache.lucene.search.similarities.Similarity
Similarity.SimScorer, Similarity.SimWeight
-
-
Constructor Summary
Constructors Constructor Description LMJelinekMercerSimilarity(float lambda)
Instantiates with the specified λ parameter.LMJelinekMercerSimilarity(LMSimilarity.CollectionModel collectionModel, float lambda)
Instantiates with the specified collectionModel and λ parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getLambda()
Returns the λ parameter.java.lang.String
getName()
Returns the name of the LM method.-
Methods inherited from class org.apache.lucene.search.similarities.LMSimilarity
toString
-
Methods inherited from class org.apache.lucene.search.similarities.SimilarityBase
computeNorm, computeWeight, getDiscountOverlaps, log2, setDiscountOverlaps, simScorer
-
Methods inherited from class org.apache.lucene.search.similarities.Similarity
coord, queryNorm
-
-
-
-
Constructor Detail
-
LMJelinekMercerSimilarity
public LMJelinekMercerSimilarity(LMSimilarity.CollectionModel collectionModel, float lambda)
Instantiates with the specified collectionModel and λ parameter.
-
LMJelinekMercerSimilarity
public LMJelinekMercerSimilarity(float lambda)
Instantiates with the specified λ parameter.
-
-
Method Detail
-
getLambda
public float getLambda()
Returns the λ parameter.
-
getName
public java.lang.String getName()
Description copied from class:LMSimilarity
Returns the name of the LM method. The values of the parameters should be included as well.Used in
.LMSimilarity.toString()
- Specified by:
getName
in classLMSimilarity
-
-