According Gartner, 85% of software buyers trust online reviews as much as personal recommendations. Customers provide feedback and reviews about products they have purchased through many channels, including review websites, supplier websites, sales calls, social media, and many others. The problem with the increasing volume of customer reviews across multiple channels is that it can be difficult for businesses to process and derive meaningful insights from the data using traditional methods. Machine learning (ML) can analyze large volumes of product reviews and identify patterns, sentiments, and topics discussed. With this information, companies can better understand customer preferences, pain points, and satisfaction levels. They can also use this information to improve products and services, identify trends, and take strategic actions that drive business growth. However, implementing ML can be challenging for companies that lack resources, such as ML professionals, data scientists, or artificial intelligence (ai) developers. With new features in Amazon SageMaker Canvas, business analysts can now use ML to derive insights from product reviews.
SageMaker Canvas is designed for the functional needs of business analysts using AWS without ML code for ad hoc analysis of tabular data. SageMaker Canvas is a visual point-and-click service that enables business analysts to generate accurate ML predictions without writing a single line of code or requiring ML expertise. You can use models to interactively make predictions and for batch scoring on massive data sets. SageMaker Canvas offers ready-to-use ai models and fully managed custom model solutions. For common ML use cases, you can use an out-of-the-box ai model to generate predictions with your data without any model training. For ML use cases specific to your business domain, you can train an ML model with your own data for custom prediction.
In this post, we demonstrate how to use the out-of-the-box sentiment analysis model and the custom text analysis model to derive insights from product reviews. In this use case, we have a set of synthesized product reviews that we want to analyze for opinions and classify the reviews by product type, to make it easier to draw patterns and trends that can help business stakeholders make decisions. better informed decisions. First, we describe the steps to determine review sentiment using the out-of-the-box sentiment analysis model. Then, we’ll walk you through the process of training a text analysis model to classify reviews by product type. Below we explain how to review the performance of the trained model. Finally, we explain how to use the trained model to make predictions.
Sentiment analysis is a ready-to-use natural language processing (NLP) model that analyzes text for sentiment. Sentiment analysis can be run for single line or batch predictions. The predicted feelings for each line of text are positive, negative, mixed, or neutral.
Text analysis allows you to classify text into two or more categories using custom models. In this post, we want to categorize product reviews based on product type. To train a custom text analytics model, simply provide a data set consisting of the text and associated categories in a CSV file. The data set requires a minimum of two categories and 125 rows of text per category. Once the model is trained, you can review the model’s performance and retrain it if necessary, before using it for predictions.
Previous requirements
Complete the following prerequisites:
- Have an AWS account.
- Set up the SageMaker canvas.
- Download the Sample product review data sets:
sample_product_reviews.csv
– Contains 2000 synthesized product reviews and is used for sentiment analysis and text analysis predictions.sample_product_reviews_training.csv
– Contains 600 synthesized product reviews and three product categories, and is intended for training text analysis models.
Analysis of feelings
First, use sentiment analysis to determine product review sentiment by completing the following steps.
- In the SageMaker console, click Canvas in the navigation pane, and then click Open canvas to open the SageMaker Canvas application.
- Click Ready-to-use models in the navigation pane, and then click Analysis of feelings.
- Click Batch predictionthen click Create data set.
- Provide a Data set name and click Create.
- Click Select files from your computer to import the
sample_product_reviews.csv
data set. - Click Create data set and review the data. The first column contains the reviews and is used for sentiment analysis. The second column contains the revision ID and is used for reference only.
- Click Create data set to complete the data loading process.
- In it Select data set for predictions view, select
sample_product_reviews.csv
and then click Generate predictions. - When batch prediction is complete, click View to see the predictions.
The Sentiment and Confidence columns provide the sentiment and confidence score, respectively. A confidence score is a statistical value between 0 and 100%, which shows the probability that the sentiment is correctly predicted.
- Click Download CSV to download the results to your computer.
Text analysis
In this section, we go over the steps to perform text analysis with a custom model: import the data, train the model, and then make predictions.
Import the data
First import the training data set. Complete the following steps:
- In Ready-to-use models page, click Create a custom model
- For Model nameenter a name (for example,
Product Reviews Analysis
). Click text analysis, then click Create. - About him Select tab, click Create data set to import the
sample_product_reviews_training.csv
data set. - Provide a Data set name and click Create.
- Click Create data set and review the data. The training data set contains a third column that describes the product category; The target column consists of three products: books, videos, and music.
- Click Create data set to complete the data loading process.
- About him Select data set page, select
sample_product_reviews_training.csv
and click Select data set.
Train the model
Next, configure the model to begin the training process.
- About him Build tab, in the Target column drop-down menu, click
product_category
as a training objective. - Click
product_review
like source. - Click Quick construction to start training the model.
For more information about the differences between express build and standard build, see Create a custom model.
When model training is complete, you can review the performance of the model before using it for prediction.
- About him Analyze , the confidence score of the model will be displayed. A confidence score indicates how confident a model is that its predictions are correct. About him General description tab, review the performance of each category.
- Click Punctuation to review knowledge about model accuracy.
- Click Advanced metrics to review the confusion matrix and F1 score.
Make predictions
To make a prediction with your custom model, complete the following steps:
- About him Predict tab, click Batch predictionthen click Manual.
- Click on the same data set,
sample_product_reviews.csv
that you used earlier for sentiment analysis, then click Generate predictions. - When batch prediction is complete, click View to see the predictions.
For custom model prediction, SageMaker Canvas takes some time to deploy the model for initial use. SageMaker Canvas automatically deprovisions the model if it is idle for 15 minutes to save costs.
He Prediction
(Category) and Confidence
The columns provide the predicted product categories and confidence scores, respectively.
- Highlight the completed job, select the three dots and click Discharge to download the results to your computer.
Clean
Click Sign off in the navigation pane to sign out of the SageMaker Canvas application to stop consuming Canvas session hours and free up all resources.
Conclusion
In this post, we demonstrate how you can use Amazon SageMaker Canvas to derive insights from product reviews without machine learning experience. First, it used an out-of-the-box sentiment analysis model to determine product review sentiments. He then used text analytics to train a custom model with the quick build process. Finally, it used the trained model to classify product reviews into product categories. All without writing a single line of code. We recommend that you repeat the text analysis process with the standard build process to compare model results and prediction confidence.
About the authors
Gavin Satur He is a Principal Solutions Architect at Amazon Web Services. He works with enterprise clients to create strategic, well-designed solutions and is passionate about automation. Outside of work, he enjoys family time, tennis, cooking, and traveling.
the chan is a Senior Solutions Architect at Amazon Web Services, based in Irvine, California. Les is passionate about working with enterprise clients on the adoption and implementation of technology solutions with the sole objective of driving clients’ business results. His experience spans application architecture, DevOps, serverless, and machine learning.
Aaqib Bickiya is a solutions architect at Amazon Web Services based in Southern California. He helps retail enterprise clients accelerate projects and implement new technologies. Aaqib’s focus areas include machine learning, serverless, analytics and communication services.