Class PassageScorer
Ranks passages found by ICUPostings
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.
Inheritance
Namespace: Lucene.Net.Search.PostingsHighlight
Assembly: Lucene.Net.ICU.dll
Syntax
public class PassageScorer : object
Constructors
| Improve this Doc View SourcePassageScorer()
Creates Passage
k1 = 1.2
b = 0.75
pivot = 87
Declaration
public PassageScorer()
PassageScorer(Single, Single, Single)
Creates Passage
Declaration
public PassageScorer(float k1, float b, float pivot)
Parameters
Type | Name | Description |
---|---|---|
System. |
k1 | Controls non-linear term frequency normalization (saturation). |
System. |
b | Controls to what degree passage length normalizes tf values. |
System. |
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. |
passageStart | start offset of the passage |
Returns
Type | Description |
---|---|
System. |
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. |
freq | number of occurrences of within this passage |
System. |
passageLen | length of the passage in characters. |
Returns
Type | Description |
---|---|
System. |
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. |
contentLength | length of document in characters |
System. |
totalTermFreq | number of time term occurs in document |
Returns
Type | Description |
---|---|
System. |
term importance |