Amazon Comprehend: Natural Language Processing (NLP) & Custom Entity Extraction
Key Takeaways
Amazon Comprehend is a fully managed, serverless Natural Language Processing (NLP) service that uses machine learning to extract insights, sentiments, entities, and structural relationships from unstructured text without requiring custom ML model development.
Out of the box, Amazon Comprehend provides Named Entity Recognition (NER), Sentiment Analysis, Key Phrase Extraction, Dominant Language Detection, and Topic Modeling. For domain-specific workflows, it supports Custom Classification (labeling documents based on business taxonomy) and Custom Entity Recognition (extracting proprietary terms like policy numbers, parts codes, or legal clauses).
Main Discussion
Pre-Trained Capabilities vs. Custom Extensions
Pre-Trained Capabilities
Custom Extensions



Comprehend Capabilities Summary
| Capability | Model Type | How It Works | Representative Output / Use Case |
|---|---|---|---|
| Named Entity Recognition (NER) | Pre-trained | Identifies standard semantic categories automatically. | Flags "Zhang Wei" as PERSON, "AnyCompany LLC" as ORGANIZATION, and "July 31" as DATE. |
| Sentiment Analysis | Pre-trained | Analyzes emotional tone and outputs confidence scores across four emotional classes. | POSITIVE: 0.02, NEGATIVE: 0.88, NEUTRAL: 0.08, MIXED: 0.02. |
| Key Phrase Extraction | Pre-trained | Surfaces noun phrases and critical topical phrases. | Extracts "annual health plan maximum", "customer service escalation". |
| Dominant Language Detection | Pre-trained | Determines the primary RFC-5646 language code. | Identifies en (English), es (Spanish), fr (French) with confidence metrics. |
| Topic Modeling | Pre-trained (Async) | Uses Latent Dirichlet Allocation (LDA) to group large document collections into thematic clusters. | Groups 100,000 raw support tickets into 10 distinct underlying problem topics. |
| Custom Classification | Custom-trained | Maps documents into custom, user-defined business categories based on training examples in Amazon S3. | Automatically routes emails to Complaints, Billing Inquiry, or Technical Support. |
| Custom Entity Recognition | Custom-trained | Learns to detect proprietary terms, specific codes, or unique business entities from annotated samples. | Extracts insurance policy IDs (e.g., POL-9843-X) or part serial numbers. |
Custom Classification & Entity Recognition Pipeline
When standard pre-trained models do not capture business-specific jargon, Comprehend enables custom training workflows:
- Custom Document Classification: Accepts multi-class (mutually exclusive) or multi-label training data. Supported formats include plain text, PDF, Word documents, and images.
- Custom Entity Recognition: Uses entity lists or annotated documents to train Comprehend to recognize specialized patterns without writing regular expressions or complex rule engines.
Real-Time vs. Asynchronous Batch Analysis
| Analysis Mode | Latency & Interaction Profile | Supported File Modalities | Best Suited For |
|---|---|---|---|
| Real-Time Analysis (Synchronous) | Sub-second responses for interactive, single-document API calls. | Plain UTF-8 text strings. | Live chat sentiment scoring, real-time ticket triage, user submission filtering. |
| Asynchronous Batch Processing | Distributed batch processing jobs running against large pools of documents. | Plain text, PDF, DOCX, scanned document images stored in Amazon S3. | Nightly support ticket audits, regulatory document reviews, historical data warehouse analysis. |
Exam Guide
Exam Tips
- Core Service Purpose: Amazon Comprehend is the go-to AWS service for text-based NLP, sentiment analysis, topic modeling, and entity extraction on unstructured text.
- Pre-Trained vs. Custom Rules:
- If a question asks to detect standard entities (people, dates, locations, organizations) Use Pre-trained Named Entity Recognition (NER).
- If a question asks to extract proprietary business IDs (e.g., policy numbers, claim codes, internal product SKUs) Use Amazon Comprehend Custom Entity Recognition.
- If a question asks to route incoming support emails into specific business queues (e.g., billing, cancellation, technical support) Use Amazon Comprehend Custom Classification.
- Topic Modeling: Comprehend uses unsupervised topic modeling to organize large document collections into clusters based on shared themes.
- Serverless & Managed: Comprehend is fully serverless; you do not provision or manage underlying EC2 instances or GPU clusters.
Practice Test
Question 1
A customer service organization receives thousands of feedback emails daily in multiple languages. The organization wants an automated solution that analyzes incoming email text to identify the overall customer sentiment (Positive, Negative, Neutral) and extract referenced dates, locations, and company names without training or managing a custom machine learning model. Which AWS service should they use?
- A. Amazon Rekognition
- B. Amazon Comprehend
- C. Amazon Polly
- D. AWS Glue DataBrew
Correct Answer
- B. Amazon Comprehend
- Explanation: Amazon Comprehend is a fully managed NLP service that provides pre-trained APIs out of the box for sentiment analysis, dominant language detection, and Named Entity Recognition (NER) for standard categories such as dates, locations, and organizations.
Question 2
An insurance enterprise wants to automatically review legal claim documents to locate and extract custom policy numbers that follow a proprietary alphanumeric structure (POL-XXXXX). The solution must not require building or managing custom deep learning training scripts. Which approach meets these requirements?
- A. Use Amazon Rekognition Custom Labels
- B. Train an Amazon Comprehend Custom Entity Recognizer using annotated sample claim documents
- C. Deploy a linear regression model on Amazon SageMaker
- D. Configure an Amazon Kendra web crawler
Correct Answer
- B. Train an Amazon Comprehend Custom Entity Recognizer using annotated sample claim documents
- Explanation: Amazon Comprehend Custom Entity Recognition allows you to train a specialized entity extraction model using your own domain-specific training documents and annotations to reliably detect custom business entities, such as proprietary policy numbers.