
Understanding Meaning: Amazon Comprehend
Master Natural Language Processing (NLP). Learn how to extract sentiment, entities, and PII from raw text and specialized medical data.
Beyond the Keywords
Amazon Comprehend is a Natural Language Processing (NLP) service that uses machine learning to find insights and relationships in a body of text. Unlike a simple "Ctrl+F" search, Comprehend understands the structure and sentiment of what is written.
For the AWS Certified AI Practitioner exam, you must understand how Comprehend differs from Generative AI (it is Analytical, not Generative) and its specialized variations.
1. Core Competencies: The NLP Toolkit
Sentiment Analysis
Comprehend can tell you if a review or social media post is Positive, Negative, Neutral, or Mixed.
- Use Case: A customer service team automatically flagging "Negative" support tickets for immediate manager review.
Entity Recognition
It can find people, places, dates, and brand names in unstructured text.
- Use Case: An insurance company automatically pulling out "Date of Incident" and "Location" from a 10-page handwritten claim description.
Key Phrase Extraction
Identifies the "Main points" of a document.
- Use Case: A news site automatically generating tags (e.g., #Economics, #Breaking, #London) for an article.
PII Redaction
Comprehend can identify Personally Identifiable Information (PII) like social security numbers, credit card numbers, and home addresses, and "mask" or remove them.
- Use Case: Anonymizing customer data before sharing it with an external research group to ensure compliance with privacy laws.
2. Specialized Case: Amazon Comprehend Medical
In the medical world, words have very specific meanings. "Aspirin" isn't just an "Entity"; it's a "Medication."
Comprehend Medical is specifically trained to understand:
- Dosages: (500mg).
- Medical Conditions: (Type 2 Diabetes).
- Procedures: (MRI).
- Protected Health Information (PHI): Ensuring HIPAA compliance by identifying sensitive patient data.
3. Sentiment vs. Intent
Don't confuse Comprehend with Amazon Lex.
- Comprehend: Analyzes text to tell you how the person feels (Sentiment) or what the text contains (Entities).
- Lex: A service for building Conversational Bots (Chatbots).
4. Visualizing the NLP Pipeline
graph LR
subgraph Data_Source
A[Customer Email / Tweet]
end
subgraph Comprehend_Analysis
B[Language Detection]
C[Sentiment Analysis]
D[Entity Extraction: Names/Dates]
E[PII Redaction]
end
subgraph Operations
F[Route to Manager if Negative]
G[Populate Database Fields]
H[Clean Privacy-safe logs]
end
A --> B
B --> C & D & E
C --> F
D --> G
E --> H
5. Summary: High-Scale Text Analysis
If an exam question mentions "Finding patterns in reviews," "Identifying brand names in news," or "Redacting customer credit cards," the answer is Amazon Comprehend.
Exercise: Identify the NLP Task
A travel company has 1 million customer reviews. They want to know:
- Which hotels have the most "Negative" reviews?
- Which specific brand names (e.g., "Nike", "Starbucks") are mentioned most often in the reviews for their beach locations?
Which two Comprehend features satisfy these?
- A. Image Analysis and PII Redaction.
- B. Sentiment Analysis and Entity Recognition.
- C. Custom Labels and Translation.
- D. Text-to-Speech and Video Analysis.
The Answer is B! Sentiment for the "feeling" and Entity Recognition for the "Brand Names."
Knowledge Check
?Knowledge Check
A travel company wants to analyze 10,000 hotel reviews to identify which features guests mention most (e.g., 'Pool', 'Breakfast', 'Staff'). Which feature of Amazon Comprehend should they use?
What's Next?
We can see and we can read. Now, let’s learn to hear and speak. In our next lesson, we break down Amazon Transcribe and Amazon Polly.