Show / Hide Table of Contents

    Class PassageScorer

    Ranks passages found by ICUPostingsHighlighter.

    Each passage is scored as a miniature document within the document. The final score is computed as norm * ∑ (weight * tf). The default implementation is norm * BM25.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    PassageScorer
    Namespace: Lucene.Net.Search.PostingsHighlight
    Assembly: Lucene.Net.ICU.dll
    Syntax
    public class PassageScorer : object

    Constructors

    | Improve this Doc View Source

    PassageScorer()

    Creates PassageScorer with these default values:

    • k1 = 1.2
    • b = 0.75
    • pivot = 87

    Declaration
    public PassageScorer()
    | Improve this Doc View Source

    PassageScorer(Single, Single, Single)

    Creates PassageScorer with specified scoring parameters

    Declaration
    public PassageScorer(float k1, float b, float pivot)
    Parameters
    Type Name Description
    System.Single k1

    Controls non-linear term frequency normalization (saturation).

    System.Single b

    Controls to what degree passage length normalizes tf values.

    System.Single pivot

    Pivot value for length normalization (some rough idea of average sentence length in characters).

    Methods

    | Improve this Doc View Source

    Norm(Int32)

    Normalize a passage according to its position in the document.

    Typically passages towards the beginning of the document are more useful for summarizing the contents.

    The default implementation is 1 + 1/log(pivot + passageStart)

    Declaration
    public virtual float Norm(int passageStart)
    Parameters
    Type Name Description
    System.Int32 passageStart

    start offset of the passage

    Returns
    Type Description
    System.Single

    a boost value multiplied into the passage's core.

    | Improve this Doc View Source

    Tf(Int32, Int32)

    Computes term weight, given the frequency within the passage and the passage's length.

    Declaration
    public virtual float Tf(int freq, int passageLen)
    Parameters
    Type Name Description
    System.Int32 freq

    number of occurrences of within this passage

    System.Int32 passageLen

    length of the passage in characters.

    Returns
    Type Description
    System.Single

    term weight

    | Improve this Doc View Source

    Weight(Int32, Int32)

    Computes term importance, given its in-document statistics.

    Declaration
    public virtual float Weight(int contentLength, int totalTermFreq)
    Parameters
    Type Name Description
    System.Int32 contentLength

    length of document in characters

    System.Int32 totalTermFreq

    number of time term occurs in document

    Returns
    Type Description
    System.Single

    term importance

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)