Table of Contents

Property B

Namespace
LMKit.Retrieval.Bm25
Assembly
LM-Kit.NET.dll

B

Gets or sets the BM25 length normalization parameter.

public float B { get; set; }

Property Value

float

A value between 0 and 1. Default is 0.75.

Examples

// Reduce length normalization so longer documents are not penalized as much.
var bm25 = new Bm25RetrievalStrategy { B = 0.3f };
ragEngine.RetrievalStrategy = bm25;

Remarks

Controls how much document length affects scoring. A value of 0 disables length normalization; a value of 1 applies full normalization relative to the average document length.

Exceptions

ArgumentOutOfRangeException

Thrown if set to a value outside the [0, 1] range.

Share