What Is Amazon Comprehend? Pricing per Unit, Free Tier, Sentiment, Entities and PII, Python Tutorial and Comprehend Medical

Logeshwaran
—

Amazon Comprehend is AWS's natural language processing (NLP) service: you send it text (reviews, emails, support tickets, chat logs, documents) and it tells you what the text is about and how it feels, with no machine learning model to build. It finds entities (people, places, organizations, dates, products), key phrases, sentiment (positive, negative, neutral or mixed, overall or per entity), the language, personal data (PII) to redact, and toxic content; and with Comprehend Custom it learns your own categories and entity types. Pricing is per unit of 100 characters with a 3-unit minimum per request: $0.0001 per unit for the standard APIs (so 10,000 reviews of 550 characters cost $6), less above 10 million units a month; custom models cost $3 per training hour, $0.50 a month to keep, and $0.0005 per unit to run, or $0.0005 per second for a real-time endpoint, which is $1.80 an hour whether you use it or not. The free tier gives 50,000 units (5 million characters) per API per month for 12 months. Use Comprehend when you need fast, cheap, consistent analysis of a lot of text; use a large language model on Bedrock when you need open-ended understanding. Below: what Comprehend does and how it works, every feature and price with worked examples, a Python tutorial, PII redaction, custom classification, Comprehend Medical, the 2026 feature changes, Comprehend vs Textract, Bedrock models and Kendra, limits and fixes.

The furniture store had 2,000 online reviews, 5,000 support emails a month and no time to read them. The owner wanted three answers: what do customers complain about most, which emails need a person today, and could the delivery partner be sent ticket details without customers' phone numbers and addresses spilling everywhere. Jake suggested a spreadsheet with a column for "angry". Ethan pasted one long, unhappy review about a late sofa into the Comprehend console and pressed Analyze.

⚡ Quick Answer

• What it is: AWS's NLP API: entities, key phrases, sentiment, language, PII and toxicity, plus custom models. Explained.

• Price: $0.0001 per 100 characters (3-unit minimum per request); 10,000 short reviews cost about $6. Every rate.

• Free? 50,000 units (5 million characters) per API per month for 12 months. Free tier.

• Watch out: custom real-time endpoints bill $1.80 an hour until deleted; use async jobs where you can. Custom models.

Features · Worked costs · Python tutorial · PII redaction · Medical · 2026 changes · vs LLMs and others · Errors · FAQ.

Working with text on AWS? The cards below cover Textract, Bedrock, Lambda, Athena and billing alerts, the services you will most often pair with Comprehend.

🧭 NEW HERE? READ THESE FIRST

These five pages cover the pieces around a text analysis pipeline on AWS:

📌 Bookmark this; the price table, the worked costs and the Python examples are the parts you will come back for.

What is Amazon Comprehend?

Natural language processing is the branch of AI that lets software work with human language: spotting names and dates in a sentence, deciding whether a review is happy or angry, recognizing that an email is about a refund. Doing it yourself means collecting labeled text, training models and hosting them. Amazon Comprehend is AWS's managed version: pre-trained models behind a simple API, plus tools to train your own without machine learning expertise.

You send UTF-8 text, one document at a time, up to 25 at a time, or millions in a batch job from S3, and get back JSON: each entity with its type, position and confidence; the sentiment with a score for each class; the language code; the PII found and where. It is a fully managed, pay-per-use service, available in a dozen AWS Regions, with no servers to run.

What people use it for: analyzing customer reviews and survey answers, routing support emails and tickets, monitoring social media and brand mentions, redacting personal data before sharing or storing text, flagging toxic comments, tagging documents for search, extracting fields from contracts and claims (with Textract), and clinical text analysis with Comprehend Medical.

Jake: "So it reads the email and tells you it's angry."

Ethan: "It reads 5,000 emails and tells you which 200 are angry, that most of those mention 'delivery', and which ones contain someone's phone number. For a few dollars."

How Amazon Comprehend works

  1. Text arrives: from your app, a database, or files in S3 (one document per file, or one per line). Scanned documents go through Textract first to become text.
  2. You choose the analysis: an operation such as DetectSentiment, DetectEntities, DetectKeyPhrases, DetectPiiEntities or DetectToxicContent, or a custom model you trained.
  3. Real-time or batch: real-time calls return in well under a second, one document (or a batch of up to 25) at a time; asynchronous jobs process up to a million documents from S3 and write results back to S3.
  4. Comprehend returns JSON with labels, positions (character offsets) and a confidence score for each result.
  5. Your code acts on it: store sentiment with the review, route the ticket, mask the PII, or load results into a database and chart them with Athena and a dashboard.

As with every AWS AI service, the confidence scores are the control you have: route uncertain results to a person, and measure accuracy on a sample of your own text before trusting the numbers.

