Amazon Comprehend — Natural language processing API for sentiment analysis, entity recognition, and text insights.
What is Amazon Comprehend?
Amazon Comprehend is a natural language processing (NLP) service that uses machine learning to extract insights from text. It uncovers meaning, relationships, and sentiment in documents, social media, emails, and more — without requiring ML expertise.
Key Insight: Comprehend is “text analytics as a service” — it tells you what the text means, not just what words it contains.
Key Features
| Feature | Description |
|---|---|
| Sentiment Analysis | Detect positive, negative, neutral, or mixed sentiment |
| Targeted Sentiment | Analyze sentiment toward specific entities (e.g., “product” mentions) |
| Entity Recognition | Identify people, places, dates, organizations, quantities |
| Key Phrase Extraction | Extract meaningful phrases and topics |
| PII Detection | Detect PII entities (redaction available via asynchronous jobs) |
| Toxicity Detection | Detect toxic content and unsafe prompts |
| Language Detection | Detect dominant language (feature support varies by language) |
| Topic Modeling | Discover topics in document collections |
| Syntax Analysis | Parse parts of speech and sentence structure |
| Custom Classification | Train models to categorize documents your way |
| Custom Entity Recognition | Train models to identify domain-specific entities |
Use Cases
Customer Support Analysis
Analyze support tickets for sentiment, detect angry customers, route tickets automatically.
Social Media Monitoring
Track brand sentiment, detect trending topics, identify influencers.
Document Processing
Classify legal documents, extract clauses, redact PII from contracts.
Compliance & Security
Detect PII in logs and emails for GDPR/CCPA compliance, identify security threats.
Content Moderation
Analyze user-generated content for toxic language, detect spam, categorize content.
How It Works
1. Send Text:
- Real-time: Send UTF-8 plain text directly to API
- Batch: Upload documents (txt, pdf, docx) to S3 for async processing
2. Choose Operation:
DetectSentiment— Overall sentimentDetectEntities— People, places, organizationsDetectKeyPhrases— Meaningful phrasesDetectPiiEntities— PII detectionClassifyDocument— Custom classification
3. Receive Insights:
{
"Sentiment": "POSITIVE",
"SentimentScore": {"Positive": 0.98, "Negative": 0.01},
"Entities": [
{"Text": "Amazon", "Type": "ORGANIZATION"},
{"Text": "Seattle", "Type": "LOCATION"}
]
}4. Use Results: Trigger workflows, store in databases, feed dashboards
Pricing & Free Tier
| Aspect | Details |
|---|---|
| Free Tier (first 12 months) | 50,000 units/month per eligible API (1 unit = 100 characters) |
| Standard Operations | $0.0001 per unit (100 characters) |
| Custom Models | Training: $3/hr · Inference: Async per unit / Real-time per second |
| PII Detection | $0.0001 per unit |
Cost Tip: 1 unit = 100 characters. Free tier covers ≈ 5 million characters/month. Note: Most text APIs have a 3-unit (300 character) minimum charge per request.
⚠️ Pricing Disclaimer: AWS pricing is subject to change. Always verify current pricing at the official Amazon Comprehend pricing page.
When to Use Comprehend
| Use | Don’t Use |
|---|---|
| Text sentiment analysis | Speech sentiment (use Transcribe + Comprehend) |
| Entity/keyphrase extraction | Translation (use Translate) |
| Document classification | Document data extraction (use Textract) |
| PII detection/redaction | Ultra-low-latency moderation requirements |
Comprehend Features by Use Case
| Use Case | Best Features |
|---|---|
| Customer Feedback | Sentiment, Targeted Sentiment, Key Phrases |
| Document Processing | Custom Classification, Entity Recognition, PII Detection |
| Social Media | Sentiment, Key Phrases, Syntax, Language Detection |
| Compliance | PII Detection, Redaction |
| Content Discovery | Topic Modeling, Key Phrase Extraction |
Sentiment Scores Example
{
"Sentiment": "MIXED",
"SentimentScore": {
"Positive": 0.65,
"Negative": 0.30,
"Neutral": 0.04,
"Mixed": 0.01
}
}Important Notes
- Language Support: Dominant language detection supports many languages; feature support (e.g. PII, sentiment) varies
- Async Operations: Available for large document collections
- Custom Models: Train on your own data for domain-specific accuracy
- PII Redaction: Can redact detected PII entities from text
TL;DR
- Comprehend = NLP API for text insights
- Features: Sentiment, entities, key phrases, PII detection, topics, language detection, custom models
- Free Tier: 5 million units/month for first 12 months (1 unit = 100 characters)
- Pricing: $0.0001 per unit ($1 per 1M characters)
- Best for: Customer feedback analysis, social media monitoring, document classification, compliance
- Works with: Transcribe (speech → text → insights), Textract (documents → text → insights)
Resources
Amazon Comprehend Official product page and overview.
Comprehend Documentation Complete API reference and guides.
Comprehend Pricing Detailed pricing breakdown.