RecognitionHypothesis class

ru.yandex.speechkit

public class RecognitionHypothesis 

Represents a single recognition hypothesis.

The structure contains the text of the hypothesis and its confidence score.

The confidence score is a fractional number between 0 and 1 estimating the measure of confidence in the recognition result (1 indicates the highest level of confidence). If score isn't available, the special value BAD_CONFIDENCE is used.

Note.

The confidence score is provided solely for informational purposes. The formula for calculating the score might be adjusted over time, so don't make decisions based on the absolute score. Use Recognition.isResultConfident instead.

Methods

floatgetConfidence()

Returns the confidence score of the recognition hypothesis.

StringgetText()

Returns the text of the recognition hypothesis.

StringtoString()

Stringify the recognition result (including both text and confidence).

Fields

final floatBAD_CONFIDENCE

A special value indicating that the confidence score is missing for this hypothesis.

final RecognitionHypothesisBAD_RESULT

A special value indicating that the hypothesis is invalid.

Method descriptions

getConfidence

public float getConfidence ()

Returns the confidence score of the recognition hypothesis.

The confidence score is a fractional number between 0 and 1 estimating the measure of confidence in the recognition result (1 indicates the highest level of confidence).

getText

public String getText ()

Returns the text of the recognition hypothesis.

Returns:

the text of the recognition hypothesis.

toString

public String toString ()

Stringify the recognition result (including both text and confidence).

Field descriptions

BAD_CONFIDENCE

public static final float BAD_CONFIDENCE ()

A special value indicating that the confidence score is missing for this hypothesis.

BAD_RESULT

public static final RecognitionHypothesis BAD_RESULT ()

A special value indicating that the hypothesis is invalid.