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.
Note
This API is experimental and might change in incompatible ways in the next release.
Inheritance
Inherited Members
Namespace: Lucene.Net.Search.PostingsHighlight
Assembly: Lucene.Net.ICU.dll
Syntax
public class PassageScorer
Constructors
| Improve this Doc View SourcePassageScorer()
Creates PassageScorer with these default values:
k1 = 1.2
b = 0.75
pivot = 87
Declaration
public PassageScorer()
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 SourceNorm(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. |
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 |
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 |