Amazon Comprehend
Cloud service · AWS · Updated

Amazon Comprehend

In short

Amazon Comprehend is a natural language processing (NLP) service that uses machine learning to uncover insights and relationships in text, enabling developers to easily integrate data analysis and language interpretation capabilities into their applications.

Cloud Services Hub →

11 key features of Amazon Comprehend

Amazon Comprehend is a comprehensive Natural Language Processing (NLP) service that offers entity recognition, sentiment analysis, language detection, key phrases extraction, text extraction from custom documents, and the ability to create custom classification models.

01
Natural Language Processing (NLP)

Amazon Comprehend uses advanced machine learning models to analyze text and understand its meaning, making it easier to extract insights, relationships, and sentiment.

02
Entity Recognition

Automatically identifies entities such as people, places, brands, or products, and labels them for easy analysis, helping enhance content organization and retrieval.

03
Sentiment Analysis

Determines the sentiment expressed in a body of text, classifying it as positive, negative, neutral, or mixed, which can be pivotal for customer feedback and social media monitoring.

04
Language Detection

Quickly identifies the language of the text from a broad range of languages, supporting multi-language applications and content analysis without language pre-specification.

05
Key Phrases Extraction

Extracts key phrases, or the most relevant terms from a piece of text, making it easier to understand the main points and summarizing content efficiently.

06
Text in Custom Documents

Enables the extraction and analysis of text from a variety of document formats, allowing for the processing of different types of written content, such as PDFs or Word documents.

07
Custom Classifications

Allows for the creation of custom text classification models tailored to specific needs, facilitating the categorization of text according to predefined labels or categories.

08
Targeted Sentiment

Determines sentiment for specific entities mentioned in a document, with each mention classified as positive, neutral, negative, or mixed.

09
Event Detection

Detects specific types of events and their related details in documents.

10
Flywheels

Flywheels help manage custom classification and custom entity recognition models.

11
AWS KMS Encryption

Works with AWS Key Management Service (AWS KMS) to provide enhanced encryption for your data.

Where Amazon Comprehend is used

Amazon Comprehend is used for sentiment analysis, entity recognition, language detection, key phrases extraction, and text classification, aiding businesses in understanding, organizing, and acting on large volumes of text data.

  1. 01
    Sentiment Analysis

    Amazon Comprehend can be utilized to analyze text documents or files stored in Amazon S3 to determine the overall sentiment expressed within them. This is particularly useful for understanding customer feedback on products, services, or brand sentiment on social media, allowing businesses to quickly identify and focus on positive or negative feedback for further action.

  2. 02
    Entity Recognition

    This functionality enables the extraction of entities such as persons, places, brands, or products from text. Businesses can leverage this for enhancing content personalization, improving search and discovery mechanisms, or for automating data entry processes by extracting relevant information from unstructured data.

  3. 03
    Language Detection

    Amazon Comprehend's language detection feature is capable of accurately identifying the language of the text documents. This is crucial for global businesses that operate across multiple regions, allowing them to route content to the appropriate language-speaking teams for further analysis, translation, or direct engagement.

  4. 04
    Key Phrases Extraction

    This use case involves extracting key phrases from text, making it easier to understand the main points or topics being discussed. Businesses can use this feature for content summarization, enhancing metadata for content categorization, or optimizing search engine marketing strategies by identifying relevant keywords.

  5. 05
    Text Classification

    Amazon Comprehend can classify text into predefined categories or classes, facilitating the automation of document sorting, email routing, or content moderation. This allows businesses to streamline operations by ensuring that the content is quickly and efficiently categorized without manual intervention.

How Amazon Comprehend is priced

Amazon Comprehend's pricing models include an On-Demand, pay-as-you-go model based on text volume and feature usage, alongside a specific, higher-priced model for medical text analysis.

On-Demand Pricing

Amazon Comprehend uses a pay-as-you-go pricing model based on the amount of text processed and features used. Prices vary for different functionalities, such as entity recognition, sentiment analysis, etc., and are measured in units of 100 characters of processed text.

Comprehend Medical

Separate pricing applies for Comprehend Medical, Amazon's dedicated service for medical text analysis. Costs are higher compared to standard features and are calculated based on the amount of text processed, aiming to provide in-depth medical insights.

Custom Model Training

Training custom classification and entity recognition models costs $3 per hour, billed by the second.

Custom Model Management

Custom model management costs $0.50 per month.

Provisioned Custom Inference