What is Amazon Comprehend used for?

  • Voice of the customer: sentiment and key phrases across reviews, surveys, app store comments and support chats, trended over time, so you see a problem the week it starts.
  • Support triage: a custom classifier routes tickets and emails to the right team, and negative sentiment pushes urgent ones to the top.
  • Privacy and compliance: finding and masking personal data in tickets, transcripts and logs before they are shared, stored long-term or used for analytics or AI training.
  • Content moderation: toxicity detection on comments, reviews and chat messages before they are published.
  • Document tagging and search: entities and key phrases as tags that make a document library searchable by person, company, place or product.
  • Contact center analytics: call transcripts from Transcribe analyzed for sentiment and topics; Amazon Connect's analytics features build on the same ideas.
  • Financial and legal documents: custom entities pull policy numbers, amounts and parties out of contracts and claims, after Textract turns them into text.
  • Healthcare: clinical notes analyzed with Comprehend Medical for conditions, medications and codes.

What it does not do: Comprehend does not write, summarize, translate or answer questions. For summaries and open questions, use a language model on Bedrock; for translation, Amazon Translate; for search over documents, a Bedrock knowledge base.

Amazon Comprehend features

FeatureAPIWhat it returnsLanguages
EntitiesDetectEntitiesPeople, places, organizations, dates, quantities, products, events, titlesAll 12
Key phrasesDetectKeyPhrasesThe main noun phrases ("late delivery", "gray sofa")All 12
SentimentDetectSentimentPositive, negative, neutral or mixed, with scoresAll 12
Targeted sentimentDetectTargetedSentimentSentiment for each entity ("sofa" positive, "delivery" negative)English
Language detectionDetectDominantLanguageThe main language and a confidence100+ languages
SyntaxDetectSyntaxEach word's part of speech6 European languages
PII detectionDetectPiiEntities, ContainsPiiEntitiesNames, addresses, phones, emails, card and account numbers, IDs, with positionsEnglish, Spanish
Toxicity detectionDetectToxicContentScores for profanity, hate speech, insults, harassment, sexual, violent and graphic contentEnglish
Custom classificationClassifyDocument, StartDocumentClassificationJobYour own categories (multi-class or multi-label)6 European languages; PDFs and Word in English
Custom entitiesDetectEntities with a custom modelYour own entity types (order numbers, product codes, policy IDs)6 European languages; PDFs and Word in English

The 12 languages for entities, key phrases and sentiment are English, Spanish, French, German, Italian, Portuguese, Arabic, Hindi, Japanese, Korean, and simplified and traditional Chinese. Syntax and custom models cover English, Spanish, French, German, Italian and Portuguese.

Built-in entity types: PERSON, LOCATION, ORGANIZATION, COMMERCIAL_ITEM (products and brands), EVENT, DATE, QUANTITY, TITLE (books, films, songs) and OTHER. PII types include NAME, ADDRESS, EMAIL, PHONE, SSN, CREDIT_DEBIT_NUMBER, BANK_ACCOUNT_NUMBER, PASSPORT_NUMBER, DRIVER_ID, DATE_TIME, IP_ADDRESS, USERNAME and PASSWORD, among others, including several country-specific ID types.

How to read sentiment: every result has four scores that add up to about 1: positive, negative, neutral and mixed. The label is simply the highest. A review with 0.48 positive and 0.45 negative is really "mixed", whatever the label says, so for dashboards it often works better to chart the scores (for example, the average negative score per week) than to count labels. Targeted sentiment goes further, scoring each thing mentioned, which is what tells you customers love the sofa and hate the delivery.

Amazon Comprehend pricing

Comprehend charges in units of 100 characters, with a minimum of 3 units (300 characters) per request. A 550-character review is 6 units; a 50-character tweet still costs 3. US East (N. Virginia) prices in October 2026:

What you useUp to 10M units a month10M to 50MOver 50M
Entities, key phrases, sentiment, targeted sentiment, language$0.0001 per unit$0.00005$0.000025
Syntax$0.00005$0.000025$0.0000125
Detect PII (find and locate)$0.0001$0.00005$0.000025, lower at very high volume
Contains PII (yes or no, with types)$0.000002Lower tiers at volume
Toxicity detection$0.0001$0.00005$0.000025 (to 100M), then $0.000005
Custom classification or entities: async inference$0.0005 per unit
Custom real-time endpoint$0.0005 per inference unit per second (60-second minimum), about $1.80 an hour per inference unit, until deleted
Custom model training$3 per hour, billed by the second
Custom model storage$0.50 per model per month
  • Per API: running sentiment, entities and key phrases on the same review is three requests, billed three times.
  • One inference unit on a custom endpoint handles 100 characters (or 2 documents) per second.
  • Comprehend Medical is priced separately, per 100 characters (see below).
  • Also on your bill: S3 storage for batch input and output, Lambda for real-time pipelines, and KMS if you encrypt with your own key.

Is Amazon Comprehend free? The free tier

For a year, for most uses. The Comprehend free tier gives 50,000 units (5 million characters) per API per month for 12 months from your first request, covering entities, key phrases, sentiment, targeted sentiment, syntax, language detection, PII detection and toxicity. That is roughly 8,000 reviews of 600 characters per API, every month, enough for most prototypes and many small businesses to run for a year without paying anything. Each API has its own allowance, so analyzing the same reviews for sentiment, entities and key phrases uses three separate 50,000-unit buckets, and the 3-unit minimum still applies inside the free tier: 50,000 units cover only 16,666 very short texts. Topic modeling (for existing users) includes five free jobs of up to 1 MB each. Custom Comprehend (custom classification and custom entities) has no free tier, so training and endpoints are billed from the start. Accounts created from July 15, 2025 can also spend Free Tier credits on Comprehend.

Worked examples: what Comprehend really costs

Example 1: the store's reviews. 2,000 reviews averaging 450 characters (5 units each) through sentiment, entities and key phrases: 2,000 x 5 x 3 APIs = 30,000 units x $0.0001 = $3.00, or $0 inside the free tier. The answer to "what do people complain about" came back in a minute: negative reviews mentioned "delivery" four times as often as any product.

Example 2: routing support email. 5,000 emails a month of about 1,500 characters (15 units) with a custom classifier (delivery, returns, billing, product question, other), run as a batch job every hour: 75,000 units x $0.0005 = $37.50, plus $0.50 model storage and a one-time training cost of about $3. About $38 a month.

Ethan: "Thirty-eight dollars a month, and the delivery team gets their emails without anyone sorting them."

Jake: "Why not just sort them the second they arrive?"

Ethan: "We could, with a real-time endpoint. That costs $1.80 an hour, all day, every day: about $1,300 a month to save each email waiting up to an hour."

Example 3: the real-time endpoint trap. One inference unit running all month: 2,592,000 seconds x $0.0005 = $1,296. Running it 12 hours a day halves that. For anything that can wait a few minutes, asynchronous jobs cost a fraction; for genuinely real-time needs, size the endpoint to your peak and delete it when not needed.

Example 4: PII screening before sharing tickets. The same 5,000 emails checked with ContainsPiiEntities first (75,000 units x $0.000002 = $0.15), then only the 3,000 that contain PII sent to DetectPiiEntities for redaction (45,000 units x $0.0001 = $4.50). $4.65 a month.

Example 5: social media monitoring at scale. 1 million posts a month, each under 300 characters, through sentiment: 1,000,000 x 3 units (the minimum) = 3 million units x $0.0001 = $300 a month. The 3-unit minimum matters here: short texts cost as much as 300-character ones, so batching never helps the price but sending only relevant posts does.

Example 6: a big batch. 50 million units of entity detection in one month: 10M x $0.0001 + 40M x $0.00005 = $3,000, about half the cost of paying the first-tier price throughout.

Try Comprehend in the console

  1. Sign in to the AWS console, choose a supported Region (US East, Oregon, Ireland, London, Frankfurt, Tokyo, Sydney and others), and open Amazon Comprehend.
  2. Choose Launch Amazon Comprehend, then Real-time analysis.
  3. Pick Built-in, paste up to a few thousand characters of your own text, and choose Analyze.
  4. Read the tabs: Entities, Key phrases, Language, PII, Sentiment, Targeted sentiment, Syntax and Toxicity, each with highlighted text and confidence scores.
  5. Expand Application integration to see the exact request and response JSON for your code.
  6. For batch work, use Analysis jobs to run a job over files in S3; for custom models, use Custom classification and Custom entity recognition.

Amazon Comprehend tutorial with Python

Install boto3, configure credentials with comprehend:Detect* permissions (the AWS managed ComprehendReadOnly policy works for experiments), and try the built-in APIs on a review:

import boto3

comprehend = boto3.client("comprehend", region_name="us-east-1")
review = ("The gray corner sofa is gorgeous and really comfortable, but delivery took "
          "three weeks and nobody answered my emails. Call me on 555-0142 before you try again.")

s = comprehend.detect_sentiment(Text=review, LanguageCode="en")
print(s["Sentiment"], {k: round(v, 2) for k, v in s["SentimentScore"].items()})   # MIXED ...

for e in comprehend.detect_entities(Text=review, LanguageCode="en")["Entities"]:
    print("entity:", e["Type"], e["Text"], round(e["Score"], 2))

for k in comprehend.detect_key_phrases(Text=review, LanguageCode="en")["KeyPhrases"]:
    print("phrase:", k["Text"])

ts = comprehend.detect_targeted_sentiment(Text=review, LanguageCode="en")
for entity in ts["Entities"]:
    m = entity["Mentions"][0]
    print("target:", m["Text"], m["MentionSentiment"]["Sentiment"])   # sofa POSITIVE, delivery NEGATIVE

Many short texts at once: the batch operations take up to 25 documents of up to 5 KB each per call, which cuts the number of API calls (though each document is still billed with its own 3-unit minimum):

reviews = load_reviews()            # your list of strings
for start in range(0, len(reviews), 25):
    chunk = reviews[start:start + 25]
    out = comprehend.batch_detect_sentiment(TextList=chunk, LanguageCode="en")
    for item in out["ResultList"]:
        save(start + item["Index"], item["Sentiment"], item["SentimentScore"])
    for err in out["ErrorList"]:
        print("failed:", start + err["Index"], err["ErrorCode"])

Millions of documents: put them in S3 (one per file or one per line) and start an asynchronous job such as start_sentiment_detection_job or start_entities_detection_job with an IAM role Comprehend can use to read the input and write the output. Each job handles up to a million documents and 5 GB, with up to 10 active jobs per API. A Lambda function can start a job on a schedule and another can load the results when they land.

Not sure of the language? Call detect_dominant_language first and pass its code to the other calls, so Spanish reviews are not analyzed as English and texts in unsupported languages are skipped instead of failing.

Detecting and redacting personal data (PII)

Support tickets, chat logs and call transcripts are full of personal data: names, phone numbers, addresses, emails, card numbers, bank accounts, passport and Social Security numbers, dates of birth, IP addresses. Comprehend finds them in English and Spanish text with two operations:

  • ContainsPiiEntities answers "does this text contain PII, and of which types?" for $0.000002 per unit, 50 times cheaper than locating it. Use it to screen.
  • DetectPiiEntities returns each item's type, confidence and character offsets, so your code can replace it with a mask such as [PHONE] or ****.
  • Batch redaction jobs (start_pii_entities_detection_job with mode ONLY_REDACTION) write redacted copies of whole S3 datasets, with the entity types and masking style you choose.
def redact(text):
    found = comprehend.detect_pii_entities(Text=text, LanguageCode="en")["Entities"]
    for e in sorted(found, key=lambda e: e["BeginOffset"], reverse=True):
        if e["Score"] >= 0.8:
            text = text[:e["BeginOffset"]] + "[" + e["Type"] + "]" + text[e["EndOffset"]:]
    return text

print(redact(review))   # ... Call me on [PHONE] before you try again.

The store's delivery partner now receives every ticket with names, phone numbers and addresses replaced by labels, while the full record stays in the store's own system. For scanned forms, run Textract first and map the PII offsets back to word positions to black out the image itself.

Custom classification and custom entities

The built-in models know general language; they do not know that "the cushion fabric pilled" is a quality complaint or that "SO-55821" is an order number. Comprehend Custom trains models on your examples without machine learning code:

  • Custom classification sorts documents into your categories: multi-class (each document gets one of 2 to 1,000 classes, such as delivery, returns, billing) or multi-label (each can get several of up to 100 labels). Train with a CSV of labeled examples, at least 50 documents per class in multi-class mode (more is better). Native document models can also classify PDFs, Word files and images directly, in English.
  • Custom entity recognition finds your own entity types (up to 25 per model), trained either from an entity list (a list of known product names, for example) or from annotated documents with at least 25 annotations per entity.
  • Running them: asynchronous jobs at $0.0005 per unit for batches, or a real-time endpoint with inference units at $0.0005 per IU per second. Endpoints bill until you delete them, so create them only for genuine real-time needs, and set a billing alert the day you do.
  • Flywheels manage the lifecycle: they store your training data, retrain new model versions as you add labeled data, compare their accuracy, and let you promote the best one.

Training costs $3 an hour and usually takes from minutes to a couple of hours, so a classifier often costs a few dollars to build. The evaluation report shows precision, recall and F1 per class; read it before deploying, and add examples for the weakest classes.

What is Amazon Comprehend Medical?

Comprehend Medical is a separate, HIPAA eligible service tuned for clinical text in English: doctors' notes, discharge summaries, pathology and radiology reports, trial protocols, patient messages. General NLP models stumble on medical language ("pt c/o SOB x3d, denies CP, on metformin 500mg BID"); Comprehend Medical is trained for it. Its main operation, DetectEntitiesV2, finds entities in seven categories:

  • MEDICAL_CONDITION: diagnoses, signs and symptoms, with attributes such as acuity (chronic, acute), body site and direction (left leg).
  • MEDICATION: brand and generic names, with dosage, strength, frequency, route, form, rate and duration.
  • TEST_TREATMENT_PROCEDURE: tests (with values and units), treatments and procedures.
  • ANATOMY: body systems and sites.
  • BEHAVIORAL_ENVIRONMENTAL_SOCIAL: tobacco, alcohol and recreational drug use, allergies, gender, race and ethnicity.
  • PROTECTED_HEALTH_INFORMATION: names, ages, addresses, phone numbers, emails, IDs and professions.
  • TIME_EXPRESSION: dates and times tied to a medication, condition, test or procedure.

The part that makes it clinically useful is traits: Comprehend Medical understands context, so "denies chest pain" marks chest pain with NEGATION, "mother had breast cancer" gets PERTAINS_TO_FAMILY, "rule out pneumonia" gets HYPOTHETICAL, and it distinguishes a SIGN the clinician observed from a SYMPTOM the patient reported. Without traits, a search for patients with chest pain would find every patient who said they did not have it.

Ontology linking maps the text to standard codes: InferICD10CM for diagnosis codes, InferRxNorm for medications and InferSNOMEDCT for clinical concepts, each returning ranked candidate codes with scores. DetectPHI finds only the protected health information, for de-identifying records before research or analytics.

import boto3

cm = boto3.client("comprehendmedical", region_name="us-east-1")
note = "Patient denies chest pain. Started metformin 500 mg twice daily for type 2 diabetes."

for e in cm.detect_entities_v2(Text=note)["Entities"]:
    traits = [t["Name"] for t in e.get("Traits", [])]
    attrs = [(a["Type"], a["Text"]) for a in e.get("Attributes", [])]
    print(e["Category"], e["Type"], e["Text"], traits, attrs)
# MEDICAL_CONDITION DX_NAME chest pain ['NEGATION', 'SYMPTOM'] []
# MEDICATION GENERIC_NAME metformin [] [('DOSAGE', '500 mg'), ('FREQUENCY', 'twice daily')]

codes = cm.infer_icd10_cm(Text="type 2 diabetes mellitus without complications")
print([(c["Code"], c["Description"]) for c in codes["Entities"][0]["ICD10CMConcepts"][:3]])

Comprehend Medical pricing is per 100-character unit with a 1-unit minimum per request. US East (N. Virginia) prices, for the first million units a month:

  • DetectEntities (medical entities): $0.01 per unit, falling to $0.005 and then $0.001 at volume.
  • DetectPHI: $0.0014 per unit, then $0.0005 and $0.00025.
  • InferICD10CM (diagnosis codes): $0.0005 per unit.
  • InferRxNorm (medication codes): $0.00025 per unit.
  • InferSNOMEDCT (clinical terms): $0.0075 per unit, then $0.00375 and $0.00075.

A 2,000-character clinic note through DetectEntities is 20 units, $0.20. A pilot of 1,000 patient charts of five pages at about 1,700 characters a page is 85,000 units: $850 for entity extraction. A production load of 35,000 charts a month (2,975,000 units) costs 1,000,000 x $0.01 + 1,000,000 x $0.005 + 975,000 x $0.001 = $15,975 a month. New users get a one-time free allowance of 85,000 units (8.5 million characters) in their first month. Medical entity detection costs 100 times the standard Comprehend rate, so use it for clinical text only, and the standard APIs for everything else.

Common uses: de-identifying records for research, helping coders find candidate ICD-10 codes (a person still assigns the final code), building patient timelines from notes, matching patients to clinical trial criteria, and turning free-text notes into structured data for analytics. It is a tool for processing records, not for making diagnoses, and its output should be reviewed by qualified people before it affects care or billing.

Building a review analytics dashboard

The store's weekly chart took an afternoon to build, with no servers:

  1. Export new reviews and emails each night to S3 as JSON lines, one document per line, with the date and product ID.
  2. A scheduled Lambda function starts asynchronous sentiment, key phrase and targeted sentiment jobs on the new files, and the custom classification job for the emails.
  3. When the jobs finish, another function reads the output files and writes one row per document (date, product, sentiment scores, top phrases, category) to a Parquet table in S3.
  4. Athena queries the table: average negative score by week, the most common phrases in negative reviews, complaints per category per product.
  5. A dashboard (Amazon Quick Sight, or any BI tool that reads Athena) shows the charts, refreshed every morning.

Total cost for the store: the Comprehend charges above, a few cents of Lambda and S3, and Athena queries that scan a few megabytes. The same design scales to millions of documents by changing nothing but the file count.

Real-time analysis with Lambda

For text that needs an answer the moment it arrives, such as a chat message to screen or a ticket to prioritize, call the built-in APIs from a Lambda function. They respond in a fraction of a second and cost the same per unit as batch jobs, with no endpoint to keep running:

import boto3

comprehend = boto3.client("comprehend")

def lambda_handler(event, context):
    text = event["body"][:4900]                      # stay under the 5 KB sentiment limit
    lang = comprehend.detect_dominant_language(Text=text)["Languages"][0]["LanguageCode"]
    if lang not in ("en", "es", "fr", "de", "it", "pt", "ar", "hi", "ja", "ko", "zh", "zh-TW"):
        return {"priority": "normal", "reason": "unsupported language " + lang}
    s = comprehend.detect_sentiment(Text=text, LanguageCode=lang)
    urgent = s["Sentiment"] == "NEGATIVE" and s["SentimentScore"]["Negative"] > 0.8
    return {"priority": "urgent" if urgent else "normal", "sentiment": s["Sentiment"]}

That function costs two requests per message (language and sentiment), so at least 6 units, $0.0006 per message after the free tier. If all your text is in one language, skip the language call and halve the cost. Only custom models need endpoints for real-time use; the built-in ones are always ready.

