[][src]Struct gcp_client::google::cloud::dialogflow::v2beta1::StreamingRecognitionResult

pub struct StreamingRecognitionResult {
    pub message_type: i32,
    pub transcript: String,
    pub is_final: bool,
    pub confidence: f32,
    pub stability: f32,
    pub speech_word_info: Vec<SpeechWordInfo>,
    pub speech_end_offset: Option<Duration>,
}

Contains a speech recognition result corresponding to a portion of the audio that is currently being processed or an indication that this is the end of the single requested utterance.

Example:

  1. transcript: "tube"

  2. transcript: "to be a"

  3. transcript: "to be"

  4. transcript: "to be or not to be" is_final: true

  5. transcript: " that's"

  6. transcript: " that is"

  7. message_type: END_OF_SINGLE_UTTERANCE

  8. transcript: " that is the question" is_final: true

Only two of the responses contain final results (#4 and #8 indicated by is_final: true). Concatenating these generates the full transcript: "to be or not to be that is the question".

In each response we populate:

  • for TRANSCRIPT: transcript and possibly is_final.

  • for END_OF_SINGLE_UTTERANCE: only message_type.

Fields

message_type: i32

Type of the result message.

transcript: String

Transcript text representing the words that the user spoke. Populated if and only if message_type = TRANSCRIPT.

is_final: bool

If false, the StreamingRecognitionResult represents an interim result that may change. If true, the recognizer will not return any further hypotheses about this piece of the audio. May only be populated for message_type = TRANSCRIPT.

confidence: f32

The Speech confidence between 0.0 and 1.0 for the current portion of audio. A higher number indicates an estimated greater likelihood that the recognized words are correct. The default of 0.0 is a sentinel value indicating that confidence was not set.

This field is typically only provided if is_final is true and you should not rely on it being accurate or even set.

stability: f32

An estimate of the likelihood that the speech recognizer will not change its guess about this interim recognition result:

  • If the value is unspecified or 0.0, Dialogflow didn't compute the stability. In particular, Dialogflow will only provide stability for TRANSCRIPT results with is_final = false.
  • Otherwise, the value is in (0.0, 1.0] where 0.0 means completely unstable and 1.0 means completely stable.
speech_word_info: Vec<SpeechWordInfo>

Word-specific information for the words recognized by Speech in [transcript][google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.transcript]. Populated if and only if message_type = TRANSCRIPT and [InputAudioConfig.enable_word_info] is set.

speech_end_offset: Option<Duration>

Time offset of the end of this Speech recognition result relative to the beginning of the audio. Only populated for message_type = TRANSCRIPT.

Implementations

impl StreamingRecognitionResult[src]

pub fn message_type(&self) -> MessageType[src]

Returns the enum value of message_type, or the default if the field is set to an invalid enum value.

pub fn set_message_type(&mut self, value: MessageType)[src]

Sets message_type to the provided enum value.

Trait Implementations

impl Clone for StreamingRecognitionResult[src]

impl Debug for StreamingRecognitionResult[src]

impl Default for StreamingRecognitionResult[src]

impl Message for StreamingRecognitionResult[src]

impl PartialEq<StreamingRecognitionResult> for StreamingRecognitionResult[src]

impl StructuralPartialEq for StreamingRecognitionResult[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]