Synchronous custom classification and entity recognition endpoints cost $0.0005 per inference unit per second. Each inference unit provides 100 characters per second of throughput. Billing uses one-second increments with a 60-second minimum and continues until the endpoint is deleted, even when no documents are analyzed.

Topic Modeling

Topic modeling is charged by the total document size processed per job, with a flat charge for the first 100 MB and a per-MB charge above 100 MB.

Free Tier

The free tier provides 50,000 units of text per eligible API per month and five topic modeling jobs of up to 1 MB each. It is available to new and existing AWS customers for 12 months from their first Amazon Comprehend request. Custom model training, inference, and management are excluded.

Services Amazon Comprehend works with

Amazon S3Amazon S3

Amazon Comprehend can read documents stored in Amazon S3 for natural language processing.

Amazon CloudWatchAmazon CloudWatch

Amazon Comprehend integrates with Amazon CloudWatch for monitoring and logging of events and metrics.

AWS LambdaAWS Lambda

Amazon Comprehend can be used with AWS Lambda to create automated workflows, such as triggering data analysis upon file upload.

Amazon ConnectAmazon Connect

Amazon Comprehend provides natural language processing for Amazon Connect conversational analytics, helping identify sentiment in customer interactions.

Amazon EventBridgeAmazon EventBridge

Amazon Comprehend API calls recorded by AWS CloudTrail can trigger Amazon EventBridge rules. For example, a rule can route a custom-model creation request to a notification or processing workflow.

Amazon LexAmazon Lex

Amazon Comprehend powers sentiment analysis in Amazon Lex, allowing a bot to receive sentiment scores for user utterances. These scores can help a conversation flow respond differently when a user expresses frustration.

Amazon QuickSightAmazon QuickSight

Amazon Comprehend is available through action integrations in Amazon Quick Suite, the expanded offering that includes QuickSight. Its actions can classify individual documents using a custom model endpoint and extract key phrases from text.

Amazon SageMaker Ground TruthAmazon SageMaker Ground Truth

Amazon Comprehend integrates with Amazon SageMaker Ground Truth to label training documents for custom entity recognition. Annotators can mark domain-specific entities, such as product identifiers, to produce training annotations for a recognizer.

Amazon TextractAmazon Textract

Amazon Comprehend uses Amazon Textract to extract text and document structure from supported image and PDF inputs for custom classification and entity recognition. Document-reader settings control how extraction is performed, including whether to extract forms and tables.

Amazon TranslateAmazon Translate

Amazon Translate uses Amazon Comprehend to detect the source language when a translation request specifies automatic language detection. This lets callers translate text without supplying its source language.

Alternatives to Amazon Comprehend in other clouds

Azure

Azure Language in Foundry Tools

Amazon Comprehend and Azure Language in Foundry Tools both analyze text to detect languages, recognize entities, and identify sensitive information. Comprehend meters on-demand text analysis in 100-character units and offers medical text analysis through the separate Comprehend Medical service, while Azure Language meters usage by text records or feature-specific units and includes text analytics for health.

Compare fact by fact
Amazon ComprehendAzure Language in Foundry Tools
Text analysis billing units100-character unitsText records or feature-specific units
Medical text analysisSeparate Comprehend Medical serviceBuilt-in text analytics for health

What is Amazon Comprehend

3 min read

Amazon Comprehend is a natural language processing (NLP) service that uses machine learning to uncover insights and relationships in text. Launched by Amazon Web Services (AWS), this powerful tool is designed to read, comprehend, and analyze vast amounts of textual data, enabling developers and businesses to understand and use the information contained within documents, social media, webpages, and more, without the need for deep machine learning expertise.

One of the key features of Amazon Comprehend is its ability to perform sentiment analysis. This enables users to determine the sentiment expressed in a body of text, whether it's positive, negative, neutral, or mixed, making it an invaluable asset for businesses looking to gauge public opinion about products, services, or brand image. 

Additionally, Comprehend can be used for entity recognition, which involves identifying key elements such as locations, people, brands, or dates within a text, offering the potential to automate various data extraction tasks and enhance data analysis processes. Moreover, Amazon Comprehend supports language detection, capable of identifying the dominant language from a plethora of textual sources. This feature is particularly useful in today's global digital landscape, where data often spans multiple languages. 

The service also offers syntax analysis, dissecting texts to understand the roles played by words and their relationships to one another, providing deeper insights into the grammatical structure of sentences. Another significant capability of Amazon Comprehend is key phrase extraction, which identifies the main points in a body of text. This can dramatically improve content analysis and information retrieval, helping users quickly understand the essence of documents without reading them in their entirety. 

Additionally, the service includes the ability to detect personally identifiable information (PII), helping organizations protect privacy and comply with data protection regulations by identifying sensitive information within datasets. Amazon Comprehend is not just powerful but also highly accessible and easy to integrate into existing applications, thanks to its API-based interface. Users do not require machine learning expertise to leverage Comprehend's capabilities, as it offers pre-trained models that can instantly be applied to text. Furthermore, it can process thousands of documents in a multitude of languages, making it scalable to the needs of any project, from analyzing a few documents to processing millions of pages. 

For synchronous inference with custom classification and custom entity recognition models, you provision an endpoint with the throughput your application needs.

Amazon Comprehend supports synchronous processing for one document or a batch of up to 25 documents, and asynchronous jobs for large document sets.

Each asynchronous API operation has a requests-per-second quota per Region and account, and supports a maximum of 10 active jobs.

In conclusion, Amazon Comprehend stands out as a sophisticated, yet user-friendly service that democratizes the power of natural language processing. By providing detailed insights and understanding from unstructured text data, it enables enhanced decision-making, streamlined processes, and a deeper understanding of content for businesses and developers across diverse industries. Whether it's through sentiment analysis, entity recognition, or any of its other features, Amazon Comprehend is crucial for anyone looking to harness the potential of NLP in the modern data-driven landscape.

Concepts related to Amazon Comprehend

Amazon Comprehend exam questions

Real practice exam questions on Amazon Comprehend, with the correct answer and its explanation. Answer them with every option in the exam simulator.

AIB-C01

A contact center is planning two capabilities for a staff-training application. First, it must locate names, email addresses, and other supported personally identifiable information (PII) in English chat transcripts so the application can mask those spans. Second, it must compose new fictional customer-agent conversations from approved training scenarios. The company wants pretrained managed capabilities without developing custom models. Which recommendation meets these requirements and correctly distinguishes the AI approaches?

Show answerCORRECT ANSWER

Use Amazon Comprehend PII detection for locating sensitive text and an Amazon Bedrock text-generation model for composing fictional conversations. The first capability uses non-generative ML; the second uses generative AI.

Amazon Comprehend provides pretrained PII detection that identifies supported sensitive information and its locations in text, which the application can use for masking. A suitable text-generation model in Amazon Bedrock can compose fictional conversations from supplied scenarios. Both use machine learning within AI, but only the conversation-writing capability requires generative AI.

DVA-C03

A customer support dashboard sends up to 20 short, plain-text comments to an AWS Lambda function in a single request. The comments can be in different languages, and the request does not include language codes. Each comment is written in one language supported by the sentiment analysis API. The function must return a separate sentiment label and confidence scores for each comment in the same response. Which solution meets these requirements while minimizing the number of inference API calls?

Show answerCORRECT ANSWER

Use Amazon Comprehend BatchDetectDominantLanguage to identify the language of each comment. Group the comments by detected language, call BatchDetectSentiment once per group, and map the results back to the original comment positions.

BatchDetectDominantLanguage returns language results for each input document. BatchDetectSentiment accepts one language code per request and returns sentiment and confidence scores for each document. Grouping by language avoids making a separate sentiment request for every comment.

AIP-C01

A financial services company uses Amazon Comprehend to annotate English regulatory notices before supplying the notices and their annotations to a foundation model that generates exposure summaries. During a pilot, incorrect organization annotations cause false exposure statements, while missed organization mentions cause relevant exposures to be omitted. All returned annotations currently have confidence scores above 0.90, but analysts still find both problems.

The company has an independently labeled evaluation set covering its publishers and document formats. Before releasing a revised extraction configuration, the developer must demonstrate that organization annotations meet separate minimum precision and recall requirements. The original notices must remain available to the summarization model.

Which validation approach best meets these requirements?

Show answerCORRECT ANSWER

Compare extracted organization spans and labels with the independently labeled set, using a defined matching policy. Measure precision and recall separately, inspect results by publisher and format, and evaluate candidate confidence thresholds against both requirements. Release only a configuration that passes, while retaining the original notices alongside accepted annotations.

Comparison with labeled references exposes both incorrect annotations and missed mentions. Separate precision and recall measurements directly test the two requirements, and publisher- and format-level analysis can reveal concentrated failures. Threshold changes must be evaluated rather than assumed to improve both metrics. Preserving the original notices maintains context for the foundation model.

Practice Amazon Comprehend in a full exam

Questions on Amazon Comprehend in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

Learn Amazon Comprehend in lessons

16 short lessons on Amazon Comprehend in 7 certification courses.

and 10 more lessons

Open the lessons

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.