Custom Text Classification using Amazon Comprehend

   Go back to the Task List

  « 3: Train the Model    5: Create Client »

4: Configure SageMaker Notebook

The workshop will use Amazon SageMaker Notebook as the client to call classifier endpoint to check if the news title text is Real or Fake. Before you launch the SageMaker Notebook, you create an IAM role which SageMaker Notebook will use to authorize call to the Amazon Comprehend.

  1. Goto the IAM Management console, click on the Roles menu in the left and then click on the Create role button.

    Amazon Comprehend

  2. On the next screen, select SageMaker as the service and click on the Next: Permissions button.

    Amazon Comprehend

  3. On the next screen, click on the Next: Tags button.

  4. On the next screen, click on the Next: Review button.

  5. On the next screen, type in dojosagemakerrole as the role name and click on the Create role button.

    Amazon Comprehend

  6. The role is created in no time. Open the dojosagemakerrole role details, remove AmazonSageMakerFullAccess policy and attach PowerUserAccess policy to the role.

    Amazon Comprehend

  7. The role is ready. Let’s launch the Notebook Instance next. Goto Amazon SageMaker console. Select Notebook instances in the left and then click on the Create notebook instance button.

    Amazon Comprehend

  8. On the next screen, type in dojonotebook as the notebook instance name, select dojosagemakerrole as the IAM role. Leave rest of the configuration as the default and click on the Create notebook instance button.

    Amazon Comprehend

  9. The notebook instance launch starts. Wait till the status changes to InService.

    Amazon Comprehend

  10. The notebook is ready. Let’s write client code for the text classification in the next step.