Cloud Speech V2 Client - Class RecognitionConfig (2.0.1)

Reference documentation and code samples for the Cloud Speech V2 Client class RecognitionConfig.

Provides information to the Recognizer that specifies how to process the recognition request.

Generated from protobuf message google.cloud.speech.v2.RecognitionConfig

Namespace

Google \ Cloud \ Speech \ V2

Methods

__construct

Constructor.

Parameters
NameDescription
dataarray

Optional. Data for populating the Message object.

↳ auto_decoding_configAutoDetectDecodingConfig

Automatically detect decoding parameters. Preferred for supported formats.

↳ explicit_decoding_configExplicitDecodingConfig

Explicitly specified decoding parameters. Required if using headerless PCM audio (linear16, mulaw, alaw).

↳ modelstring

Optional. Which model to use for recognition requests. Select the model best suited to your domain to get best results. Guidance for choosing which model to use can be found in the Transcription Models Documentation and the models supported in each region can be found in the Table Of Supported Models.

↳ language_codesarray

Optional. The language of the supplied audio as a BCP-47 language tag. Language tags are normalized to BCP-47 before they are used eg "en-us" becomes "en-US". Supported languages for each model are listed in the Table of Supported Models. If additional languages are provided, recognition result will contain recognition in the most likely language detected. The recognition result will include the language tag of the language detected in the audio.

↳ featuresRecognitionFeatures

Speech recognition features to enable.

↳ adaptationSpeechAdaptation

Speech adaptation context that weights recognizer predictions for specific words and phrases.

↳ transcript_normalizationTranscriptNormalization

Optional. Use transcription normalization to automatically replace parts of the transcript with phrases of your choosing. For Recognize, this normalization only applies to stable partial transcripts (stability > 0.8) and final transcripts.

↳ translation_configTranslationConfig

Optional. Optional configuration used to automatically run translation on the given audio to the desired language for supported models.

getAutoDecodingConfig

Automatically detect decoding parameters.

Preferred for supported formats.

Returns
TypeDescription
AutoDetectDecodingConfig|null

hasAutoDecodingConfig

setAutoDecodingConfig

Automatically detect decoding parameters.

Preferred for supported formats.

Parameter
NameDescription
varAutoDetectDecodingConfig
Returns
TypeDescription
$this

getExplicitDecodingConfig

Explicitly specified decoding parameters.

Required if using headerless PCM audio (linear16, mulaw, alaw).

Returns
TypeDescription
ExplicitDecodingConfig|null

hasExplicitDecodingConfig

setExplicitDecodingConfig

Explicitly specified decoding parameters.

Required if using headerless PCM audio (linear16, mulaw, alaw).

Parameter
NameDescription
varExplicitDecodingConfig
Returns
TypeDescription
$this

getModel

Optional. Which model to use for recognition requests. Select the model best suited to your domain to get best results.

Guidance for choosing which model to use can be found in the Transcription Models Documentation and the models supported in each region can be found in the Table Of Supported Models.

Returns
TypeDescription
string

setModel

Optional. Which model to use for recognition requests. Select the model best suited to your domain to get best results.

Guidance for choosing which model to use can be found in the Transcription Models Documentation and the models supported in each region can be found in the Table Of Supported Models.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getLanguageCodes

Optional. The language of the supplied audio as a BCP-47 language tag.

Language tags are normalized to BCP-47 before they are used eg "en-us" becomes "en-US". Supported languages for each model are listed in the Table of Supported Models. If additional languages are provided, recognition result will contain recognition in the most likely language detected. The recognition result will include the language tag of the language detected in the audio.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setLanguageCodes

Optional. The language of the supplied audio as a BCP-47 language tag.

Language tags are normalized to BCP-47 before they are used eg "en-us" becomes "en-US". Supported languages for each model are listed in the Table of Supported Models. If additional languages are provided, recognition result will contain recognition in the most likely language detected. The recognition result will include the language tag of the language detected in the audio.

Parameter
NameDescription
varstring[]
Returns
TypeDescription
$this

getFeatures

Speech recognition features to enable.

Returns
TypeDescription
RecognitionFeatures|null

hasFeatures

clearFeatures

setFeatures

Speech recognition features to enable.

Parameter
NameDescription
varRecognitionFeatures
Returns
TypeDescription
$this

getAdaptation

Speech adaptation context that weights recognizer predictions for specific words and phrases.

Returns
TypeDescription
SpeechAdaptation|null

hasAdaptation

clearAdaptation

setAdaptation

Speech adaptation context that weights recognizer predictions for specific words and phrases.

Parameter
NameDescription
varSpeechAdaptation
Returns
TypeDescription
$this

getTranscriptNormalization

Optional. Use transcription normalization to automatically replace parts of the transcript with phrases of your choosing. For Recognize, this normalization only applies to stable partial transcripts (stability > 0.8) and final transcripts.

Returns
TypeDescription
TranscriptNormalization|null

hasTranscriptNormalization

clearTranscriptNormalization

setTranscriptNormalization

Optional. Use transcription normalization to automatically replace parts of the transcript with phrases of your choosing. For Recognize, this normalization only applies to stable partial transcripts (stability > 0.8) and final transcripts.

Parameter
NameDescription
varTranscriptNormalization
Returns
TypeDescription
$this

getTranslationConfig

Optional. Optional configuration used to automatically run translation on the given audio to the desired language for supported models.

Returns
TypeDescription
TranslationConfig|null

hasTranslationConfig

clearTranslationConfig

setTranslationConfig

Optional. Optional configuration used to automatically run translation on the given audio to the desired language for supported models.

Parameter
NameDescription
varTranslationConfig
Returns
TypeDescription
$this

getDecodingConfig

Returns
TypeDescription
string