start_transcription_job
¶
start_transcription_job(
transcription_job_name: TranscriptionJobName,
media: Media,
*,
config_overrides: Optional[TranscribeClientConfig] = 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 or flag 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 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/transcribe.py
2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 | |