start_transcription_job
async
¶
start_transcription_job(
transcription_job_name: TranscriptionJobName,
media: Media,
*,
config_overrides: Optional[AsyncTranscribeClientConfig] = None,
language_code: Optional[LanguageCode] = None,
media_sample_rate_hertz: Optional[MediaSampleRateHertz] = None,
media_format: Optional[MediaFormat] = None,
output_bucket_name: Optional[OutputBucketName] = None,
output_key: Optional[OutputKey] = None,
output_encryption_kms_key_id: Optional[KMSKeyId] = None,
kms_encryption_context: Optional[KMSEncryptionContextMap] = None,
settings: Optional[Settings] = None,
model_settings: Optional[ModelSettings] = None,
job_execution_settings: Optional[JobExecutionSettings] = None,
content_redaction: Optional[ContentRedaction] = None,
identify_language: Optional[Boolean] = None,
identify_multiple_languages: Optional[Boolean] = None,
language_options: Optional[LanguageOptions] = None,
subtitles: Optional[Subtitles] = None,
tags: Optional[TagList] = None,
language_id_settings: Optional[LanguageIdSettingsMap] = None,
toxicity_detection: Optional[ToxicityDetection] = None,
) -> StartTranscriptionJobResponse
Transcribes the audio from a media file and applies any additional Request Parameters you choose to include in your request.
To make a StartTranscriptionJob request, you must first upload your media file into an Amazon S3 bucket; you can then specify the Amazon S3 location of the file using the Media parameter.
You must include the following parameters in your StartTranscriptionJob request:
-
region: The Amazon Web Services Region where you are making your request. For a list of Amazon Web Services Regions supported with Amazon Transcribe, refer to Amazon Transcribe endpoints and quotas. -
TranscriptionJobName: A custom name you create for your transcription job that is unique within your Amazon Web Services account. -
Media(MediaFileUri): The Amazon S3 location of your media file. -
One of
LanguageCode,IdentifyLanguage, orIdentifyMultipleLanguages: If you know the language of your media file, specify it using theLanguageCodeparameter; you can find all valid language codes in the Supported languages table. If you do not know the languages spoken in your media, use eitherIdentifyLanguageorIdentifyMultipleLanguagesand let Amazon Transcribe identify the languages for you.
Parameters:
-
transcription_job_name(TranscriptionJobName) –A unique name, chosen by you, for your transcription job. The name that you specify is also used as the default name of your transcription output file. If you want to specify a different name for your transcription output, use the
OutputKeyparameter.This name is case sensitive, cannot contain spaces, and must be unique within an Amazon Web Services account. If you try to create a new job with the same name as an existing job, you get a
ConflictExceptionerror. -
language_code(Optional[LanguageCode], default:None) –The language code that represents the language spoken in the input media file.
If you're unsure of the language spoken in your media file, consider using
IdentifyLanguageorIdentifyMultipleLanguagesto enable automatic language identification.Note that you must include one of
LanguageCode,IdentifyLanguage, orIdentifyMultipleLanguagesin your request. If you include more than one of these parameters, your transcription job fails.For a list of supported languages and their associated language codes, refer to the Supported languages table.
To transcribe speech in Modern Standard Arabic (
ar-SA) in Amazon Web Services GovCloud (US) (US-West, us-gov-west-1), Amazon Web Services GovCloud (US) (US-East, us-gov-east-1), Canada (Calgary, ca-west-1) and Africa (Cape Town, af-south-1), your media file must be encoded at a sample rate of 16,000 Hz or higher. -
media_sample_rate_hertz(Optional[MediaSampleRateHertz], default:None) –The sample rate, in hertz, of the audio track in your input media file.
If you do not specify the media sample rate, Amazon Transcribe determines it for you. If you specify the sample rate, it must match the rate detected by Amazon Transcribe. If there's a mismatch between the value that you specify and the value detected, your job fails. In most cases, you can omit
MediaSampleRateHertzand let Amazon Transcribe determine the sample rate. -
media_format(Optional[MediaFormat], default:None) –Specify the format of your input media file.
-
media(Media) –Describes the Amazon S3 location of the media file you want to use in your request.
-
output_bucket_name(Optional[OutputBucketName], default:None) –The name of the Amazon S3 bucket where you want your transcription output stored. Do not include the
S3://prefix of the specified bucket.If you want your output to go to a sub-folder of this bucket, specify it using the
OutputKeyparameter;OutputBucketNameonly accepts the name of a bucket.For example, if you want your output stored in
S3://DOC-EXAMPLE-BUCKET, setOutputBucketNametoDOC-EXAMPLE-BUCKET. However, if you want your output stored inS3://DOC-EXAMPLE-BUCKET/test-files/, setOutputBucketNametoDOC-EXAMPLE-BUCKETandOutputKeytotest-files/.Note that Amazon Transcribe must have permission to use the specified location. You can change Amazon S3 permissions using the Amazon Web Services Management Console. See also Permissions Required for IAM User Roles.
If you do not specify
OutputBucketName, your transcript is placed in a service-managed Amazon S3 bucket and you are provided with a URI to access your transcript. -
output_key(Optional[OutputKey], default:None) –Use in combination with
OutputBucketNameto specify the output location of your transcript and, optionally, a unique name for your output file. The default name for your transcription output is the same as the name you specified for your transcription job (TranscriptionJobName).Here are some examples of how you can use
OutputKey:-
If you specify 'DOC-EXAMPLE-BUCKET' as the
OutputBucketNameand 'my-transcript.json' as theOutputKey, your transcription output path iss3://DOC-EXAMPLE-BUCKET/my-transcript.json. -
If you specify 'my-first-transcription' as the
TranscriptionJobName, 'DOC-EXAMPLE-BUCKET' as theOutputBucketName, and 'my-transcript' as theOutputKey, your transcription output path iss3://DOC-EXAMPLE-BUCKET/my-transcript/my-first-transcription.json. -
If you specify 'DOC-EXAMPLE-BUCKET' as the
OutputBucketNameand 'test-files/my-transcript.json' as theOutputKey, your transcription output path iss3://DOC-EXAMPLE-BUCKET/test-files/my-transcript.json. -
If you specify 'my-first-transcription' as the
TranscriptionJobName, 'DOC-EXAMPLE-BUCKET' as theOutputBucketName, and 'test-files/my-transcript' as theOutputKey, your transcription output path iss3://DOC-EXAMPLE-BUCKET/test-files/my-transcript/my-first-transcription.json.
If you specify the name of an Amazon S3 bucket sub-folder that doesn't exist, one is created for you.
-
-
output_encryption_kms_key_id(Optional[KMSKeyId], default:None) –The Amazon Resource Name (ARN) of a KMS key that you want to use to encrypt your transcription output.
KMS key ARNs have the format
arn:partition:kms:region:account:key/key-id. For example:arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab. For more information, see KMS key ARNs.If you do not specify an encryption key, your output is encrypted with the default Amazon S3 key (SSE-S3).
Note that the role making the request and the role specified in the
DataAccessRoleArnrequest parameter (if present) must have permission to use the specified KMS key. -
kms_encryption_context(Optional[KMSEncryptionContextMap], default:None) –A map of plain text, non-secret key:value pairs, known as encryption context pairs, that provide an added layer of security for your data. For more information, see KMS encryption context and Asymmetric keys in KMS.
-
settings(Optional[Settings], default:None) –Specify additional optional settings in your request, including channel identification, alternative transcriptions, speaker partitioning. You can use that to apply custom vocabularies and vocabulary filters.
If you want to include a custom vocabulary or a custom vocabulary filter (or both) with your request but do not want to use automatic language identification, use
Settingswith theVocabularyNameorVocabularyFilterName(or both) sub-parameter.If you're using automatic language identification with your request and want to include a custom language model, a custom vocabulary, or a custom vocabulary filter, use instead the
parameter with theLanguageModelName,VocabularyNameorVocabularyFilterNamesub-parameters. -
model_settings(Optional[ModelSettings], default:None) –Specify the custom language model you want to include with your transcription job. If you include
ModelSettingsin your request, you must include theLanguageModelNamesub-parameter.For more information, see Custom language models.
-
job_execution_settings(Optional[JobExecutionSettings], default:None) –Makes it possible to control how your transcription job is processed. Currently, the only
JobExecutionSettingsmodification you can choose is enabling job queueing using theAllowDeferredExecutionsub-parameter.If you include
JobExecutionSettingsin your request, you must also include the sub-parameters:AllowDeferredExecutionandDataAccessRoleArn. -
content_redaction(Optional[ContentRedaction], default:None) –Makes it possible to redact specified personally identifiable information (PII) in your transcript. If you use
ContentRedaction, you must also include the sub-parameters:RedactionOutputandRedactionType. You can optionally includePiiEntityTypesto choose which types of PII you want to redact. If you do not includePiiEntityTypesin your request, all PII is redacted. -
identify_language(Optional[Boolean], default:None) –Enables automatic language identification in your transcription job request. Use this parameter if your media file contains only one language. If your media contains multiple languages, use
IdentifyMultipleLanguagesinstead.If you include
IdentifyLanguage, you can optionally include a list of language codes, usingLanguageOptions, that you think may be present in your media file. IncludingLanguageOptionsrestrictsIdentifyLanguageto only the language options that you specify, which can improve transcription accuracy.If you want to apply a custom language model, a custom vocabulary, or a custom vocabulary filter to your automatic language identification request, include
LanguageIdSettingswith the relevant sub-parameters (VocabularyName,LanguageModelName, andVocabularyFilterName). If you includeLanguageIdSettings, also includeLanguageOptions.Note that you must include one of
LanguageCode,IdentifyLanguage, orIdentifyMultipleLanguagesin your request. If you include more than one of these parameters, your transcription job fails. -
identify_multiple_languages(Optional[Boolean], default:None) –Enables automatic multi-language identification in your transcription job request. Use this parameter if your media file contains more than one language. If your media contains only one language, use
IdentifyLanguageinstead.If you include
IdentifyMultipleLanguages, you can optionally include a list of language codes, usingLanguageOptions, that you think may be present in your media file. IncludingLanguageOptionsrestrictsIdentifyLanguageto only the language options that you specify, which can improve transcription accuracy.If you want to apply a custom vocabulary or a custom vocabulary filter to your automatic language identification request, include
LanguageIdSettingswith the relevant sub-parameters (VocabularyNameandVocabularyFilterName). If you includeLanguageIdSettings, also includeLanguageOptions.Note that you must include one of
LanguageCode,IdentifyLanguage, orIdentifyMultipleLanguagesin your request. If you include more than one of these parameters, your transcription job fails. -
language_options(Optional[LanguageOptions], default:None) –You can specify two or more language codes that represent the languages you think may be present in your media. Including more than five is not recommended. If you're unsure what languages are present, do not include this parameter.
If you include
LanguageOptionsin your request, you must also includeIdentifyLanguage.For more information, refer to Supported languages.
To transcribe speech in Modern Standard Arabic (
ar-SA)in Amazon Web Services GovCloud (US) (US-West, us-gov-west-1), Amazon Web Services GovCloud (US) (US-East, us-gov-east-1), in Canada (Calgary) ca-west-1 and Africa (Cape Town) af-south-1, your media file must be encoded at a sample rate of 16,000 Hz or higher. -
subtitles(Optional[Subtitles], default:None) –Produces subtitle files for your input media. You can specify WebVTT (*.vtt) and SubRip (*.srt) formats.
-
tags(Optional[TagList], default:None) –Adds one or more custom tags, each in the form of a key:value pair, to a new transcription job at the time you start this new job.
To learn more about using tags with Amazon Transcribe, refer to Tagging resources.
-
language_id_settings(Optional[LanguageIdSettingsMap], default:None) –If using automatic language identification in your request and you want to apply a custom language model, a custom vocabulary, or a custom vocabulary filter, include
LanguageIdSettingswith the relevant sub-parameters (VocabularyName,LanguageModelName, andVocabularyFilterName). Note that multi-language identification (IdentifyMultipleLanguages) doesn't support custom language models.LanguageIdSettingssupports two to five language codes. Each language code you include can have an associated custom language model, custom vocabulary, and custom vocabulary filter. The language codes that you specify must match the languages of the associated custom language models, custom vocabularies, and custom vocabulary filters.It's recommended that you include
LanguageOptionswhen usingLanguageIdSettingsto ensure that the correct language dialect is identified. For example, if you specify a custom vocabulary that is inen-USbut Amazon Transcribe determines that the language spoken in your media isen-AU, your custom vocabulary is not applied to your transcription. If you includeLanguageOptionsand includeen-USas the only English language dialect, your custom vocabulary is applied to your transcription.If you want to include a custom language model with your request but do not want to use automatic language identification, use instead the
parameter with theLanguageModelNamesub-parameter. If you want to include a custom vocabulary or a custom vocabulary filter (or both) with your request but do not want to use automatic language identification, use instead theparameter with theVocabularyNameorVocabularyFilterName(or both) sub-parameter. -
toxicity_detection(Optional[ToxicityDetection], default:None) –Enables toxic speech detection in your transcript. If you include
ToxicityDetectionin your request, you must also includeToxicityCategories.For information on the types of toxic speech Amazon Transcribe can detect, see Detecting toxic speech.
Raises:
-
BadRequestException–Your request didn't pass one or more validation tests. This can occur when a parameter has an invalid value, when you combine parameters in a way that isn't supported, 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.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_transcribe/_services/async_transcribe.py
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 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 | |