Book Image

The Applied AI and Natural Language Processing Workshop

By : Krishna Sankar, Jeffrey Jackovich, Ruze Richards
Book Image

The Applied AI and Natural Language Processing Workshop

By: Krishna Sankar, Jeffrey Jackovich, Ruze Richards

Overview of this book

Are you fascinated with applications like Alexa and Siri and how they accurately process information within seconds before returning accurate results? Are you looking for a practical guide that will teach you how to build intelligent applications that can revolutionize the world of artificial intelligence? The Applied AI and NLP Workshop will take you on a practical journey where you will learn how to build artificial intelligence (AI) and natural language processing (NLP) applications with Amazon Web services (AWS). Starting with an introduction to AI and machine learning, this book will explain how Amazon S3, or Amazon Simple Storage Service, works. You’ll then integrate AI with AWS to build serverless services and use Amazon’s NLP service Comprehend to perform text analysis on a document. As you advance, the book will help you get to grips with topic modeling to extract and analyze common themes on a set of documents with unknown topics. You’ll also work with Amazon Lex to create and customize a chatbot for task automation and use Amazon Rekognition for detecting objects, scenes, and text in images. By the end of The Applied AI and NLP Workshop, you’ll be equipped with the knowledge and skills needed to build scalable intelligent applications with AWS.
Table of Contents (8 chapters)
Preface

The AWS CLI

The CLI is an open-source tool built on the AWS SDK for Python (Boto) to perform setups, determine whether calls work as intended, verify status information, and more. The CLI provides another access tool for all AWS services, including S3. Unlike the Management Console, the CLI can be automated via scripts.

To authenticate your AWS account to the CLI, you must create a configuration file to obtain your public key and secret key. Next, you will install and then configure the AWS CLI.

Exercise 1.03: Configuring the CLI

In this exercise, we will configure the CLI with our AWS access key ID and AWS secret access key. Follow these steps to complete the exercise:

  1. First, go to the AWS Management Console and then IAM. You might have to log in to the account. Then, click Users:
    Figure 1.23: The Management Console home page with the Users option highlighted

    Figure 1.23: The Management Console home page with the Users option highlighted

  2. In the upper-right corner of the signed-in AWS Management Console, click My Security Credentials:
    Figure 1.24: My Security Credentials

    Figure 1.24: My Security Credentials

  3. Next, click Continue to Security Credentials:
    Figure 1.25: Security Credentials

    Figure 1.25: Security Credentials

  4. Click the Access keys (access key ID and secret access key) option:
    Figure 1.26: Accessing key generation

    Figure 1.26: Accessing key generation

  5. Then, click Create New Access Key:
    Figure 1.27: Creating a new access key

    Figure 1.27: Creating a new access key

  6. Click Download Key File to download the key file:
    Figure 1.28: Downloading the key file

    Figure 1.28: Downloading the key file

    The rootkey.csv file that contains the keys will be downloaded. You can view the details by opening the file.

    Note

    Store the keys in a safe location. Protect your AWS account and never share, email, or store keys in a non-secure location. An AWS representative will never request your keys, so be vigilant when it comes to potential phishing scams.

  7. Open Command Prompt and type aws configure.
  8. You will be prompted for four input variables. Enter your information, then press Enter after each input:
    AWS Access Key ID
    AWS Secret Access Key 
    Default region 
    Default output format (json)
  9. The name is obtained in your console (Oregon is displayed here, but yours is determined by your unique location):
    Figure 1.29: Location search

    Figure 1.29: Location search

  10. The codes for regions are obtained from the following Available Regions list:
    Figure 1.30: List of available regions

    Figure 1.30: List of available regions

  11. The command Prompt's final input variable will look as follows.
    Then, press Enter:
    Figure 1.31: The last step in the AWS CLI configuration in Command Prompt

Figure 1.31: The last step in the AWS CLI configuration in Command Prompt

You can change the configuration anytime by entering the aws configure command.

In this exercise, you configured the security credentials for your AWS account. We will use these credentials to access the AWS APIs in the rest of the book.