Class Recognition

ru.yandex.speechkit

public  class  Recognition 

The recognition result that returns an object of the class Recognizer.

The recognition result contains a list of the best recognition hypotheses with their confidence scores. The list of hypotheses is sorted in descending order with the most likely recognition result placed at the top.

To get the list of hypotheses, use the getHypotheses () method.

Constructors

Recognition(@NonNull RecognitionHypothesis[] hypotheses, @Nullable Biometry biometry)

Creates an object of the Recognition class.

Recognition(RecognitionHypothesis[] hypotheses, String requestId, @Nullable Biometry biometry)

Creates an object of the Recognition class.

Methods

StringgetBestResultText()

Returns the text of the best hypothesis.

BiometrygetBiometry()

Returns the estimated biometrics of the user, such as age, gender, and age group.

RecognitionHypothesis[]getHypotheses()

Returns a list of hypotheses sorted in descending order of confidence score.

StringgetRequestId()

Returns the request ID.

.lang.Override java.lang.StringtoString()

Constructor Detail

Recognition

public Recognition (@NonNull RecognitionHypothesis[] hypotheses, @Nullable Biometry biometry)

Creates an object of the Recognition class.

Parameters:
hypotheses

List of hypotheses sorted in descending order of confidence score.

biometry

Estimated biometrics of the user.

Recognition

public Recognition (RecognitionHypothesis[] hypotheses, String requestId, @Nullable Biometry biometry)

Creates an object of the Recognition class.

Parameters:
hypotheses

List of hypotheses sorted in descending order of confidence score.

requestId

Request ID.

biometry

Estimated biometrics of the user.

Method Detail

getBestResultText

public String getBestResultText ()

Returns the text of the best hypothesis.

Returns:

Text of the best hypothesis.

getBiometry

public Biometry getBiometry ()

Returns the estimated biometrics of the user, such as age, gender, and age group.

The Biometry object is returned as not null when calling the onPartialResults(Recognizer, Recognition, boolean) method with endOfUtterance = true and the setRequestBiometry (boolean) setting enabled.

Returns:

Estimated biometrics of the user.

getHypotheses

public RecognitionHypothesis[] getHypotheses ()

Returns a list of hypotheses sorted in descending order of confidence score.

Returns:

List of hypotheses sorted in descending order of confidence score.

getRequestId

public String getRequestId ()

Returns the request ID.

Returns:

Request ID.

toString

public .lang.Override java.lang.String toString ()