Tutorial: Analyzing Insights from Customer Reviews with Amazon Comprehend - Amazon Comprehend

Tutorial: Analyzing Insights from Customer Reviews with Amazon Comprehend

This tutorial explains how to use Amazon Comprehend with Amazon Simple Storage Service, AWS Glue, Amazon Athena, and Amazon QuickSight to gain valuable insights into your documents. Amazon Comprehend can extract sentiment (the mood of a document) and entities (names of people, organizations, events, dates, products, places, quantities, and titles) from unstructured text.

For example, you can get actionable insights from customer reviews. In this tutorial, you analyze a sample dataset of customer reviews about a novel. You use Amazon Comprehend sentiment analysis to determine whether customers feel positive or negative about the novel. You also use Amazon Comprehend entities analysis to discover mentions of important entities, such as related novels or authors. After following this tutorial, you might discover that over 50% of the reviews are positive. You might also discover that customers are comparing authors and expressing interest in other classic novels.

In this tutorial, you accomplish the following:

  • Store a sample dataset of reviews in Amazon Simple Storage Service (Amazon S3). Amazon Simple Storage Service is an object storage service.

  • Use Amazon Comprehend to analyze the sentiment and entities in the review documents.

  • Use an AWS Glue crawler to store the results of the analysis in a database. AWS Glue is an extract, transform, and load (ETL) service that lets you catalog and clean your data for analytics.

  • Run Amazon Athena queries to clean your data. Amazon Athena is a serverless interactive query service.

  • Create visualizations with your data in Amazon QuickSight. Amazon QuickSight is a serverless business intelligence tool for extracting insights from your data.

The following diagram shows the workflow.


            Workflow diagram of the procedures in the tutorial.

Estimated time to complete this tutorial: 1 hour

Estimated cost: Some of the actions in this tutorial incur charges on your AWS account. For information about the charges for each of these services, see the following pricing pages.

Prerequisites

To complete this tutorial, you need the following:

  • An AWS account. If you don't have an AWS account, see the topic Step 1: Set up an AWS Account and Create an Administrator User in the Amazon Comprehend User Guide to set up a new account.

  • An AWS Identity and Access Management (IAM) user. We highly recommend that you use an IAM user to protect your root account. The root account has unrestricted access to AWS resources and billing information. Using an IAM user with restricted permissions limits how much access you have within your account. To learn how to set up an IAM user and group for your account, see the Getting Started tutorial in the IAM User Guide.

  • The following permissions policy attached to your IAM group or user. The policy grants your IAM user some of the permissions required to complete this tutorial. The next prerequisite describes the additional permissions you need.

    { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "comprehend:*", "s3:*", "quicksight:*", "iam:ListPolicies", "iam:CreatePolicy", "iam:GetRole", "iam:PassRole", "iam:ListRoles", "iam:CreateRole", "iam:AttachRolePolicy", "iam:ListAccountAliases", "iam:DetachRolePolicy", "iam:ListAttachedRolePolicies", "iam:GetPolicy", "iam:CreatePolicyVersion", "iam:DeletePolicyVersion", "iam:GetPolicyVersion", "iam:ListPolicyVersions", "iam:DeleteRole", "iam:ListEntitiesForPolicy", "ds:DescribeDirectories", "ds:CreateAlias", "ds:AuthorizeApplication", "ds:CheckAlias", "ds:DeleteDirectory", "ds:CreateIdentityPoolDirectory", "ds:DescribeTrusts", "ds:UnauthorizeApplication" ], "Resource": "*" } ] }

    Use the previous policy to create an IAM policy and attach it to your group or user. For information about creating an IAM policy, see Creating IAM policies in the IAM User Guide. For information about attaching an IAM policy, see Adding and removing IAM identity permissions in the IAM User Guide.

  • Managed policies attached to your IAM group or user. In addition to the previous policy, you must also attach the AWS managed policies AWSGlueConsoleFullAccess and AWSQuicksightAthenaAccess to your group or user. These managed policies give you permission to use AWS Glue, Amazon Athena, and Amazon QuickSight. For information about attaching an IAM policy, see Adding and removing IAM identity permissions in the IAM User Guide.