update_vocabulary
async
¶
update_vocabulary(
vocabulary_name: VocabularyName,
language_code: LanguageCode,
*,
config_overrides: Optional[AsyncTranscribeClientConfig] = None,
phrases: Optional[Phrases] = None,
vocabulary_file_uri: Optional[Uri] = None,
data_access_role_arn: Optional[DataAccessRoleArn] = None,
encryption_configuration: Optional[EncryptionConfiguration] = None,
) -> UpdateVocabularyResponse
Updates an existing custom vocabulary with new values. This operation overwrites all existing information with your new values; you cannot append new terms onto an existing custom vocabulary.
Your custom vocabulary must be in a terminal state (READY or FAILED) before you can update it. You must include either Phrases or VocabularyFileUri in your request.
Parameters:
-
vocabulary_name(VocabularyName) –The name of the custom vocabulary you want to update. Custom vocabulary names are case sensitive.
-
language_code(LanguageCode) –The language code that represents the language of the entries in the custom vocabulary you want to update. Each custom vocabulary must contain terms in only one language.
A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. For example, if you create a custom vocabulary using US English (
en-US), you can only apply this custom vocabulary to files that contain English audio.For a list of supported languages and their associated language codes, refer to the Supported languages table.
-
phrases(Optional[Phrases], default:None) –Use this parameter if you want to update your custom vocabulary by including all desired terms, as comma-separated values, within your request. The other option for updating your custom vocabulary is to save your entries in a text file and upload them to an Amazon S3 bucket, then specify the location of your file using the
VocabularyFileUriparameter.Note that if you include
Phrasesin your request, you cannot useVocabularyFileUri; you must choose one or the other.Each language has a character set that contains all allowed characters for that specific language. If you use unsupported characters, your custom vocabulary filter request fails. Refer to Character Sets for Custom Vocabularies to get the character set for your language.
-
vocabulary_file_uri(Optional[Uri], default:None) –The Amazon S3 location of the text file that contains your custom vocabulary. The URI must be located in the same Amazon Web Services Region as the resource you're calling.
Here's an example URI path:
s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txtNote that if you include
VocabularyFileUriin your request, you cannot use thePhrasesflag; you must choose one or the other. -
data_access_role_arn(Optional[DataAccessRoleArn], default:None) –The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that contains your input files (in this case, your custom vocabulary). If you include
EncryptionConfigurationin your request, this role must also have permissions to access the specified KMS key. If the role that you specify doesn’t have the appropriate permissions, your request fails.IAM role ARNs have the format
arn:partition:iam::account:role/role-name-with-path. For example:arn:aws:iam::111122223333:role/Admin.For more information, see IAM ARNs.
-
encryption_configuration(Optional[EncryptionConfiguration], default:None) –Specifies the new encryption configuration for your custom vocabulary. The vocabulary artifacts are re-encrypted in place using the specified KMS key or with an AWS-owned key if a key is not supplied.
Raises:
-
BadRequestException–Your request didn't pass one or more validation tests. This can occur when the entity you're trying to delete doesn't exist or if it's in a non-terminal state (such as
IN PROGRESS). See the exception message field for more information. -
ConflictException–A resource already exists with this name. Resource names must be unique within an Amazon Web Services account.
-
InternalFailureException–There was an internal error. Check the error message, correct the issue, and try your request again.
-
LimitExceededException–You've either sent too many requests or your input file is too long. Wait before retrying your request, or use a smaller file and try your request again.
-
NotFoundException–We can't find the requested resource. Check that the specified name is correct and try your request again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_transcribe/_services/async_transcribe.py
3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 | |