API reference · Kjarni 0.2.7

Class ClassificationResult

Namespace: Kjarni
Assembly: Kjarni.dll

Result of classifying a single text.

public class ClassificationResult

Inheritance

object ← ClassificationResult

Properties

AllScores

All labels with their scores, sorted by score descending.

public IReadOnlyList<(string Label, float Score)> AllScores { get; }

Property Value

IReadOnlyList<(string Label, float Score)>

Label

The predicted label (highest score).

public string Label { get; }

Property Value

string

Score

Confidence score for the predicted label (0.0 - 1.0).

public float Score { get; }

Property Value

float

Methods

AboveThreshold(float)

Get predictions above a threshold.

public IEnumerable<(string Label, float Score)> AboveThreshold(float threshold)

Parameters

threshold float

Returns

IEnumerable<(string Label, float Score)>

IsConfident(float)

Check if the top prediction exceeds a confidence threshold.

public bool IsConfident(float threshold)

Parameters

threshold float

Returns

bool

ToDetailedString()

Every label with its score and a text bar chart, one per line.

public string ToDetailedString()

Returns

string

ToJson(bool)

The top label, its score and every label's score, as JSON.

public string ToJson(bool pretty = true)

Parameters

pretty bool

Indent the output across several lines.

Returns

string

ToString()

The top label and its score as a percentage, for example "POSITIVE (99.9%)".

public override string ToString()

Returns

string

TopK(int)

Get the top K predictions.

public IEnumerable<(string Label, float Score)> TopK(int k)

Parameters

k int

Returns

IEnumerable<(string Label, float Score)>

Kjarni runs the same engine on every platform: