Custom Classification using Amazon Comprehend
What is AWS Comprehend?
Comprehend is a AWS NLP service that allows users to gain insights from text data and build ML models.
Go to AWS Comprehend- https://aws.amazon.com/comprehend/
Steps to perform classification using Comprehend:
1. Creating the classifier
2. Putting data into correct format.
3. Training
4. Make predictions (inference)
Click on Custom Classification
Enter the name and select the classifier mode.
Let’s use the multi-class mode. Each line is a text and can belong to a single class. We will be using a movie review dataset like this one — http://ai.stanford.edu/~amaas/data/sentiment/
First column is the class and second column is the text we will use.
It will be uploaded to a S3 Bucket.
Enter the S3 paths for data input and output folders.
Create an access permission for training.
Create an Analysis job for the classifier
Once the analysis completed, the status will turn to “Completed”. Click on the classifier under its name.
Output files are saved in the link below.
Once you click on the tar.z file, you can extract the output files and get the json file to view the predictions.