Class RecognitionHypothesis

ru.yandex.speechkit

public  class  RecognitionHypothesis 

An object representing a single recognition hypothesis.

Each hypothesis has a confidence score, i.e., a fractional number between 0 and 1 estimating the measure of confidence in the recognition result (1 indicates the highest level of confidence).

A hypothesis has two representations:
  1. A string that contains the hypothesis text. This can be considered the primary representation. Numbers in this text are written as digits, and punctuation and abbreviations are included.

  2. An array of words or phrases, each of which has a confidence score. This score can be used to determine poorly recognized fragments.

Note.

The confidence score is provided solely for informational purposes. Its calculation formula may be adjusted with time.

Constructors

RecognitionHypothesis(RecognitionWord[] words, String normalized, float confidence)

Creates an object of the RecognitionHypothesis class.

Methods

floatgetConfidence()

Returns the confidence score of the recognition hypothesis.

StringgetNormalized()

Returns a string that contains the hypothesis text.

RecognitionWord[]getWords()

Returns an array of words or phrases, each of which has a confidence score.

StringtoString()

Constructor Detail

RecognitionHypothesis

public RecognitionHypothesis (RecognitionWord[] words, String normalized, float confidence)

Creates an object of the RecognitionHypothesis class.

Parameters:
words

Array of words or phrases.

normalized

A string that contains the hypothesis text.

confidence

Confidence score of the recognition hypothesis.

Method Detail

getConfidence

public float getConfidence ()

Returns the confidence score of the recognition hypothesis.

Returns:

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

getNormalized

public String getNormalized ()

Returns a string that contains the hypothesis text.

This can be considered the primary representation. Numbers in this text are written as digits, and punctuation and abbreviations are included.

Returns:

A string that contains the hypothesis text.

getWords

public RecognitionWord[] getWords ()

Returns an array of words or phrases, each of which has a confidence score.

This score can be used to determine poorly recognized fragments.

Returns:

An array of words or phrases, each of which has a confidence score.

toString

public String toString ()