public static final class StreamingRecognitionResult.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder> implements StreamingRecognitionResultOrBuilder
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. recognition_event_type: `RECOGNITION_EVENT_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 `MESSAGE_TYPE_TRANSCRIPT`: `transcript` and possibly `is_final`.
* for `MESSAGE_TYPE_END_OF_SINGLE_UTTERANCE`: only `event_type`.
Protobuf type google.cloud.dialogflow.v2beta1.StreamingRecognitionResult| Modifier and Type | Method and Description |
|---|---|
StreamingRecognitionResult.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
StreamingRecognitionResult |
build() |
StreamingRecognitionResult |
buildPartial() |
StreamingRecognitionResult.Builder |
clear() |
StreamingRecognitionResult.Builder |
clearConfidence()
The Speech confidence between 0.0 and 1.0 for the current portion of audio.
|
StreamingRecognitionResult.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
StreamingRecognitionResult.Builder |
clearIsFinal()
The default of 0.0 is a sentinel value indicating `confidence` was not set.
|
StreamingRecognitionResult.Builder |
clearMessageType()
Type of the result message.
|
StreamingRecognitionResult.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
StreamingRecognitionResult.Builder |
clearTranscript()
Transcript text representing the words that the user spoke.
|
StreamingRecognitionResult.Builder |
clone() |
float |
getConfidence()
The Speech confidence between 0.0 and 1.0 for the current portion of audio.
|
StreamingRecognitionResult |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
boolean |
getIsFinal()
The default of 0.0 is a sentinel value indicating `confidence` was not set.
|
StreamingRecognitionResult.MessageType |
getMessageType()
Type of the result message.
|
int |
getMessageTypeValue()
Type of the result message.
|
String |
getTranscript()
Transcript text representing the words that the user spoke.
|
com.google.protobuf.ByteString |
getTranscriptBytes()
Transcript text representing the words that the user spoke.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
StreamingRecognitionResult.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
StreamingRecognitionResult.Builder |
mergeFrom(com.google.protobuf.Message other) |
StreamingRecognitionResult.Builder |
mergeFrom(StreamingRecognitionResult other) |
StreamingRecognitionResult.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
StreamingRecognitionResult.Builder |
setConfidence(float value)
The Speech confidence between 0.0 and 1.0 for the current portion of audio.
|
StreamingRecognitionResult.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
StreamingRecognitionResult.Builder |
setIsFinal(boolean value)
The default of 0.0 is a sentinel value indicating `confidence` was not set.
|
StreamingRecognitionResult.Builder |
setMessageType(StreamingRecognitionResult.MessageType value)
Type of the result message.
|
StreamingRecognitionResult.Builder |
setMessageTypeValue(int value)
Type of the result message.
|
StreamingRecognitionResult.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
StreamingRecognitionResult.Builder |
setTranscript(String value)
Transcript text representing the words that the user spoke.
|
StreamingRecognitionResult.Builder |
setTranscriptBytes(com.google.protobuf.ByteString value)
Transcript text representing the words that the user spoke.
|
StreamingRecognitionResult.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic StreamingRecognitionResult build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic StreamingRecognitionResult buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic StreamingRecognitionResult.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder mergeFrom(StreamingRecognitionResult other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public StreamingRecognitionResult.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<StreamingRecognitionResult.Builder>IOExceptionpublic int getMessageTypeValue()
Type of the result message.
.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType message_type = 1;
getMessageTypeValue in interface StreamingRecognitionResultOrBuilderpublic StreamingRecognitionResult.Builder setMessageTypeValue(int value)
Type of the result message.
.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType message_type = 1;
public StreamingRecognitionResult.MessageType getMessageType()
Type of the result message.
.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType message_type = 1;
getMessageType in interface StreamingRecognitionResultOrBuilderpublic StreamingRecognitionResult.Builder setMessageType(StreamingRecognitionResult.MessageType value)
Type of the result message.
.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType message_type = 1;
public StreamingRecognitionResult.Builder clearMessageType()
Type of the result message.
.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType message_type = 1;
public String getTranscript()
Transcript text representing the words that the user spoke. Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
string transcript = 2;getTranscript in interface StreamingRecognitionResultOrBuilderpublic com.google.protobuf.ByteString getTranscriptBytes()
Transcript text representing the words that the user spoke. Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
string transcript = 2;getTranscriptBytes in interface StreamingRecognitionResultOrBuilderpublic StreamingRecognitionResult.Builder setTranscript(String value)
Transcript text representing the words that the user spoke. Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
string transcript = 2;public StreamingRecognitionResult.Builder clearTranscript()
Transcript text representing the words that the user spoke. Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
string transcript = 2;public StreamingRecognitionResult.Builder setTranscriptBytes(com.google.protobuf.ByteString value)
Transcript text representing the words that the user spoke. Populated if and only if `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
string transcript = 2;public boolean getIsFinal()
The default of 0.0 is a sentinel value indicating `confidence` was not set. 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 `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
bool is_final = 3;getIsFinal in interface StreamingRecognitionResultOrBuilderpublic StreamingRecognitionResult.Builder setIsFinal(boolean value)
The default of 0.0 is a sentinel value indicating `confidence` was not set. 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 `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
bool is_final = 3;public StreamingRecognitionResult.Builder clearIsFinal()
The default of 0.0 is a sentinel value indicating `confidence` was not set. 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 `event_type` = `RECOGNITION_EVENT_TRANSCRIPT`.
bool is_final = 3;public float getConfidence()
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.
float confidence = 4;getConfidence in interface StreamingRecognitionResultOrBuilderpublic StreamingRecognitionResult.Builder setConfidence(float value)
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.
float confidence = 4;public StreamingRecognitionResult.Builder clearConfidence()
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.
float confidence = 4;public final StreamingRecognitionResult.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>public final StreamingRecognitionResult.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<StreamingRecognitionResult.Builder>Copyright © 2019 Google LLC. All rights reserved.