AI and Machine Learning on AWS for Beginners: Bedrock, SageMaker, Rekognition, Comprehend, Polly, Transcribe and Lex
Basic Terms
| Term | Meaning |
|---|---|
| AI | Machines doing tasks that need human-like intelligence |
| Machine learning (ML) | Computers learn patterns from data instead of fixed rules |
| Deep learning | ML using neural networks with many layers |
| Generative AI | Models that create text, images, code. Based on foundation models (FMs) and large language models (LLMs) |
| Training / Inference | Learning from data / using the model to predict |
Three Layers of AWS AI
| Layer | For | Services |
|---|---|---|
| AI services (ready to use) | Developers who want results through an API | Rekognition, Comprehend, Textract, Polly, Transcribe, Translate, Lex, Kendra, Personalize, Forecast |
| Generative AI | Build with foundation models | Amazon Bedrock, Amazon Q |
| ML platform | Data scientists who build and train models | Amazon SageMaker |
| Infrastructure | Heavy training and inference | GPU instances, AWS Trainium and Inferentia |
Ready-Made AI Services
| Service | Does |
|---|---|
| Rekognition | Find objects, faces, text and unsafe content in images and video |
| Textract | Extract text, forms and tables from documents |
| Comprehend | Understand text: sentiment, entities, key phrases, language |
| Translate | Translate text between languages |
| Transcribe | Speech to text |
| Polly | Text to speech |
| Lex | Build chatbots with voice and text |
| Kendra | Intelligent enterprise search |
| Personalize | Recommendations like 'customers also bought' |
| Forecast / Fraud Detector | Predictions and fraud checks |
bash
aws rekognition detect-labels --image '{"S3Object":{"Bucket":"my-images","Name":"street.jpg"}}' --max-labels 5
aws comprehend detect-sentiment --language-code en --text "The delivery was fast and the product is great"
aws polly synthesize-speech --output-format mp3 --voice-id Joanna --text "Welcome to AWS" welcome.mp3
aws translate translate-text --source-language-code en --target-language-code hi --text "Good morning"
Amazon Bedrock
- A managed service to use foundation models from Amazon and other providers through one API
- No servers to manage. Your data is not used to train the base models
- Features: Knowledge Bases (RAG: answer from your documents), Agents, Guardrails, fine-tuning and model evaluation
- Typical uses: chat assistants, summarizing, writing help, code help, search over documents
python
import boto3, json
br = boto3.client("bedrock-runtime", region_name="us-east-1")
resp = br.converse(
modelId="amazon.nova-lite-v1:0",
messages=[{"role": "user", "content": [{"text": "Explain Amazon S3 in two simple sentences."}]}],
inferenceConfig={"maxTokens": 200, "temperature": 0.3},
)
print(resp["output"]["message"]["content"][0]["text"])
Note Model IDs and availability change by Region and over time. Check the Bedrock console for models enabled in your account.
Amazon SageMaker
- Platform to build, train, tune and deploy your own ML models
- Includes notebooks, data labeling, pipelines, model hosting endpoints and monitoring
- Choose it when ready-made services do not fit your problem
Responsible AI Basics
- Check for bias and fairness
- Protect privacy and sensitive data
- Keep a human in the loop for important decisions
- Use Guardrails to block harmful content
- Models can hallucinate: verify important facts
Choosing
| Need | Choose |
|---|---|
| Read text from scanned invoices | Textract |
| Detect faces or objects in photos | Rekognition |
| Chatbot over company documents | Bedrock Knowledge Bases or Amazon Q |
| Custom model for your own data | SageMaker |
| Convert call recordings to text | Transcribe |
Practice
- Run Comprehend sentiment on three sentences
- Detect labels in a photo with Rekognition
- Generate speech with Polly
- Call a Bedrock model from the console playground
- Match five business problems to the right service
Conclusion
AWS offers ready-made AI services for common tasks, Bedrock for generative AI with foundation models, and SageMaker to build custom models. Start with the managed service that fits, and use AI responsibly.
Quick Summary: terms; layers; ready-made; Bedrock; SageMaker; responsible AI; choosing.

