Class RecognitionFeatures.Builder (4.24.0)

public static final class RecognitionFeatures.Builder extends GeneratedMessageV3.Builder<RecognitionFeatures.Builder> implements RecognitionFeaturesOrBuilder

Available recognition features.

Protobuf type google.cloud.speech.v2.RecognitionFeatures

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public RecognitionFeatures.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
RecognitionFeatures.Builder
Overrides

build()

public RecognitionFeatures build()
Returns
TypeDescription
RecognitionFeatures

buildPartial()

public RecognitionFeatures buildPartial()
Returns
TypeDescription
RecognitionFeatures

clear()

public RecognitionFeatures.Builder clear()
Returns
TypeDescription
RecognitionFeatures.Builder
Overrides

clearDiarizationConfig()

public RecognitionFeatures.Builder clearDiarizationConfig()

Configuration to enable speaker diarization and set additional parameters to make diarization better suited for your application. When this is enabled, we send all the words from the beginning of the audio for the top alternative in every consecutive STREAMING responses. This is done in order to improve our speaker tags as our models learn to identify the speakers in the conversation over time. For non-streaming requests, the diarization results will be provided only in the top alternative of the FINAL SpeechRecognitionResult.

.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;

Returns
TypeDescription
RecognitionFeatures.Builder

clearEnableAutomaticPunctuation()

public RecognitionFeatures.Builder clearEnableAutomaticPunctuation()

If true, adds punctuation to recognition result hypotheses. This feature is only available in select languages. The default false value does not add punctuation to result hypotheses.

bool enable_automatic_punctuation = 4;

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

clearEnableSpokenEmojis()

public RecognitionFeatures.Builder clearEnableSpokenEmojis()

The spoken emoji behavior for the call. If true, adds spoken emoji formatting for the request. This will replace spoken emojis with the corresponding Unicode symbols in the final transcript. If false, spoken emojis are not replaced.

bool enable_spoken_emojis = 15;

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

clearEnableSpokenPunctuation()

public RecognitionFeatures.Builder clearEnableSpokenPunctuation()

The spoken punctuation behavior for the call. If true, replaces spoken punctuation with the corresponding symbols in the request. For example, "how are you question mark" becomes "how are you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation for support. If false, spoken punctuation is not replaced.

bool enable_spoken_punctuation = 14;

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

clearEnableWordConfidence()

public RecognitionFeatures.Builder clearEnableWordConfidence()

If true, the top result includes a list of words and the confidence for those words. If false, no word-level confidence information is returned. The default is false.

bool enable_word_confidence = 3;

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

clearEnableWordTimeOffsets()

public RecognitionFeatures.Builder clearEnableWordTimeOffsets()

If true, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If false, no word-level time offset information is returned. The default is false.

bool enable_word_time_offsets = 2;

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public RecognitionFeatures.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
RecognitionFeatures.Builder
Overrides

clearMaxAlternatives()

public RecognitionFeatures.Builder clearMaxAlternatives()

Maximum number of recognition hypotheses to be returned. The server may return fewer than max_alternatives. Valid values are 0-30. A value of 0 or 1 will return a maximum of one. If omitted, will return a maximum of one.

int32 max_alternatives = 16;

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

clearMultiChannelMode()

public RecognitionFeatures.Builder clearMultiChannelMode()

Mode for recognizing multi-channel audio.

.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public RecognitionFeatures.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
RecognitionFeatures.Builder
Overrides

clearProfanityFilter()

public RecognitionFeatures.Builder clearProfanityFilter()

If set to true, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, for instance, "f***". If set to false or omitted, profanities won't be filtered out.

bool profanity_filter = 1;

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

clone()

public RecognitionFeatures.Builder clone()
Returns
TypeDescription
RecognitionFeatures.Builder
Overrides

getDefaultInstanceForType()

public RecognitionFeatures getDefaultInstanceForType()
Returns
TypeDescription
RecognitionFeatures

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDiarizationConfig()

public SpeakerDiarizationConfig getDiarizationConfig()

Configuration to enable speaker diarization and set additional parameters to make diarization better suited for your application. When this is enabled, we send all the words from the beginning of the audio for the top alternative in every consecutive STREAMING responses. This is done in order to improve our speaker tags as our models learn to identify the speakers in the conversation over time. For non-streaming requests, the diarization results will be provided only in the top alternative of the FINAL SpeechRecognitionResult.

.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;

Returns
TypeDescription
SpeakerDiarizationConfig

The diarizationConfig.

getDiarizationConfigBuilder()

public SpeakerDiarizationConfig.Builder getDiarizationConfigBuilder()

Configuration to enable speaker diarization and set additional parameters to make diarization better suited for your application. When this is enabled, we send all the words from the beginning of the audio for the top alternative in every consecutive STREAMING responses. This is done in order to improve our speaker tags as our models learn to identify the speakers in the conversation over time. For non-streaming requests, the diarization results will be provided only in the top alternative of the FINAL SpeechRecognitionResult.

.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;

Returns
TypeDescription
SpeakerDiarizationConfig.Builder

getDiarizationConfigOrBuilder()

public SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder()

Configuration to enable speaker diarization and set additional parameters to make diarization better suited for your application. When this is enabled, we send all the words from the beginning of the audio for the top alternative in every consecutive STREAMING responses. This is done in order to improve our speaker tags as our models learn to identify the speakers in the conversation over time. For non-streaming requests, the diarization results will be provided only in the top alternative of the FINAL SpeechRecognitionResult.

.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;

Returns
TypeDescription
SpeakerDiarizationConfigOrBuilder

getEnableAutomaticPunctuation()

public boolean getEnableAutomaticPunctuation()

If true, adds punctuation to recognition result hypotheses. This feature is only available in select languages. The default false value does not add punctuation to result hypotheses.

bool enable_automatic_punctuation = 4;

Returns
TypeDescription
boolean

The enableAutomaticPunctuation.

getEnableSpokenEmojis()

public boolean getEnableSpokenEmojis()

The spoken emoji behavior for the call. If true, adds spoken emoji formatting for the request. This will replace spoken emojis with the corresponding Unicode symbols in the final transcript. If false, spoken emojis are not replaced.

bool enable_spoken_emojis = 15;

Returns
TypeDescription
boolean

The enableSpokenEmojis.

getEnableSpokenPunctuation()

public boolean getEnableSpokenPunctuation()

The spoken punctuation behavior for the call. If true, replaces spoken punctuation with the corresponding symbols in the request. For example, "how are you question mark" becomes "how are you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation for support. If false, spoken punctuation is not replaced.

bool enable_spoken_punctuation = 14;

Returns
TypeDescription
boolean

The enableSpokenPunctuation.

getEnableWordConfidence()

public boolean getEnableWordConfidence()

If true, the top result includes a list of words and the confidence for those words. If false, no word-level confidence information is returned. The default is false.

bool enable_word_confidence = 3;

Returns
TypeDescription
boolean

The enableWordConfidence.

getEnableWordTimeOffsets()

public boolean getEnableWordTimeOffsets()

If true, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If false, no word-level time offset information is returned. The default is false.

bool enable_word_time_offsets = 2;

Returns
TypeDescription
boolean

The enableWordTimeOffsets.

getMaxAlternatives()

public int getMaxAlternatives()

Maximum number of recognition hypotheses to be returned. The server may return fewer than max_alternatives. Valid values are 0-30. A value of 0 or 1 will return a maximum of one. If omitted, will return a maximum of one.

int32 max_alternatives = 16;

Returns
TypeDescription
int

The maxAlternatives.

getMultiChannelMode()

public RecognitionFeatures.MultiChannelMode getMultiChannelMode()

Mode for recognizing multi-channel audio.

.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;

Returns
TypeDescription
RecognitionFeatures.MultiChannelMode

The multiChannelMode.

getMultiChannelModeValue()

public int getMultiChannelModeValue()

Mode for recognizing multi-channel audio.

.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;

Returns
TypeDescription
int

The enum numeric value on the wire for multiChannelMode.

getProfanityFilter()

public boolean getProfanityFilter()

If set to true, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, for instance, "f***". If set to false or omitted, profanities won't be filtered out.

bool profanity_filter = 1;

Returns
TypeDescription
boolean

The profanityFilter.

hasDiarizationConfig()

public boolean hasDiarizationConfig()

Configuration to enable speaker diarization and set additional parameters to make diarization better suited for your application. When this is enabled, we send all the words from the beginning of the audio for the top alternative in every consecutive STREAMING responses. This is done in order to improve our speaker tags as our models learn to identify the speakers in the conversation over time. For non-streaming requests, the diarization results will be provided only in the top alternative of the FINAL SpeechRecognitionResult.

.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;

Returns
TypeDescription
boolean

Whether the diarizationConfig field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeDiarizationConfig(SpeakerDiarizationConfig value)

public RecognitionFeatures.Builder mergeDiarizationConfig(SpeakerDiarizationConfig value)

Configuration to enable speaker diarization and set additional parameters to make diarization better suited for your application. When this is enabled, we send all the words from the beginning of the audio for the top alternative in every consecutive STREAMING responses. This is done in order to improve our speaker tags as our models learn to identify the speakers in the conversation over time. For non-streaming requests, the diarization results will be provided only in the top alternative of the FINAL SpeechRecognitionResult.

.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;

Parameter
NameDescription
valueSpeakerDiarizationConfig
Returns
TypeDescription
RecognitionFeatures.Builder

mergeFrom(RecognitionFeatures other)

public RecognitionFeatures.Builder mergeFrom(RecognitionFeatures other)
Parameter
NameDescription
otherRecognitionFeatures
Returns
TypeDescription
RecognitionFeatures.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public RecognitionFeatures.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
RecognitionFeatures.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public RecognitionFeatures.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
RecognitionFeatures.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final RecognitionFeatures.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
RecognitionFeatures.Builder
Overrides

setDiarizationConfig(SpeakerDiarizationConfig value)

public RecognitionFeatures.Builder setDiarizationConfig(SpeakerDiarizationConfig value)

