Part 2 of 3 in the AWS managed AI/ML series.
| Part | Topic |
|---|---|
| 1 — Text and chatbots | Comprehend, Translate, Lex |
| 2 (this page) | Polly, Transcribe, Rekognition, Textract |
| 3 — Search and recommendations | Kendra, Personalize |
Prerequisites
aws sts get-caller-identity
export AWS_REGION=us-east-1
export BUCKET=your-unique-demo-bucket-$(aws sts get-caller-identity --query Account --output text)
Create a bucket in the same Region as your API calls (required for Transcribe, Rekognition, and Textract with S3 input):
aws s3 mb "s3://${BUCKET}" --region "$AWS_REGION"
Upload a test image (JPEG/PNG) and optional audio (FLAC/MP3/WAV) before Transcribe/Rekognition/Textract sections.
Amazon Polly
Use when: text-to-speech for apps, IVR, or accessibility.
Console
- Open Amazon Polly.
- Text-to-Speech tab.
- Turn SSML off for plain text.
- Enter a short sentence.
- Choose Engine (Standard, Neural, Long Form, or Generative where available), Language, and Voice.
- Listen, or Download (MP3 and other formats under Additional settings).
Reference: Synthesizing speech example.
AWS CLI (Polly)
Synthesize to a local file:
aws polly synthesize-speech \
--region "$AWS_REGION" \
--output-format mp3 \
--voice-id Joanna \
--text "Hello from Amazon Polly." \
hello.mp3
List voices in the Region:
aws polly describe-voices --region "$AWS_REGION" --language-code en-US
Long text to S3 (async task):
echo "Long narration text goes here." > polly-input.txt
aws polly start-speech-synthesis-task \
--region "$AWS_REGION" \
--output-format mp3 \
--output-s3-bucket-name "$BUCKET" \
--voice-id Joanna \
--text file://polly-input.txt
On Windows PowerShell, keep --text in single quotes if the string contains double quotes.
Docs: synthesize-speech.
Amazon Transcribe
Use when: speech in a media file → text transcript (meetings, call recordings, captions).
Transcribe batch jobs read audio from S3 in the same Region as the job.
Console
- Upload audio to your bucket (for example
s3://BUCKET/audio/sample.flac). - Open Amazon Transcribe.
- Transcription jobs → Create job.
- Name the job, choose Language (or language identification if enabled).
- Point Input media at your S3 object; optional output bucket.
- Create the job and open it when status is Completed; download or open the transcript JSON.
Reference: What is Amazon Transcribe.
AWS CLI (Transcribe)
aws s3 cp ./your-audio.flac "s3://${BUCKET}/audio/sample.flac" --region "$AWS_REGION"
aws transcribe start-transcription-job \
--region "$AWS_REGION" \
--transcription-job-name demo-job-$(date +%s) \
--language-code en-US \
--media MediaFileUri="s3://${BUCKET}/audio/sample.flac"
aws transcribe get-transcription-job \
--region "$AWS_REGION" \
--transcription-job-name YOUR_JOB_NAME \
--query 'TranscriptionJob.{Status:TranscriptionJobStatus,Uri:Transcript.TranscriptFileUri}'
When Status is COMPLETED, fetch the transcript URL with curl or open it in a browser (presigned or public per bucket policy).
Docs: Getting started with the CLI.
Amazon Rekognition
Use when: labels/objects in images or Detect text (OCR). CLI requires S3 image reference (not raw bytes).
Console
- Upload
photo.jpgtos3://BUCKET/images/photo.jpg. - Open Amazon Rekognition.
- Label detection or Text detection → upload or choose S3 object.
- Review labels or detected lines of text.
Reference: Detecting labels, Detecting text.
AWS CLI (Rekognition)
Labels:
aws rekognition detect-labels \
--region "$AWS_REGION" \
--image "{\"S3Object\":{\"Bucket\":\"${BUCKET}\",\"Name\":\"images/photo.jpg\"}}" \
--max-labels 10 \
--min-confidence 70
Text (OCR):
aws rekognition detect-text \
--region "$AWS_REGION" \
--image "{\"S3Object\":{\"Bucket\":\"${BUCKET}\",\"Name\":\"images/photo.jpg\"}}"
Docs: detect-labels, detect-text.
Amazon Textract
Use when: forms, tables, or layout on documents (PDF/TIFF/PNG/JPEG)—more structure than plain Rekognition OCR.
Console
- Open Amazon Textract.
- Use Analyze document (demo) or upload a sample invoice/form.
- Enable Forms, Tables, or Queries as needed and inspect blocks in the UI.
For your own files, upload to S3 first (same Region).
Reference: Getting started with Textract, Analyzing document text.
AWS CLI (Textract)
Upload a one-page PDF or image:
aws s3 cp ./document.pdf "s3://${BUCKET}/docs/document.pdf" --region "$AWS_REGION"
Analyze forms and tables (sync, single-page or first page of PDF):
aws textract analyze-document \
--region "$AWS_REGION" \
--document "{\"S3Object\":{\"Bucket\":\"${BUCKET}\",\"Name\":\"docs/document.pdf\"}}" \
--feature-types '["TABLES","FORMS"]'
Multi-page PDFs: use start-document-analysis and get-document-analysis instead of analyze-document.
Docs: analyze-document.
Troubleshooting
| Symptom | Check |
|---|---|
| Transcribe job fails immediately | Input bucket and job Region match; audio format supported. |
| Rekognition / Textract invalid S3 | Object exists; caller has s3:GetObject; bucket Region matches API Region. |
| Textract empty tables | Enable TABLES in --feature-types; scanned PDF quality and rotation. |
| Polly voice error | Voice supports chosen Engine (Neural vs Standard); try describe-voices. |
Next
Continue with Part 3 — Kendra and Personalize.