update_vocabulary
¶
update_vocabulary(
vocabulary_name: VocabularyName,
language_code: LanguageCode,
*,
config_overrides: Optional[TranscribeClientConfig] = 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/transcribe.py
2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 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 | |