Configuration to enable speaker diarization and set additional parameters to make diarization better suited for your application. When this is enabled, we send all the words from the beginning of the audio for the top alternative in every consecutive STREAMING responses. This is done in order to improve our speaker tags as our models learn to identify the speakers in the conversation over time. For non-streaming requests, the diarization results will be provided only in the top alternative of the FINAL SpeechRecognitionResult.

.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;

Parameter
NameDescription
valueSpeakerDiarizationConfig
Returns
TypeDescription
RecognitionFeatures.Builder

setDiarizationConfig(SpeakerDiarizationConfig.Builder builderForValue)

public RecognitionFeatures.Builder setDiarizationConfig(SpeakerDiarizationConfig.Builder builderForValue)

Configuration to enable speaker diarization and set additional parameters to make diarization better suited for your application. When this is enabled, we send all the words from the beginning of the audio for the top alternative in every consecutive STREAMING responses. This is done in order to improve our speaker tags as our models learn to identify the speakers in the conversation over time. For non-streaming requests, the diarization results will be provided only in the top alternative of the FINAL SpeechRecognitionResult.

.google.cloud.speech.v2.SpeakerDiarizationConfig diarization_config = 9;

Parameter
NameDescription
builderForValueSpeakerDiarizationConfig.Builder
Returns
TypeDescription
RecognitionFeatures.Builder

setEnableAutomaticPunctuation(boolean value)

public RecognitionFeatures.Builder setEnableAutomaticPunctuation(boolean value)

If true, adds punctuation to recognition result hypotheses. This feature is only available in select languages. The default false value does not add punctuation to result hypotheses.

bool enable_automatic_punctuation = 4;

Parameter
NameDescription
valueboolean

The enableAutomaticPunctuation to set.

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

setEnableSpokenEmojis(boolean value)

public RecognitionFeatures.Builder setEnableSpokenEmojis(boolean value)

The spoken emoji behavior for the call. If true, adds spoken emoji formatting for the request. This will replace spoken emojis with the corresponding Unicode symbols in the final transcript. If false, spoken emojis are not replaced.

bool enable_spoken_emojis = 15;

Parameter
NameDescription
valueboolean

The enableSpokenEmojis to set.

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

setEnableSpokenPunctuation(boolean value)

public RecognitionFeatures.Builder setEnableSpokenPunctuation(boolean value)

The spoken punctuation behavior for the call. If true, replaces spoken punctuation with the corresponding symbols in the request. For example, "how are you question mark" becomes "how are you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation for support. If false, spoken punctuation is not replaced.

bool enable_spoken_punctuation = 14;

Parameter
NameDescription
valueboolean

The enableSpokenPunctuation to set.

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

setEnableWordConfidence(boolean value)

public RecognitionFeatures.Builder setEnableWordConfidence(boolean value)

If true, the top result includes a list of words and the confidence for those words. If false, no word-level confidence information is returned. The default is false.

bool enable_word_confidence = 3;

Parameter
NameDescription
valueboolean

The enableWordConfidence to set.

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

setEnableWordTimeOffsets(boolean value)

public RecognitionFeatures.Builder setEnableWordTimeOffsets(boolean value)

If true, the top result includes a list of words and the start and end time offsets (timestamps) for those words. If false, no word-level time offset information is returned. The default is false.

bool enable_word_time_offsets = 2;

Parameter
NameDescription
valueboolean

The enableWordTimeOffsets to set.

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public RecognitionFeatures.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
RecognitionFeatures.Builder
Overrides

setMaxAlternatives(int value)

public RecognitionFeatures.Builder setMaxAlternatives(int value)

Maximum number of recognition hypotheses to be returned. The server may return fewer than max_alternatives. Valid values are 0-30. A value of 0 or 1 will return a maximum of one. If omitted, will return a maximum of one.

int32 max_alternatives = 16;

Parameter
NameDescription
valueint

The maxAlternatives to set.

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

setMultiChannelMode(RecognitionFeatures.MultiChannelMode value)

public RecognitionFeatures.Builder setMultiChannelMode(RecognitionFeatures.MultiChannelMode value)

Mode for recognizing multi-channel audio.

.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;

Parameter
NameDescription
valueRecognitionFeatures.MultiChannelMode

The multiChannelMode to set.

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

setMultiChannelModeValue(int value)

public RecognitionFeatures.Builder setMultiChannelModeValue(int value)

Mode for recognizing multi-channel audio.

.google.cloud.speech.v2.RecognitionFeatures.MultiChannelMode multi_channel_mode = 17;

Parameter
NameDescription
valueint

The enum numeric value on the wire for multiChannelMode to set.

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

setProfanityFilter(boolean value)

public RecognitionFeatures.Builder setProfanityFilter(boolean value)

If set to true, the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks, for instance, "f***". If set to false or omitted, profanities won't be filtered out.

bool profanity_filter = 1;

Parameter
NameDescription
valueboolean

The profanityFilter to set.

Returns
TypeDescription
RecognitionFeatures.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public RecognitionFeatures.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
RecognitionFeatures.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final RecognitionFeatures.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
RecognitionFeatures.Builder
Overrides