Comprehend vs Transcribe: Amazon Transcribe turns speech into text, and Comprehend analyzes text, so call centers usually chain them: Transcribe the recording, then run Comprehend for sentiment, key phrases and PII. Transcribe's Call Analytics mode also returns its own sentiment and redaction for calls, which can save the second step. Comprehend vs SageMaker: SageMaker is for building and hosting your own models; choose it when you need a model architecture or training process Comprehend Custom does not offer, and accept the extra work of running it.

Security and compliance

  • Encryption: traffic uses TLS; batch job input and output in S3 can be encrypted with your KMS keys, and custom models and endpoints support KMS encryption too.
  • Private networking: VPC interface endpoints let applications in private subnets call Comprehend, and batch jobs can run inside your VPC to reach private buckets.
  • Least privilege: grant only the Detect actions an application uses, and give batch jobs a dedicated data access role limited to their input and output prefixes.
  • IAM permissions for batch jobs come in two parts: the caller needs the Start action (for example comprehend:StartSentimentDetectionJob) plus iam:PassRole on the data access role, and that role must trust comprehend.amazonaws.com and allow s3:GetObject and s3:ListBucket on the input and s3:PutObject on the output. Missing PassRole is the most common reason a job will not start.
  • Compliance: Comprehend and Comprehend Medical are HIPAA eligible, so health data can be processed under a Business Associate Addendum.
  • Data use: set an AWS Organizations AI services opt-out policy if your text must not be used to improve AWS services.

Comprehend vs Macie for personal data: Amazon Macie scans objects stored in S3 and reports which buckets and files contain sensitive data, for data security teams. Comprehend detects and redacts PII in text your application sends, for processing pipelines. Many organizations use Macie to find where sensitive data lives and Comprehend to clean it as it flows.

2026 changes: topic modeling, events and prompt safety

Three Comprehend features are no longer available to new customers since April 30, 2026: topic modeling (grouping a document collection into themes), event detection (extracting events such as mergers or bankruptcies from news), and prompt safety classification (flagging unsafe prompts to AI applications). Accounts that used them in the previous 12 months keep access, and every other Comprehend feature is unaffected.

For new projects, the suggested routes are language models on Amazon Bedrock for topics and events (a prompt such as "list the main themes in these reviews" works well on a few thousand documents), and Amazon Bedrock Guardrails for prompt safety. Our list of AWS services and features retired in 2026 covers the rest of that announcement. Many older tutorials still show topic modeling as a Comprehend feature, so check the date before following one.

Comprehend vs Bedrock language models, Textract, Kendra and Lex

  • Comprehend vs a large language model on Bedrock: an LLM can do everything Comprehend does and much more (summaries, open questions, nuanced themes), from a prompt. Comprehend is cheaper and faster per document at volume, returns the same structured output every time with confidence scores and character offsets, needs no prompt engineering, and its PII detection is purpose-built. A good split: Comprehend for high-volume, repeatable labeling and redaction; an LLM for the questions that need reasoning, run on the subset Comprehend flags.
  • Comprehend vs Textract: Textract reads documents into text; Comprehend analyzes the text. Use them in sequence for scanned paperwork.
  • Comprehend vs Kendra: Kendra was AWS's enterprise search service and is closed to new customers in 2026; Bedrock Knowledge Bases (see our setup guide) now fill that role. Comprehend tags and analyzes text; it does not search or answer questions over it.
  • Comprehend vs Lex: Lex builds chatbots that understand what a user wants in a conversation; Comprehend analyzes text after the fact, such as the sentiment of finished chats.
  • Comprehend vs Rekognition and Polly: different senses. Rekognition analyzes images, Polly speaks text, Transcribe turns speech into text that Comprehend can then analyze.
  • Comprehend vs IBM Watson Natural Language Understanding, Azure AI Language and Google Cloud Natural Language: the same family of services, each with entities, sentiment, key phrases and custom classification, priced per text record or per character. Quality is close for mainstream languages; the deciding factors are which cloud your data lives in, which languages you need, and whether you need specialist features such as Comprehend's PII redaction jobs or Comprehend Medical.
  • Comprehend vs open-source NLP (spaCy, Hugging Face models): free per document and fully customizable, but you host, scale and maintain them. Comprehend wins when you want results this week with no infrastructure.

Is Comprehend still worth using in 2026? For its core jobs, yes: sentiment, entities, PII redaction and custom classification at scale are cheaper, faster and more predictable with Comprehend than with an LLM, and they keep working unchanged. For open-ended analysis, an LLM is the better tool.

Limits and quotas

  • Real-time document size: up to 100 KB for entities, key phrases and language detection; 5 KB for sentiment, targeted sentiment and syntax; 5 KB for custom entities; 10 KB for custom classification.
  • Batch calls: up to 25 documents of 5 KB each per request.
  • Asynchronous jobs: up to 1 MB per document (5 KB for sentiment), 5 GB in total and 1 million documents per job, with up to 10 active jobs per API.
  • Custom classification: 2 to 1,000 classes (multi-class) or 2 to 100 labels (multi-label).
  • Custom entities: up to 25 entity types per model; at least 25 annotations per entity for plain text.
  • Endpoints: up to 20 active endpoints and 200 inference units per Region per account, 50 IUs per endpoint; each IU handles 100 characters or 2 documents per second.

