Class LMSimilarity
Abstract superclass for language modeling Similarities. The following inner types are introduced:
- LMSimilarity.LMStats, which defines a new statistic, the probability that the collection language model generates the current term;
- LMSimilarity.ICollectionModel, which is a strategy interface for object that
compute the collection language model
p(w|C)
; - LMSimilarity.DefaultCollectionModel, an implementation of the former, that computes the term probability as the number of occurrences of the term in the collection, divided by the total number of tokens.
This is a Lucene.NET EXPERIMENTAL API, use at your own risk
Inheritance
System.Object
LMSimilarity
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Lucene.Net.Search.Similarities
Assembly: Lucene.Net.dll
Syntax
public abstract class LMSimilarity : SimilarityBase
Constructors
| Improve this Doc View SourceLMSimilarity()
Creates a new instance with the default collection language model.
Declaration
protected LMSimilarity()
LMSimilarity(LMSimilarity.ICollectionModel)
Creates a new instance with the specified collection language model.
Declaration
protected LMSimilarity(LMSimilarity.ICollectionModel collectionModel)
Parameters
Type | Name | Description |
---|---|---|
LMSimilarity.ICollectionModel | collectionModel |
Fields
| Improve this Doc View Sourcem_collectionModel
The collection model.
Declaration
protected readonly LMSimilarity.ICollectionModel m_collectionModel
Field Value
Type | Description |
---|---|
LMSimilarity.ICollectionModel |
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 SourceFillBasicStats(BasicStats, CollectionStatistics, TermStatistics)
Computes the collection probability of the current term in addition to the usual statistics.
Declaration
protected override void FillBasicStats(BasicStats stats, CollectionStatistics collectionStats, TermStatistics termStats)
Parameters
Type | Name | Description |
---|---|---|
BasicStats | stats | |
CollectionStatistics | collectionStats | |
TermStatistics | termStats |
Overrides
| Improve this Doc View SourceGetName()
Returns the name of the LM method. The values of the parameters should be included as well.
Used in ToString()
.Declaration
public abstract string GetName()
Returns
Type | Description |
---|---|
System.String |
NewStats(String, Single)
Declaration
protected override BasicStats NewStats(string field, float queryBoost)
Parameters
Type | Name | Description |
---|---|---|
System.String | field | |
System.Single | queryBoost |
Returns
Type | Description |
---|---|
BasicStats |
Overrides
| Improve this Doc View SourceToString()
Returns the name of the LM method. If a custom collection model strategy is used, its name is included as well.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |