Show / Hide Table of Contents

    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
    Similarity
    SimilarityBase
    LMSimilarity
    LMDirichletSimilarity
    LMJelinekMercerSimilarity
    Inherited Members
    SimilarityBase.DiscountOverlaps
    SimilarityBase.ComputeWeight(Single, CollectionStatistics, TermStatistics[])
    SimilarityBase.Score(BasicStats, Single, Single)
    SimilarityBase.Explain(BasicStats, Int32, Explanation, Single)
    SimilarityBase.GetSimScorer(Similarity.SimWeight, AtomicReaderContext)
    SimilarityBase.ComputeNorm(FieldInvertState)
    SimilarityBase.DecodeNormValue(Byte)
    SimilarityBase.EncodeNormValue(Single, Single)
    SimilarityBase.Log2(Double)
    Similarity.Coord(Int32, Int32)
    Similarity.QueryNorm(Single)
    Namespace: Lucene.Net.Search.Similarities
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class LMSimilarity : SimilarityBase

    Constructors

    | Improve this Doc View Source

    LMSimilarity()

    Creates a new instance with the default collection language model.

    Declaration
    public LMSimilarity()
    | Improve this Doc View Source

    LMSimilarity(LMSimilarity.ICollectionModel)

    Creates a new instance with the specified collection language model.

    Declaration
    public LMSimilarity(LMSimilarity.ICollectionModel collectionModel)
    Parameters
    Type Name Description
    LMSimilarity.ICollectionModel collectionModel

    Fields

    | Improve this Doc View Source

    m_collectionModel

    The collection model.

    Declaration
    protected readonly LMSimilarity.ICollectionModel m_collectionModel
    Field Value
    Type Description
    LMSimilarity.ICollectionModel

    Methods

    | Improve this Doc View Source

    Explain(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
    SimilarityBase.Explain(Explanation, BasicStats, Int32, Single, Single)
    | Improve this Doc View Source

    FillBasicStats(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
    SimilarityBase.FillBasicStats(BasicStats, CollectionStatistics, TermStatistics)
    | Improve this Doc View Source

    GetName()

    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
    | Improve this Doc View Source

    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
    SimilarityBase.NewStats(String, Single)
    | Improve this Doc View Source

    ToString()

    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
    Overrides
    SimilarityBase.ToString()
    See Also
    GetName()
    GetName()
    LMSimilarity.DefaultCollectionModel
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)