Class RecognitionFeatures.Builder (4.50.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
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public RecognitionFeatures.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
RecognitionFeatures.Builder
Overrides

build()

public RecognitionFeatures build()
Returns
Type Description
RecognitionFeatures

buildPartial()

public RecognitionFeatures buildPartial()
Returns
Type Description
RecognitionFeatures

clear()

public RecognitionFeatures.Builder clear()
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
RecognitionFeatures.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public RecognitionFeatures.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
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
Type Description
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
Type Description
RecognitionFeatures.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public RecognitionFeatures.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
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
Type Description
RecognitionFeatures.Builder

This builder for chaining.

clone()

public RecognitionFeatures.Builder clone()
Returns
Type Description
RecognitionFeatures.Builder
Overrides

getDefaultInstanceForType()

public RecognitionFeatures getDefaultInstanceForType()
Returns
Type Description
RecognitionFeatures

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
boolean

Whether the diarizationConfig field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
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
Name Description
value SpeakerDiarizationConfig
Returns
Type Description
RecognitionFeatures.Builder

mergeFrom(RecognitionFeatures other)

public RecognitionFeatures.Builder mergeFrom(RecognitionFeatures other)
Parameter
Name Description
other RecognitionFeatures
Returns
Type Description
RecognitionFeatures.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public RecognitionFeatures.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
RecognitionFeatures.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public RecognitionFeatures.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
RecognitionFeatures.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final RecognitionFeatures.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
value SpeakerDiarizationConfig
Returns
Type Description
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
Name Description
builderForValue SpeakerDiarizationConfig.Builder
Returns
Type Description
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
Name Description
value boolean

The enableAutomaticPunctuation to set.

Returns
Type Description
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
Name Description
value boolean

The enableSpokenEmojis to set.

Returns
Type Description
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
Name Description
value boolean

The enableSpokenPunctuation to set.

Returns
Type Description
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
Name Description
value boolean

The enableWordConfidence to set.

Returns
Type Description
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
Name Description
value boolean

The enableWordTimeOffsets to set.

Returns
Type Description
RecognitionFeatures.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public RecognitionFeatures.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
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
Name Description
value int

The maxAlternatives to set.

Returns
Type Description
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
Name Description
value RecognitionFeatures.MultiChannelMode

The multiChannelMode to set.

Returns
Type Description
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
Name Description
value int

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

Returns
Type Description
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
Name Description
value boolean

The profanityFilter to set.

Returns
Type Description
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
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
RecognitionFeatures.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final RecognitionFeatures.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
RecognitionFeatures.Builder
Overrides