Common Amazon Comprehend errors and fixes

  • TextSizeLimitExceededException: the text is over the real-time limit (5 KB for sentiment, 100 KB for entities). Split long documents into chunks at sentence boundaries, or use an asynchronous job.
  • UnsupportedLanguageException: the language is not supported for that feature (PII and toxicity are English and Spanish or English only; targeted sentiment is English). Detect the language first and route accordingly.
  • InvalidRequestException with "invalid UTF-8": the text contains invalid characters or a different encoding; decode and clean it before sending.
  • ThrottlingException or TooManyRequestsException: real-time calls are throttled dynamically; retry with exponential backoff, use batch operations, and move bulk work to asynchronous jobs.
  • Async job fails with AccessDenied: the data access role cannot read the input S3 path, write the output path, or use the KMS key; check the role's trust policy allows comprehend.amazonaws.com.
  • ResourceUnavailableException on a custom endpoint: the endpoint is still creating or updating, or was deleted.
  • Custom classifier training fails: too few examples for a class (under 50 in multi-class CSV mode), labels with stray spaces or different cases, or a malformed CSV. Clean the labels and add examples.
  • Sentiment looks wrong: sarcasm, mixed reviews and domain language fool any model. Look at the MIXED class and the scores, use targeted sentiment to see which part is negative, and consider a custom classifier trained on your own labeled reviews.

Best practices and ways to cut the bill

  • Call only the APIs you need; each is billed separately.
  • Mind the 3-unit minimum: very short texts cost 300 characters each; filter out empty or irrelevant ones first.
  • Screen with ContainsPiiEntities before paying to locate PII.
  • Prefer asynchronous jobs to real-time endpoints for custom models, and delete endpoints you are not using.
  • Store results with the text so you never analyze the same document twice.
  • Measure accuracy on a labeled sample of your own text, and keep a person in the loop for decisions that affect customers.
  • Detect the language before analysis in multilingual data.
  • Encrypt and limit access to the S3 buckets that hold raw text, and set an AWS Organizations AI services opt-out policy if your content must not be used to improve the service.

Frequently asked questions

What is Amazon Comprehend?

An AWS natural language processing service that analyzes text for entities, key phrases, sentiment, language, personal data and toxic content, and can be trained to classify documents or find entity types of your own, with no machine learning code.

How much does Amazon Comprehend cost?

$0.0001 per unit of 100 characters for the standard APIs, with a 3-unit minimum per request, cheaper above 10 million units a month. Custom models cost $3 per training hour, $0.50 a month to store and $0.0005 per unit for batch inference.

Is Amazon Comprehend free?

For 12 months, up to 50,000 units (5 million characters) per API per month, counted from your first request. Custom classification and custom entities have no free tier.

What is a unit in Amazon Comprehend?

100 characters of text. Each request is billed for at least 3 units (300 characters), so a 150-character review costs the same as a 300-character one.

Can Amazon Comprehend do sentiment analysis?

Yes. DetectSentiment classifies text as positive, negative, neutral or mixed with a score for each, in 12 languages, and targeted sentiment gives the sentiment toward each entity mentioned, in English.

What languages does Amazon Comprehend support?

Entities, key phrases and sentiment work in English, Spanish, French, German, Italian, Portuguese, Arabic, Hindi, Japanese, Korean and Chinese (simplified and traditional). Language detection recognizes over 100 languages; PII detection supports English and Spanish.

How does Comprehend detect PII?

DetectPiiEntities finds names, addresses, phone numbers, emails, card and bank numbers, IDs and more, with their positions, so you can mask them; ContainsPiiEntities checks cheaply whether any are present. Batch jobs can write redacted copies of whole datasets.

What is the difference between Comprehend and Textract?

Textract extracts text, tables and fields from documents and images. Comprehend analyzes text that already exists, for meaning, sentiment and personal data. For scanned documents, use Textract first and Comprehend second.

What is Comprehend Medical?

A separate, HIPAA eligible service for clinical text that extracts medical conditions, medications, tests and treatments, detects protected health information, and maps terms to ICD-10-CM, RxNorm and SNOMED CT codes, priced per 100 characters.

Is Comprehend topic modeling still available?

Not to new customers. Topic modeling, event detection and prompt safety classification closed to new customers on April 30, 2026; accounts that used them in the prior 12 months keep access. New projects use Bedrock language models and Guardrails instead.

Should I use Comprehend or an LLM on Bedrock?

Comprehend for high-volume, repeatable tasks such as sentiment, entities, PII redaction and classification into fixed categories, where its lower cost and consistent output win. An LLM for summaries, open-ended questions and nuanced analysis, ideally on the subset Comprehend flags.

How do I use Amazon Comprehend in Python?

Create a boto3 client for comprehend and call detect_sentiment, detect_entities, detect_key_phrases or detect_pii_entities with Text and LanguageCode. For many documents, use the batch_ operations (25 per call) or asynchronous jobs on files in S3.

