Table of Contents

Method GetCalibratedMinRelevanceScoreAsync

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

GetCalibratedMinRelevanceScoreAsync(float, CancellationToken)

Converts a scale-independent relevance value into the absolute cosine floor that expresses it on this engine's embedding model.

public Task<float> GetCalibratedMinRelevanceScoreAsync(float relevance = 0.2, CancellationToken cancellationToken = default)

Parameters

relevance float

Relevance on a scale where 0 is the model's similarity between unrelated texts and 1 is identity. Defaults to MinCalibratedRelevance.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<float>

The cosine floor to pass as minScore to a retrieval call.

Examples

float floor = await ragEngine.GetCalibratedMinRelevanceScoreAsync();
var matches = await ragEngine.FindMatchingPartitionsAsync("semantic search", topK: 5, minScore: floor);

Remarks

Embedding spaces are anisotropic, so unrelated texts already score well above zero and by a model-specific amount. A fixed cosine floor is therefore a different filter on every model, strict enough on one to discard most of what it should return while barely filtering another. Use this to express a relevance requirement that holds its meaning across models. The model's baseline is measured once and cached, costing a handful of short embeddings on first use.

Share