Amazon Translate - Developer Guide

[Pages:120]Amazon Translate

Developer Guide

Amazon Translate Developer Guide

Amazon Translate: Developer Guide

Copyright ? 2022 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon.

Amazon Translate Developer Guide

Table of Contents

What is Amazon Translate? ................................................................................................................. 1 Use cases .................................................................................................................................. 1 First-time user ........................................................................................................................... 1 Amazon Translate pricing ............................................................................................................ 2 Amazon Translate API Reference .................................................................................................. 2

Supported languages .......................................................................................................................... 3 Limitations in language support ................................................................................................... 5

How it works ..................................................................................................................................... 6 Automatic language detection ..................................................................................................... 6 Exception handling ..................................................................................................................... 6 Next steps ................................................................................................................................. 7

Getting started .................................................................................................................................. 8 Step 1: Set up an account ........................................................................................................... 8 Sign up for AWS ................................................................................................................ 8 Create an IAM user ............................................................................................................. 9 Next step .......................................................................................................................... 9 Step 2: Set up the AWS CLI ......................................................................................................... 9 Next step ........................................................................................................................ 10 Step 3: Getting started (console) ................................................................................................ 10 Next step ........................................................................................................................ 12 Step 4: Getting started (AWS CLI) .............................................................................................. 12 Translate text using the command line ............................................................................... 13 Translate text using a JSON file ......................................................................................... 13 Next step ........................................................................................................................ 14 Step 5: Getting started (SDK) .................................................................................................... 14 Using the SDK for Java ..................................................................................................... 14 Using the AWS SDK for Python .......................................................................................... 15 Using the Mobile SDK for Android ...................................................................................... 17 Using the Mobile SDK for iOS ............................................................................................ 18

Translation processing modes ............................................................................................................ 21 Real-time translation ................................................................................................................ 21 Asynchronous batch processing .................................................................................................. 21 Region availability ............................................................................................................ 21 Prerequisites .................................................................................................................... 22 Running a job .................................................................................................................. 25 Monitoring and analyzing .................................................................................................. 29 Getting results ................................................................................................................. 31

Customizing your translations ............................................................................................................ 33 Using do-not-translate tags ....................................................................................................... 33 Using do-not-translate with the console .............................................................................. 33 Using do-not-translate with the API ................................................................................... 34 Customizing with custom terminology ........................................................................................ 34 How does this work? ........................................................................................................ 35 Creating a custom terminology .......................................................................................... 35 Using custom terminologies .............................................................................................. 37 Encrypting your terminology ............................................................................................. 38 Best practices .................................................................................................................. 38 Masking Profanity .................................................................................................................... 38 Using the profanity setting ................................................................................................ 39 Unsupported languages .................................................................................................... 39 Setting Formality ..................................................................................................................... 40 Using the formality setting ................................................................................................ 40 Supported languages ........................................................................................................ 40 Customizing with parallel data ................................................................................................... 41

iii

Amazon Translate Developer Guide

Region availability ............................................................................................................ 42 Parallel data input files for Amazon Translate ...................................................................... 42 Adding parallel data ......................................................................................................... 46 Viewing and managing parallel data ................................................................................... 48 Examples ......................................................................................................................................... 52 Using Amazon Polly with Amazon Translate ................................................................................ 52 Code ............................................................................................................................... 52 Using Amazon Translate to translate a chat channel ..................................................................... 56 Using Amazon Translate with DynamoDB .................................................................................... 64 Example code .................................................................................................................. 65 Using Amazon Translate to translate a web page ......................................................................... 67 Using Amazon Translate to translate large documents .................................................................. 70 Using Signature Version 4 with Amazon Translate ........................................................................ 72 Setting up ....................................................................................................................... 72 Code ............................................................................................................................... 72 Tagging ........................................................................................................................................... 76 Tagging a new resource ............................................................................................................ 76 Viewing, editing, and deleting tags ............................................................................................. 77 Security ........................................................................................................................................... 79 Data protection ........................................................................................................................ 79 Encryption at rest ............................................................................................................. 80 Encryption in transit ......................................................................................................... 81 Identity and access management ............................................................................................... 81 Audience ......................................................................................................................... 81 Authenticating with identities ............................................................................................ 82 Managing access using policies .......................................................................................... 84 Allow users to view their own permissions ........................................................................... 85 How Amazon Translate works with IAM ............................................................................... 86 Identity-based policy examples .......................................................................................... 88 Troubleshooting ............................................................................................................... 91 Amazon Translate API permissions reference ........................................................................ 93 Monitoring ............................................................................................................................... 93 Monitoring with CloudWatch ............................................................................................. 95 Logging Amazon Translate API calls with AWS CloudTrail ...................................................... 96 CloudWatch metrics and dimensions for Amazon Translate .................................................... 98 Monitoring with EventBridge ............................................................................................. 99 Compliance validation ............................................................................................................. 101 Resilience .............................................................................................................................. 102 Infrastructure security ............................................................................................................. 102 VPC endpoints (AWS PrivateLink) ............................................................................................. 102 Considerations for Amazon Translate VPC endpoints ........................................................... 102 Creating an interface VPC endpoint for Amazon Translate ................................................... 103 Creating a VPC endpoint policy for Amazon Translate ......................................................... 103 Guidelines and limits ...................................................................................................................... 105 Supported AWS Regions .......................................................................................................... 105 Compliance ............................................................................................................................ 105 Throttling .............................................................................................................................. 105 Guidelines .............................................................................................................................. 105 Service limits ......................................................................................................................... 105 Document history ........................................................................................................................... 108 API reference ................................................................................................................................. 115 AWS glossary ................................................................................................................................. 116

