Translate
概要
Amazon Translate は、ニューラル機械翻訳(NMT: Neural Machine Translation)を API で提供するサービスです。75以上の言語ペアに対応し、リアルタイム翻訳(API)とバッチ翻訳(S3 上の大量ドキュメント)の両方をサポートします。カスタム用語集で専門用語・企業固有名詞・ブランド名の翻訳を制御し、丁寧語(Formality)、不適切な言葉のマスキング(Profanity Masking)、カスタムモデル(Active Custom Translation)による精度向上を提供します。多言語コンテンツローカライゼーション・グローバル EC サイト・カスタマーサポートの基盤です。
課題と特徴
従来型機械翻訳の課題
- 文脈を無視した誤訳: 統計的機械翻訳(SMT)では同じ単語でも文脈に応じた翻訳ができない
- 専門用語の誤認識: 医療・法律・金融用語が誤訳される
- 翻訳品質のばらつき: 言語ペアごとに品質に大きなばらつき
- 大量翻訳のコスト: 人手翻訳は高コスト・時間がかかる
Translate の特徴
| 特徴 |
効果 |
| ニューラル機械翻訳(NMT) |
深層学習で文脈を考慮した自然な翻訳 |
| 75+ 言語対応 |
グローバルスケールの多言語対応 |
| Custom Terminology |
専門用語・ブランド名の翻訳を強制制御 |
| Formality 制御 |
日本語・ドイツ語等で敬語・カジュアル指定 |
| Batch Document Translation |
Word/PDF/PowerPoint/HTML の一括翻訳 |
| Profanity Masking |
不適切な言葉を自動マスク |
| Active Custom Translation |
カスタムモデル で企業固有のスタイル学習 |
| Auto-detect Language |
言語自動検出 |
アーキテクチャ
graph TB
subgraph Input["入力"]
A["リアルタイムAPI<br/>テキスト"]
B["バッチ翻訳<br/>S3ドキュメント"]
end
subgraph Processing["翻訳処理"]
C["言語検出"]
D["NMTモデル選択"]
E["カスタム用語適用"]
F["Formality制御"]
G["Profanity処理"]
H["カスタムモデル"]
end
subgraph Output["出力"]
I["翻訳テキスト"]
J["多言語ドキュメント"]
K["メタデータ"]
end
A --> C
B --> C
C --> D
D --> E
E --> F
F --> G
G --> H
H --> I
H --> J
H --> K
コアコンポーネント
1. リアルタイム翻訳(API)
import boto3
translate = boto3.client('translate', region_name='ap-northeast-1')
response = translate.translate_text(
Text='This product is excellent. I highly recommend it.',
SourceLanguageCode='en',
TargetLanguageCode='ja',
TerminologyNames=['brand-terms']
)
print(response['TranslatedText'])
2. 言語自動検出
response = translate.translate_text(
Text='Bonjour, comment allez-vous?',
SourceLanguageCode='auto',
TargetLanguageCode='ja'
)
print(f"検出言語: {response['SourceLanguageCode']}")
print(f"翻訳: {response['TranslatedText']}")
3. Custom Terminology(用語集)
import csv
import io
terminology_csv = """en,ja
EC2,EC2
RDS,RDS
Amazon Web Services,Amazon Web Services
cloud infrastructure,クラウドインフラストラクチャ
machine learning,機械学習
"""
s3 = boto3.client('s3')
s3.put_object(
Bucket='my-bucket',
Key='terminologies/aws-terms.csv',
Body=terminology_csv.encode
)
response = translate.import_terminology(
Name='aws-terms-2026',
MergeStrategy='OVERWRITE',
TerminologyData={
'File': terminology_csv.encode,
'Format': 'CSV'
},
Tags=[
{'Key': 'Domain', 'Value': 'Cloud'},
{'Key': 'Version', 'Value': '2.0'}
]
)
response = translate.translate_text(
Text='Deploy your application on EC2 using AWS infrastructure.',
SourceLanguageCode='en',
TargetLanguageCode='ja',
TerminologyNames=['aws-terms-2026']
)
4. Batch Document Translation(一括翻訳)
response = translate.start_text_translation_job(
JobName='product-docs-multilingual-2026',
InputDataConfig={
'S3Uri': 's3://my-bucket/input-docs/',
'ContentType': 'text/html'
},
OutputDataConfig={
'S3Uri': 's3://my-bucket/output-docs/'
},
SourceLanguageCode='en',
TargetLanguageCodes=['ja', 'es', 'de', 'fr', 'zh'],
TerminologyNames=['aws-terms-2026', 'product-brand-terms'],
DataAccessRoleArn='arn:aws:iam::123456789:role/TranslateRole',
Settings={
'Formality': 'FORMAL'
}
)
job_name = response['JobId']
import time
while True:
result = translate.describe_text_translation_job(JobId=job_name)
if result['TextTranslationJobProperties']['JobStatus'] == 'COMPLETED':
print(f"✓ 翻訳完了")
print(f"出力: {result['TextTranslationJobProperties']['OutputDataConfig']}")
break
elif result['TextTranslationJobProperties']['JobStatus'] == 'FAILED':
print(f"✗ 翻訳失敗")
break
time.sleep(10)
5. Do Not Translate(翻訳不可タグ)
html_content = """
<div>
<p>Product name: <span translate="no">CloudFront</span> is a CDN service.</p>
<p>Welcome, {username}. Your API key is {api_key}.</p>
</div>
"""
response = translate.translate_text(
Text=html_content,
SourceLanguageCode='en',
TargetLanguageCode='ja'
)
text = "Thank you for your business."
formal = translate.translate_text(
Text=text,
SourceLanguageCode='en',
TargetLanguageCode='ja',
Settings={'Formality': 'FORMAL'}
)
print(formal['TranslatedText'])
informal = translate.translate_text(
Text=text,
SourceLanguageCode='en',
TargetLanguageCode='ja',
Settings={'Formality': 'INFORMAL'}
)
print(informal['TranslatedText'])
7. Profanity Masking(不適切言葉マスク)
text = "This service is f***ing amazing!"
response = translate.translate_text(
Text=text,
SourceLanguageCode='en',
TargetLanguageCode='ja',
Settings={
'Profanity': 'MASK'
}
)
8. Active Custom Translation(カスタムモデル)
training_data = [
('AWS cloud service', 'AWS クラウドサービス'),
('seamless integration', 'シームレスな統合'),
('cutting-edge technology', '最先端技術'),
('customer success', 'カスタマーサクセス'),
]
response = translate.create_parallel_data(
ParallelDataConfig={
'S3Uri': 's3://my-bucket/training-data.txt',
'Format': 'TMX'
},
Name='company-style-2026',
Description='Company-specific translation style',
EncryptionKey={
'Type': 'KMS',
'Id': 'arn:aws:kms:ap-northeast-1:123456789:key/12345678'
}
)
response = translate.import_terminology(
Name='custom-model-data',
MergeStrategy='OVERWRITE'
)
response = translate.translate_text(
Text='We provide cutting-edge AWS solutions.',
SourceLanguageCode='en',
TargetLanguageCode='ja',
TerminologyNames=['custom-model-data']
)
主要ユースケース
1. グローバル EC サイトのコンテンツローカライゼーション
import boto3
import json
def localize_ecommerce_catalog(catalog_s3_bucket):
"""EC サイト商品カタログを 10 言語に自動翻訳"""
translate = boto3.client('translate')
s3 = boto3.client('s3')
dynamodb = boto3.resource('dynamodb')
products_table = dynamodb.Table('Products')
target_languages = ['ja', 'es', 'de', 'fr', 'it', 'pt', 'zh', 'ko', 'ru', 'ar']
response = products_table.scan
for product in response['Items']:
product_id = product['id']
product_name = product['name']
product_description = product['description']
for target_lang in target_languages:
response = translate.translate_text(
Text=product_description,
SourceLanguageCode='en',
TargetLanguageCode=target_lang,
TerminologyNames=['brand-terms']
)
products_table.update_item(
Key={'id': product_id},
UpdateExpression=f'SET #lang_name = :name, #lang_desc = :desc',
ExpressionAttributeNames={
'#lang_name': f'name_{target_lang}',
'#lang_desc': f'description_{target_lang}'
},
ExpressionAttributeValues={
':name': product_name,
':desc': response['TranslatedText']
}
)
2. 多言語カスタマーサポート
import asyncio
import boto3
class MultilingualSupportBot:
def __init__(self):
self.translate = boto3.client('translate')
self.comprehend = boto3.client('comprehend')
async def handle_customer_inquiry(self, customer_message, customer_language):
"""顧客の問い合わせを自動翻訳して サポート担当者に表示"""
translated = self.translate.translate_text(
Text=customer_message,
SourceLanguageCode='auto',
TargetLanguageCode='ja'
)
support_agent_message = translated['TranslatedText']
agent_response = "申し訳ございません。ご確認いただきありがとうございます。"
customer_response = self.translate.translate_text(
Text=agent_response,
SourceLanguageCode='ja',
TargetLanguageCode=customer_language
)
return {
'original_message': customer_message,
'support_agent_sees': support_agent_message,
'agent_response_ja': agent_response,
'customer_receives': customer_response['TranslatedText'],
'sentiment': self.comprehend.detect_sentiment(
Text=support_agent_message,
LanguageCode='ja'
)
}
3. ドキュメント多言語化パイプライン
import boto3
def document_localization_pipeline(
source_bucket,
output_bucket,
target_languages=['ja', 'es', 'fr', 'de']
):
"""PDF/Word/HTML ドキュメントを複数言語に一括翻訳"""
translate = boto3.client('translate')
s3 = boto3.client('s3')
objects = s3.list_objects_v2(Bucket=source_bucket)
for obj in objects.get('Contents', []):
filename = obj['Key']
job = translate.start_text_translation_job(
JobName=f'doc-translation-{filename}',
InputDataConfig={
'S3Uri': f's3://{source_bucket}/{filename}',
'ContentType': 'text/plain'
},
OutputDataConfig={
'S3Uri': f's3://{output_bucket}/translations/'
},
SourceLanguageCode='en',
TargetLanguageCodes=target_languages,
DataAccessRoleArn='arn:aws:iam::123456789:role/TranslateRole'
)
print(f"✓ ジョブ開始: {job['JobId']}")
4. ソーシャルメディア分析(多言語)
import boto3
def analyze_global_social_sentiment(posts_with_languages):
"""世界中の SNS 投稿を統一言語で感情分析"""
translate = boto3.client('translate')
comprehend = boto3.client('comprehend')
results = []
for post, language_code in posts_with_languages:
translated = translate.translate_text(
Text=post,
SourceLanguageCode=language_code,
TargetLanguageCode='en'
)
sentiment = comprehend.detect_sentiment(
Text=translated['TranslatedText'],
LanguageCode='en'
)
results.append({
'original_post': post,
'source_language': language_code,
'translated_text': translated['TranslatedText'],
'sentiment': sentiment['Sentiment'],
'confidence': sentiment['SentimentScore']
})
return results
5. リアルタイムチャット翻訳
import asyncio
import boto3
class RealtimeChatTranslator:
def __init__(self):
self.translate = boto3.client('translate')
self.user_languages = {}
async def broadcast_message(self, sender_id, message):
"""複数ユーザーに異なる言語でメッセージを配信"""
sender_language = self.user_languages.get(sender_id, 'en')
translated_messages = {}
for user_id, user_language in self.user_languages.items:
if user_id == sender_id:
translated_messages[user_id] = message
else:
response = self.translate.translate_text(
Text=message,
SourceLanguageCode=sender_language,
TargetLanguageCode=user_language
)
translated_messages[user_id] = response['TranslatedText']
return translated_messages
6. ニュース記事の自動多言語ローカライゼーション
import boto3
def news_localization_pipeline(article_content, article_id):
"""ニュース記事を自動的に 20 言語に翻訳・配信"""
translate = boto3.client('translate')
dynamodb = boto3.resource('dynamodb')
target_languages = [
'ja', 'es', 'de', 'fr', 'it', 'pt', 'nl', 'ru', 'pl', 'tr',
'zh', 'ko', 'ar', 'hi', 'vi', 'th', 'id', 'tl', 'bn', 'pa'
]
articles_table = dynamodb.Table('Articles')
for target_lang in target_languages:
response = translate.translate_text(
Text=article_content,
SourceLanguageCode='en',
TargetLanguageCode=target_lang,
TerminologyNames=['news-outlet-terms']
)
articles_table.put_item(
Item={
'article_id': f'{article_id}_{target_lang}',
'language': target_lang,
'original_article_id': article_id,
'content': response['TranslatedText'],
'status': 'published'
}
)
7. 金融規制文書の翻訳
import boto3
def regulatory_document_translation(document_s3_uri):
"""金融規制文書を正確に多言語化"""
translate = boto3.client('translate')
response = translate.start_text_translation_job(
JobName='regulatory-doc-translation',
InputDataConfig={
'S3Uri': document_s3_uri,
'ContentType': 'text/plain'
},
OutputDataConfig={
'S3Uri': 's3://my-bucket/regulatory-translations/'
},
SourceLanguageCode='en',
TargetLanguageCodes=['ja', 'de', 'fr'],
TerminologyNames=['financial-legal-terms'],
DataAccessRoleArn='arn:aws:iam::123456789:role/TranslateRole',
Settings={
'Formality': 'FORMAL'
}
)
8. ゲーム多言語化
import boto3
import json
def game_localization(game_strings_json):
"""ゲームの UI/ダイアログを複数言語に翻訳"""
translate = boto3.client('translate')
game_strings = json.loads(game_strings_json)
localized_strings = {}
target_languages = ['ja', 'es', 'de', 'fr', 'it', 'pt', 'ru', 'ko', 'zh']
for language in target_languages:
localized_strings[language] = {}
for key, text in game_strings.items:
response = translate.translate_text(
Text=text,
SourceLanguageCode='en',
TargetLanguageCode=language,
TerminologyNames=['game-brand-terms']
)
localized_strings[language][key] = response['TranslatedText']
return localized_strings
9. ライブイベント字幕(多言語)
import boto3
class LiveEventMultilingualSubtitles:
def __init__(self):
self.transcribe = boto3.client('transcribe')
self.translate = boto3.client('translate')
async def generate_multilingual_captions(self, audio_stream_uri):
"""ライブイベントから複数言語の字幕を自動生成"""
transcript_stream = self.transcribe.start_stream_transcription(
language_code='en-US',
media_sample_rate_hz=16000,
media_encoding='pcm'
)
async for transcript_event in transcript_stream:
for result in transcript_event.transcript.results:
text = result.alternatives[0].transcript
translations = {}
for target_lang in ['ja', 'es', 'de', 'fr']:
response = self.translate.translate_text(
Text=text,
SourceLanguageCode='en',
TargetLanguageCode=target_lang
)
translations[target_lang] = response['TranslatedText']
yield {
'timestamp': result.start_time,
'original': text,
'translations': translations
}
10. マーケティング資料の A/B テスト翻訳
import boto3
def marketing_copy_ab_test(original_text):
"""マーケティングコピーを複数翻訳バリアント生成"""
translate = boto3.client('translate')
formal_version = translate.translate_text(
Text=original_text,
SourceLanguageCode='en',
TargetLanguageCode='ja',
Settings={'Formality': 'FORMAL'}
)
informal_version = translate.translate_text(
Text=original_text,
SourceLanguageCode='en',
TargetLanguageCode='ja',
Settings={'Formality': 'INFORMAL'}
)
return {
'formal': formal_version['TranslatedText'],
'informal': informal_version['TranslatedText']
}
設定・操作の具体例
CLI 例(5+)
1. リアルタイム翻訳
aws translate translate-text \
--text 'Hello, how are you?' \
--source-language-code 'en' \
--target-language-code 'ja' \
--region 'ap-northeast-1' \
--query 'TranslatedText' \
--output text
2. Terminology インポート
aws translate import-terminology \
--name 'brand-terms-2026' \
--merge-strategy 'OVERWRITE' \
--terminology-data 'file:///path/to/terminology.csv,format=CSV' \
--region 'ap-northeast-1'
3. バッチ翻訳ジョブ開始
aws translate start-text-translation-job \
--job-name 'docs-multilingual' \
--input-data-config 'S3Uri=s3://my-bucket/input/' \
--output-data-config 'S3Uri=s3://my-bucket/output/' \
--source-language-code 'en' \
--target-language-codes 'ja' 'es' 'de' \
--data-access-role-arn 'arn:aws:iam::123456789:role/TranslateRole' \
--region 'ap-northeast-1'
4. 翻訳ジョブ進捗確認
aws translate describe-text-translation-job \
--job-id 'job-id-from-previous-command' \
--region 'ap-northeast-1' \
--query 'TextTranslationJobProperties.JobStatus' \
--output text
5. 用語集一覧表示
aws translate list-terminologies \
--region 'ap-northeast-1' \
--query 'TerminologyPropertiesList[*].[Name,SourceLanguageCode,TargetLanguageCodes[0]]' \
--output table
SDK 例(5+)
1. Python: 言語自動検出 + 翻訳
import boto3
translate = boto3.client('translate')
texts = [
"Bonjour",
"Guten Tag",
"Hola",
"こんにちは"
]
for text in texts:
response = translate.translate_text(
Text=text,
SourceLanguageCode='auto',
TargetLanguageCode='en'
)
print(f"{text} ({response['SourceLanguageCode']}) → {response['TranslatedText']}")
2. JavaScript: バッチ翻訳監視
const AWS = require('aws-sdk');
const translate = new AWS.Translate({ region: 'ap-northeast-1' });
async function monitorBatchTranslation(jobId) {
let jobStatus = 'IN_PROGRESS';
while (jobStatus === 'IN_PROGRESS') {
const response = await translate.describeTextTranslationJob({
JobId: jobId
}).promise;
jobStatus = response.TextTranslationJobProperties.JobStatus;
console.log(`Status: ${jobStatus}`);
if (jobStatus === 'COMPLETED') {
console.log(`✓ Translation completed`);
console.log(`Output: ${response.TextTranslationJobProperties.OutputDataConfig.S3Uri}`);
}
await new Promise(resolve => setTimeout(resolve, 5000));
}
}
3. Go: リアルタイム翻訳
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/translate"
)
func translateText(text, sourceLang, targetLang string) {
sess := session.Must(session.NewSession(&aws.Config{
Region: aws.String("ap-northeast-1"),
}))
svc := translate.New(sess)
result, _ := svc.TranslateText(&translate.TranslateTextInput{
Text: aws.String(text),
SourceLanguageCode: aws.String(sourceLang),
TargetLanguageCode: aws.String(targetLang),
})
fmt.Printf("Translation: %s\n", *result.TranslatedText)
}
4. Java: Custom Terminology 活用
import software.amazon.awssdk.services.translate.TranslateClient;
import software.amazon.awssdk.services.translate.model.*;
public class TranslateWithTerminology {
public static void main(String[] args) {
TranslateClient client = TranslateClient.builder
.region(Region.AP_NORTHEAST_1)
.build;
TranslateTextRequest request = TranslateTextRequest.builder
.text("Amazon Web Services provides cloud infrastructure")
.sourceLanguageCode("en")
.targetLanguageCode("ja")
.terminologyNames("aws-terms")
.build;
TranslateTextResponse response = client.translateText(request);
System.out.println("Translated: " + response.translatedText);
client.close;
}
}
using Amazon;
using Amazon.Translate;
using Amazon.Translate.Model;
using System;
using System.Threading.Tasks;
class TranslationWithFormality {
static async Task Main {
var client = new AmazonTranslateClient(RegionEndpoint.APNortheast1);
var formalRequest = new TranslateTextRequest {
Text = "Hello, thank you for your business",
SourceLanguageCode = "en",
TargetLanguageCode = "ja",
Settings = new TranslationSettings {
Formality = Formality.FORMAL
}
};
var formalResponse = await client.TranslateTextAsync(formalRequest);
Console.WriteLine({{CONTENT}}quot;Formal: {formalResponse.TranslatedText}");
formalRequest.Settings.Formality = Formality.INFORMAL;
var informalResponse = await client.TranslateTextAsync(formalRequest);
Console.WriteLine({{CONTENT}}quot;Informal: {informalResponse.TranslatedText}");
}
}
IaC 例(5+)
Resources:
TranslateRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: translate.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonS3FullAccess
TranslateInputBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: translate-input-${AWS::AccountId}
TranslateOutputBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: translate-output-${AWS::AccountId}
resource "aws_s3_bucket" "translate_input" {
bucket = "translate-input-${data.aws_caller_identity.current.account_id}"
}
resource "aws_s3_bucket" "translate_output" {
bucket = "translate-output-${data.aws_caller_identity.current.account_id}"
}
resource "aws_iam_role" "translate_role" {
name = "translate-batch-role"
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [{
Action = "sts:AssumeRole"
Effect = "Allow"
Principal = {
Service = "translate.amazonaws.com"
}
}]
})
}
resource "aws_iam_role_policy" "translate_policy" {
name = "translate-policy"
role = aws_iam_role.translate_role.id
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Action = [
"s3:GetObject",
"s3:PutObject"
]
Resource = [
"${aws_s3_bucket.translate_input.arn}/*",
"${aws_s3_bucket.translate_output.arn}/*"
]
}
]
})
}
3. CDK (Python): Translate パイプライン
from aws_cdk import (
aws_s3 as s3,
aws_iam as iam,
aws_lambda as lambda_,
core
)
class TranslateStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, **kwargs):
super.__init__(scope, id, **kwargs)
input_bucket = s3.Bucket(self, "TranslateInput")
output_bucket = s3.Bucket(self, "TranslateOutput")
translate_func = lambda_.Function(
self, "TranslateFunction",
runtime=lambda_.Runtime.PYTHON_3_11,
code=lambda_.Code.from_asset("lambda"),
handler="translate.handler",
environment={
"INPUT_BUCKET": input_bucket.bucket_name,
"OUTPUT_BUCKET": output_bucket.bucket_name
}
)
input_bucket.grant_read(translate_func)
output_bucket.grant_write(translate_func)
translate_func.add_to_role_policy(
iam.PolicyStatement(
actions=["translate:*"],
resources=["*"]
)
)
Resources:
TerminologyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: translate-terminology-${AWS::AccountId}
TerminologyFile:
Type: AWS::S3::Object
Properties:
Bucket: !Ref TerminologyBucket
Key: brand-terms.csv
Body: |
en,ja
EC2,EC2
Lambda,Lambda
resource "aws_events_rule" "s3_upload" {
name = "detect-s3-upload"
event_pattern = jsonencode({
source = ["aws.s3"]
detail = {
bucket = {
name = [aws_s3_bucket.translate_input.id]
}
}
})
}
resource "aws_events_target" "lambda_target" {
rule = aws_events_rule.s3_upload.name
arn = aws_lambda_function.translate_processor.arn
role_arn = aws_iam_role.eventbridge_role.arn
}
resource "aws_lambda_function" "translate_processor" {
filename = "translate_lambda.zip"
function_name = "translate-document"
handler = "index.handler"
role = aws_iam_role.lambda_role.arn
runtime = "python3.11"
}
比較表
| 特性 |
Translate |
DeepL API |
Google Translate |
Azure Translator |
OpenAI GPT-4o |
Lilt |
| 言語対応 |
75+ |
30+ |
133 |
100+ |
150+ |
50+ |
| カスタム用語集 |
✅ |
✅ |
❌ |
✅ |
❌ |
✅ |
| Formality制御 |
✅(ja/de/fr) |
❌ |
❌ |
❌ |
❌ |
❌ |
| バッチドキュメント |
✅ |
❌ |
❌ |
✅ |
❌ |
✅ |
| カスタムモデル |
✅ |
❌ |
❌ |
❌ |
❌ |
✅ |
| リアルタイム |
✅ |
✅ |
✅ |
✅ |
✅ |
❌ |
| 無料枠 |
200万文字/月 |
500,000文字 |
500k字/月 |
200万文字 |
無し |
無し |
| 料金(基準) |
$15/100万文字 |
$25/100万文字 |
$15/100万文字 |
$15/100万文字 |
$0.03/1k入力トークン |
相談 |
ベストプラクティス
✅ すべき事
- 言語コードを明示: auto 検出より SourceLanguageCode を常に指定
- Custom Terminology 活用: ブランド名・製品名は絶対翻訳しない
- バッチ翻訳で大量処理: API 翻訳より低コスト・高スループット
- 複数言語同時翻訳: 1 ジョブで複数 TargetLanguageCodes を指定
- Formality 設定: 日本語・ドイツ語では適切な敬語制御
- 用語集をバージョン管理: ドメイン変更時に新しい用語集を作成
- Profanity Masking 活用: 顧客向けコンテンツはマスク有効化
- エラーハンドリング: 翻訳失敗時のフォールバック実装
- 出力検証: 翻訳品質が低い場合は人間レビュー追加
❌ してはいけない事
- 言語自動検出のみ使用: auto で言語判別ミス可能性高い
- 用語集なしで専門用語翻訳: 誤訳のリスク大
- 大量文字を 1 回の API 呼び出し: スロットリング回避のため分割
- 翻訳品質の検証なし: コンテンツ品質低下
- バージョン管理なし: 用語集更新で過去翻訳が不一貫に
- 機械翻訳を鵜呑み: 重要文書は人間確認必須
- 無制限の並列リクエスト: API スロットリング対策必須
- TM(翻訳メモリ)管理なし: 大規模翻訳は効率低下
- 翻訳コンテキストなし: 同じ単語でも文脈で意味変わる
トラブルシューティング
| 症状 |
原因 |
解決策 |
| 「Invalid language code」エラー |
未サポート言語指定 |
公式言語リスト確認 |
| 翻訳品質が低い |
専門用語が誤訳 |
Custom Terminology で用語を登録 |
| Custom Terminology 効かない |
ファイルフォーマット不正 |
CSV フォーマット確認(BOM なし UTF-8) |
| バッチジョブ失敗 |
S3 パーミッション不足 |
IAM ロールに S3FullAccess 確認 |
| 翻訳結果に HTML タグ混在 |
入力形式認識エラー |
ContentType 指定(text/html/text/plain) |
| Formality 設定が反映されない |
非対応言語 |
ja/de/fr のみ Formality 対応 |
| バッチ翻訳が遅い |
リソース不足 |
別の出力フォルダ使用・並列度向上 |
| 用語集更新後も古い翻訳 |
キャッシング |
CloudFront キャッシュクリア |
| API スロットリング |
呼び出しレート超過 |
呼び出し間隔調整・リトライロジック |
| Cost 急増 |
想定外の大量翻訳 |
S3 ライフサイクルで古いファイル削除 |
2025-2026近年の動向
1. AI-Powered Context 理解
- 文脈に基づいた自動翻訳精度向上
- 業界別・企業別の最適化
2. Real-time Streaming 翻訳
- Transcribe との統合で同時通訳機能
- ライブイベント字幕対応
3. Generative AI(LLM)統合
- Claude / Bedrock との連携で高精度翻訳
- 創造的・意訳的な翻訳も可能化
4. 垂直領域モデル
- Financial / Legal / Medical / Tech 特化モデル
- ドメイン専用の高精度
5. マルチモーダル翻訳
- 画像・ビデオ内のテキストを自動翻訳
- Rekognition との統合
学習リソース・参考文献
公式ドキュメント(8+)
- Amazon Translate Developer Guide
- Supported Languages
- Custom Terminology Guide
- Batch Translation
- API Reference
- Pricing
- Security & Compliance
- FAQs
OSS・ベンダー リソース(5+)
- DeepL API Documentation
- Google Cloud Translation Client Library
- OpenAI GPT-4 API
- Opus-MT (Open-source Translation Models)
- Hugging Face Transformers for Translation
実装例・チェックリスト
実装例: グローバル E-Commerce ローカライゼーション
import boto3
import concurrent.futures
class GlobalEcommercePlatform:
def __init__(self):
self.translate = boto3.client('translate')
self.s3 = boto3.client('s3')
self.dynamodb = boto3.resource('dynamodb')
self.products_table = self.dynamodb.Table('Products')
def localize_product_catalog(self, language_codes):
"""全商品をすべての言語に翻訳"""
response = self.products_table.scan
products = response['Items']
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
for product in products:
for lang in language_codes:
executor.submit(
self._translate_product,
product,
lang
)
def _translate_product(self, product, target_language):
"""個別商品を翻訳"""
name_response = self.translate.translate_text(
Text=product['name'],
SourceLanguageCode='en',
TargetLanguageCode=target_language,
TerminologyNames=['ecommerce-terms']
)
desc_response = self.translate.translate_text(
Text=product['description'],
SourceLanguageCode='en',
TargetLanguageCode=target_language,
TerminologyNames=['ecommerce-terms'],
Settings={'Formality': 'FORMAL'}
)
self.products_table.update_item(
Key={'product_id': product['product_id']},
UpdateExpression=f'SET #name_{target_language} = :name, #desc_{target_language} = :desc',
ExpressionAttributeNames={
f'#name_{target_language}': f'name_{target_language}',
f'#desc_{target_language}': f'description_{target_language}'
},
ExpressionAttributeValues={
':name': name_response['TranslatedText'],
':desc': desc_response['TranslatedText']
}
)
採用判断チェックリスト
- [ ] 複数言語対応が必要か
- [ ] リアルタイム翻訳か バッチ翻訳か
- [ ] ブランド名・専門用語の保護が必要か(Custom Terminology)
- [ ] 敬語制御が必要か(Formality)
- [ ] 大量ドキュメント翻訳か(バッチ推奨)
- [ ] 翻訳品質の検証体制はあるか
- [ ] コスト管理・スロットリング対策は実装済みか
- [ ] エラーハンドリング・リトライロジックはあるか
- [ ] 翻訳結果をキャッシュするか
まとめ
Translate は 「75以上の言語を高品質で翻訳するニューラル機械翻訳 API」。カスタム用語集・Formality 制御・バッチ翻訳で、専門的・正確な多言語化を実現します。Transcribe・Polly・Comprehend と組み合わせた多言語音声パイプラインの中核、グローバル EC・カスタマーサポート・コンテンツローカライゼーションの基盤サービスです。