What is custom classification in Comprehend?

A model you train on your own labeled documents to sort text into your categories, such as support topics. It needs at least 50 examples per class in multi-class mode, costs $3 per training hour, and runs as batch jobs or on a real-time endpoint.

Why is my Comprehend bill high?

Usually a custom real-time endpoint left running (about $1.80 an hour per inference unit until deleted), many very short texts each billed at the 3-unit minimum, or the same documents analyzed repeatedly. Check Cost Explorer by usage type.

Is Amazon Comprehend accurate?

It is good on everyday business text in its supported languages and weaker on sarcasm, slang and specialist jargon. Measure it on a labeled sample of your own data, and train a custom classifier if the built-in results are not good enough.

Does Amazon Comprehend store my text?

It may store and use text it processes to provide and improve the service unless you opt out with an AWS Organizations AI services opt-out policy. Your source text and batch results stay in your own S3 buckets.

Can Comprehend detect toxic comments?

Yes. DetectToxicContent scores English text for profanity, hate speech, insults, harassment, sexual, violent and graphic content, so you can block or review comments before they appear, at $0.0001 per unit for the first 10 million units a month.

Is Amazon Comprehend an LLM?

No. Comprehend uses task-specific machine learning models for analysis such as sentiment, entities and PII, returning structured results with confidence scores. Large language models, which generate text, are available on Amazon Bedrock.

Can Amazon Comprehend summarize text?

No. Comprehend extracts and labels information but does not write summaries or answers. Use a language model on Amazon Bedrock for summaries, optionally on the documents Comprehend has tagged or filtered.

How much does Comprehend Medical cost?

Per 100 characters with a 1-unit minimum: $0.01 for medical entity detection for the first million units a month (falling to $0.001 at volume), $0.0014 for PHI detection, $0.0005 for ICD-10-CM, $0.00025 for RxNorm and $0.0075 for SNOMED CT.

Can I move a Comprehend custom model to another account?

Yes. The model owner adds a resource-based policy to the model version, and the other account copies it with the ImportModel operation, without retraining.

Which AWS Regions offer Comprehend?

Over a dozen, including US East (N. Virginia and Ohio), US West (Oregon), Canada, Europe (Ireland, London, Frankfurt), and Asia Pacific (Mumbai, Seoul, Singapore, Sydney, Tokyo), plus AWS GovCloud (US-West).

For readers preparing for an AWS certification

We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.

Exams that test this topic: AI Practitioner (AIF-C01) • Machine Learning Engineer – Associate (MLA-C02) • Cloud Practitioner.

Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:

1. Thousands of product reviews must be labeled positive, negative, neutral or mixed with no ML expertise. Which service fits?

Amazon Comprehend (DetectSentiment, or a batch sentiment job).

2. Support tickets must have names, phone numbers and addresses masked before sharing with a partner. Which feature fits?

Comprehend PII detection (DetectPiiEntities, or a PII redaction job).

3. Emails must be sorted into company-specific categories such as returns and billing. What should you use?

A Comprehend custom classifier, run as async jobs (or on an endpoint for real time).

4. Clinical notes must yield medications, dosages and ICD-10-CM codes. Which service fits?

Amazon Comprehend Medical (DetectEntitiesV2 and InferICD10CM).

5. A Comprehend custom endpoint costs money even with no traffic. Why, and what is the fix?

Endpoints bill per inference unit per second until deleted; delete it or use async jobs.

6. A team needs summaries and open-ended answers about documents. Is Comprehend the right tool?

No; use a foundation model on Amazon Bedrock. Comprehend extracts and labels but does not summarize.

7. Which service finds sensitive data in objects already stored across S3 buckets, rather than in text an app sends?

Amazon Macie.

Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.

πŸ“š ALSO READ

Where to go next, from Rekognition to Bedrock Knowledge Bases:

📌 Bookmark this; the price table, the worked costs and the Python examples are the parts you will come back for.

A month later, the owner had a weekly chart: sentiment by week, the top key phrases in negative reviews, and complaints by category from the classifier. "Delivery" fell from first to third place after the store switched couriers, and the chart showed it within days. The delivery team got their emails sorted every hour, and the partner got tickets with every phone number replaced by a label. The whole Comprehend bill was $42.65. Jake asked whether it could also tell him which customers would come back. "It can tell you who's happy," Ethan said. "Getting them back is still the sofa's job."

📌 If you keep one line from this page

Amazon Comprehend analyzes text for $0.0001 per 100 characters (3-unit minimum, 50,000 units free per API per month for a year): use it for sentiment, entities, key phrases, PII redaction and custom classification at scale, prefer batch jobs to always-on endpoints, and use a Bedrock language model for open-ended analysis.

Screen PII cheaply first · delete idle endpoints · Textract before Comprehend for scans.

Revision note. Written October 21, 2026. Prices are US East (N. Virginia) list prices on that date. We will update this page when Comprehend prices or features change.

Related