iv

Amazon Translate Developer Guide Use cases

What is Amazon Translate?

Amazon Translate is a text translation service that uses advanced machine learning technologies to provide high-quality translation on demand. You can use Amazon Translate to translate unstructured text documents or to build applications that work in multiple languages. See Supported languages and language codes (p. 3) for information about the languages that Amazon Translate supports.

Topics ? Use cases (p. 1) ? Are you a first-time user of Amazon Translate? (p. 1) ? Amazon Translate pricing (p. 2) ? Amazon Translate API Reference (p. 2)

Use cases

Use Amazon Translate to do the following:

Enable multilingual user experiences in your applications by integrating Amazon Translate: ? Translate company-authored content, such as meeting minutes, technician reports, knowledgebase articles, posts, and more. ? Translate interpersonal communications, such as email, in-game chat, customer service chat, so that customers and employees can connect in their preferred language.

Process and manage your company's incoming data: ? Analyze text, such as social media and news feeds, in many languages. ? Search for information, such as for eDiscovery cases, in many languages.

Enable language-independent processing by integrating Amazon Translate with other AWS services: ? Extract named entities, sentiment, and key phrases from unstructured text, such as social media streams with Amazon Comprehend. ? Make subtitles and live captioning available in many languages with Amazon Transcribe. ? Speak translated content with Amazon Polly. ? Translate document repositories stored in Amazon S3 . ? Translate text stored in the following databases: Amazon DynamoDB, Amazon Aurora, and Amazon Redshift. ? Seamlessly integrate workflows with AWS Lambda or AWS Glue.

Are you a first-time user of Amazon Translate?

If you are a first-time user of Amazon Translate, we recommend that you start with the following topics:

1. How Amazon Translate works (p. 6) ? Introduces Amazon Translate. 2. Getting started with Amazon Translate (p. 8) ? Explains how to set up your AWS account and start

using Amazon Translate. 3. Examples (p. 52) ? Provides code examples in Java and Python. Use the examples to explore how

Amazon Translate works.

1

Amazon Translate Developer Guide Amazon Translate pricing

You can also use the following resources to learn about the Amazon Translate service: ? The AWS Machine Learning Blog includes useful articles about Amazon Translate. ? Amazon Translate Deep Dive Video Series provides introductory videos about Amazon Translate.

Amazon Translate pricing

As with other AWS products, there are no contracts or minimum commitments for using Amazon Translate. For more information about the cost of using Amazon Translate, see Amazon Translate Pricing.

Amazon Translate API Reference

The Amazon Translate API Reference is now a separate document. For more information, see Amazon Translate API Reference.

2

Amazon Translate Developer Guide

Supported languages and language codes

Amazon Translate provides translation between a source language (the input language) and a target language (the output language). A source language-target language combination is known as a language pair.

Note Amazon Translate does not charge you for translations if you specify the same language for the source language and the target language. If you set the source language to auto, you may be charged for using auto detection. For more information, see Automatic language detection (p. 6).

Amazon Translate supports text translation between the languages listed in the following table. The language code column uses ISO 639-1 two-digit language codes. For a country variant of a language, the table follows the RFC 5646 format of appending a dash followed by an ISO 3166 2-digit country code. For example, the language code for the Mexican variant of Spanish is es-MX.

Language Afrikaans Albanian Amharic Arabic Armenian Azerbaijani Bengali Bosnian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dari Dutch English Estonian

Language code af sq am ar hy az bn bs bg ca zh zh-TW hr cs da fa-AF nl en et

3

Language Farsi (Persian) Filipino, Tagalog Finnish French French (Canada) Georgian German Greek Gujarati Haitian Creole Hausa Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Kannada Kazakh Korean Latvian Lithuanian Macedonian Malay Malayalam Maltese Marathi Mongolian Norwegian (Bokm?l)

Amazon Translate Developer Guide

Language code fa tl fi fr fr-CA ka de el gu ht ha he hi hu is id ga it ja kn kk ko lv lt mk ms ml mt mr mn no

4

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download