- Resource: Recognizer
- RecognitionConfig
- AutoDetectDecodingConfig
- ExplicitDecodingConfig
- AudioEncoding
- RecognitionFeatures
- MultiChannelMode
- SpeakerDiarizationConfig
- SpeechAdaptation
- AdaptationPhraseSet
- TranscriptNormalization
- Entry
- TranslationConfig
- State
- Methods
Resource: Recognizer
A Recognizer message. Stores recognition configuration and metadata.
JSON representation |
---|
{ "name": string, "uid": string, "displayName": string, "model": string, "languageCodes": [ string ], "defaultRecognitionConfig": { object ( |
Fields | |
---|---|
name |
Output only. Identifier. The resource name of the Recognizer. Format: |
uid |
Output only. System-assigned unique identifier for the Recognizer. |
display |
User-settable, human-readable name for the Recognizer. Must be 63 characters or less. |
model |
Optional. This field is now deprecated. Prefer the 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. |
languageCodes[] |
Optional. This field is now deprecated. Prefer the The language of the supplied audio as a BCP-47 language tag. 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. When you create or update a Recognizer, these values are stored in normalized BCP-47 form. For example, "en-us" is stored as "en-US". |
default |
Default configuration to use for requests with this Recognizer. This can be overwritten by inline configuration in the |
annotations |
Allows users to store small amounts of arbitrary data. Both the key and the value must be 63 characters or less each. At most 100 annotations. An object containing a list of |
state |
Output only. The Recognizer lifecycle state. |
create |
Output only. Creation time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
update |
Output only. The most recent time this Recognizer was modified. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
delete |
Output only. The time at which this Recognizer was requested for deletion. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
expire |
Output only. The time at which this Recognizer will be purged. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
etag |
Output only. This checksum is computed by the server based on the value of other fields. This may be sent on update, undelete, and delete requests to ensure the client has an up-to-date value before proceeding. |
reconciling |
Output only. Whether or not this Recognizer is in the process of being updated. |
kms |
Output only. The KMS key name with which the Recognizer is encrypted. The expected format is |
kms |
Output only. The KMS key version name with which the Recognizer is encrypted. The expected format is |
RecognitionConfig
Provides information to the Recognizer that specifies how to process the recognition request.
JSON representation |
---|
{ "model": string, "languageCodes": [ string ], "features": { object ( |
Fields | |
---|---|
model |
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 |
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. |
features |
Speech recognition features to enable. |
adaptation |
Speech adaptation context that weights recognizer predictions for specific words and phrases. |
transcript |
Optional. Use transcription normalization to automatically replace parts of the transcript with phrases of your choosing. For StreamingRecognize, this normalization only applies to stable partial transcripts (stability > 0.8) and final transcripts. |
translation |
Optional. Optional configuration used to automatically run translation on the given audio to the desired language for supported models. |
Union field decoding_config . Decoding parameters for audio being sent for recognition. decoding_config can be only one of the following: |
|
auto |
Automatically detect decoding parameters. Preferred for supported formats. |
explicit |
Explicitly specified decoding parameters. Required if using headerless PCM audio (linear16, mulaw, alaw). |
AutoDetectDecodingConfig
This type has no fields.
Automatically detected decoding parameters. Supported for the following encodings:
WAV_LINEAR16: 16-bit signed little-endian PCM samples in a WAV container.
WAV_MULAW: 8-bit companded mulaw samples in a WAV container.
WAV_ALAW: 8-bit companded alaw samples in a WAV container.
RFC4867_5_AMR: AMR frames with an rfc4867.5 header.
RFC4867_5_AMRWB: AMR-WB frames with an rfc4867.5 header.
FLAC: FLAC frames in the "native FLAC" container format.
MP3: MPEG audio frames with optional (ignored) ID3 metadata.
OGG_OPUS: Opus audio frames in an Ogg container.
WEBM_OPUS: Opus audio frames in a WebM container.
MP4_AAC: AAC audio frames in an MP4 container.
M4A_AAC: AAC audio frames in an M4A container.
MOV_AAC: AAC audio frames in an MOV container.
ExplicitDecodingConfig
Explicitly specified decoding parameters.
JSON representation |
---|
{
"encoding": enum ( |
Fields | |
---|---|
encoding |
Required. Encoding of the audio data sent for recognition. |
sample |
Optional. Sample rate in Hertz of the audio data sent for recognition. Valid values are: 8000-48000, and 16000 is optimal. For best results, set the sampling rate of the audio source to 16000 Hz. If that's not possible, use the native sample rate of the audio source (instead of resampling). Note that this field is marked as OPTIONAL for backward compatibility reasons. It is (and has always been) effectively REQUIRED. |
audio |
Optional. Number of channels present in the audio data sent for recognition. Note that this field is marked as OPTIONAL for backward compatibility reasons. It is (and has always been) effectively REQUIRED. The maximum allowed value is 8. |
AudioEncoding
Supported audio data encodings.
Enums | |
---|---|
AUDIO_ENCODING_UNSPECIFIED |
Default value. This value is unused. |
LINEAR16 |
Headerless 16-bit signed little-endian PCM samples. |
MULAW |
Headerless 8-bit companded mulaw samples. |
ALAW |
Headerless 8-bit companded alaw samples. |
AMR |
AMR frames with an rfc4867.5 header. |
AMR_WB |
AMR-WB frames with an rfc4867.5 header. |
FLAC |
FLAC frames in the "native FLAC" container format. |
MP3 |
MPEG audio frames with optional (ignored) ID3 metadata. |
OGG_OPUS |
Opus audio frames in an Ogg container. |
WEBM_OPUS |
Opus audio frames in a WebM container. |
MP4_AAC |
AAC audio frames in an MP4 container. |
M4A_AAC |
AAC audio frames in an M4A container. |
MOV_AAC |
AAC audio frames in an MOV container. |
RecognitionFeatures
Available recognition features.
JSON representation |
---|
{ "profanityFilter": boolean, "enableWordTimeOffsets": boolean, "enableWordConfidence": boolean, "enableAutomaticPunctuation": boolean, "enableSpokenPunctuation": boolean, "enableSpokenEmojis": boolean, "multiChannelMode": enum ( |
Fields | |
---|---|
profanity |
If set to |
enable |
If |
enable |
If |
enable |
If |
enable |
The spoken punctuation behavior for the call. If |
enable |
The spoken emoji behavior for the call. If |
multi |
Mode for recognizing multi-channel audio. |
diarization |
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. |
max |
Maximum number of recognition hypotheses to be returned. The server may return fewer than |
MultiChannelMode
Options for how to recognize multi-channel audio.
Enums | |
---|---|
MULTI_CHANNEL_MODE_UNSPECIFIED |
Default value for the multi-channel mode. If the audio contains multiple channels, only the first channel will be transcribed; other channels will be ignored. |
SEPARATE_RECOGNITION_PER_CHANNEL |
If selected, each channel in the provided audio is transcribed independently. This cannot be selected if the selected model is latest_short . |
SpeakerDiarizationConfig
Configuration to enable speaker diarization.
JSON representation |
---|
{ "minSpeakerCount": integer, "maxSpeakerCount": integer } |
Fields | |
---|---|
min |
Required. Minimum number of speakers in the conversation. This range gives you more flexibility by allowing the system to automatically determine the correct number of speakers. To fix the number of speakers detected in the audio, set |
max |
Required. Maximum number of speakers in the conversation. Valid values are: 1-6. Must be >= |
SpeechAdaptation
Provides "hints" to the speech recognizer to favor specific words and phrases in the results. PhraseSets can be specified as an inline resource, or a reference to an existing PhraseSet resource.
JSON representation |
---|
{ "phraseSets": [ { object ( |
Fields | |
---|---|
phrase |
A list of inline or referenced PhraseSets. |
custom |
A list of inline CustomClasses. Existing CustomClass resources can be referenced directly in a PhraseSet. |
AdaptationPhraseSet
A biasing PhraseSet, which can be either a string referencing the name of an existing PhraseSets resource, or an inline definition of a PhraseSet.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field
|
|
phrase |
The name of an existing PhraseSet resource. The user must have read access to the resource and it must not be deleted. |
inline |
An inline defined PhraseSet. |
TranscriptNormalization
Transcription normalization configuration. Use transcription normalization to automatically replace parts of the transcript with phrases of your choosing. For StreamingRecognize, this normalization only applies to stable partial transcripts (stability > 0.8) and final transcripts.
JSON representation |
---|
{
"entries": [
{
object ( |
Fields | |
---|---|
entries[] |
A list of replacement entries. We will perform replacement with one entry at a time. For example, the second entry in ["cat" => "dog", "mountain cat" => "mountain dog"] will never be applied because we will always process the first entry before it. At most 100 entries. |
Entry
A single replacement configuration.
JSON representation |
---|
{ "search": string, "replace": string, "caseSensitive": boolean } |
Fields | |
---|---|
search |
What to replace. Max length is 100 characters. |
replace |
What to replace with. Max length is 100 characters. |
case |
Whether the search is case sensitive. |
TranslationConfig
Translation configuration. Use to translate the given audio into text for the desired language.
JSON representation |
---|
{ "targetLanguage": string } |
Fields | |
---|---|
target |
Required. The language code to translate to. |
State
Set of states that define the lifecycle of a Recognizer.
Enums | |
---|---|
STATE_UNSPECIFIED |
The default value. This value is used if the state is omitted. |
ACTIVE |
The Recognizer is active and ready for use. |
DELETED |
This Recognizer has been deleted. |
Methods |
|
---|---|
|
Performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished. |
|
Creates a Recognizer . |
|
Deletes the Recognizer . |
|
Returns the requested Recognizer . |
|
Lists Recognizers. |
|
Updates the Recognizer . |
|
Performs synchronous Speech recognition: receive results after all audio has been sent and processed. |
|
Undeletes the Recognizer . |