API reference · Kjarni 0.2.7

Struct RerankResult

Namespace: Kjarni
Assembly: Kjarni.dll

Single rerank result

public readonly struct RerankResult

Properties

Document

The document text.

public string Document { get; }

Property Value

string

Index

The document's position in the list passed to the reranker.

public int Index { get; }

Property Value

int

Probability

on a 0..1 scale. Ordering is identical; the transform is monotonic.

public float Probability { get; }

Property Value

float

Score

The cross-encoder's raw logit, matching what PyTorch returns. Roughly -11 to +11. See for a 0..1 scale.

public float Score { get; }

Property Value

float

Methods

Sigmoid(float)

Logistic squash, for putting a logit on a 0..1 scale.

Calls into the engine rather than reimplementing it. The formula is one line, but it needs a branch: the naive form overflows to NaN for large negative inputs, and five bindings each writing their own is five chances to omit it.

public static float Sigmoid(float x)

Parameters

x float

Returns

float

Kjarni runs the same engine on every platform: