Book Image

Machine Learning with AWS

By : Jeffrey Jackovich, Ruze Richards
Book Image

Machine Learning with AWS

By: Jeffrey Jackovich, Ruze Richards

Overview of this book

<p>Machine Learning with AWS is the right place to start if you are a beginner interested in learning useful artificial intelligence (AI) and machine learning skills using Amazon Web Services (AWS), the most popular and powerful cloud platform. You will learn how to use AWS to transform your projects into apps that work at high speed and are highly scalable. From natural language processing (NLP) applications, such as language translation and understanding news articles and other text sources, to creating chatbots with both voice and text interfaces, you will learn all that there is to know about using AWS to your advantage. You will also understand how to process huge numbers of images fast and create machine learning models.</p> <p>By the end of this book, you will have developed the skills you need to efficiently use AWS in your machine learning and artificial intelligence projects.</p>
Table of Contents (9 chapters)
Machine Learning with AWS
Preface

Recursion and Parameters


Importing files one at a time is time-consuming, especially if you have many files in a folder that need to be imported. A simple solution is to use a recursive procedure. A recursive procedure is one that has the ability to call itself and saves you, as the user, from entering the same import command for each file.

Performing a recursive CLI command requires passing a parameter to the API. This sounds complicated, but it is incredibly easy. First, a parameter is simply a name or option that is passed to a program to affect the operation of the receiving program. In our case, the parameter is recursive, and the entire command to perform the recursive command is as follows:

aws s3 cp s3://myBucket . --recursive

With the command, is all of the s3 objects in a respective Bucket are copied to a specified directory:

Figure 1.30: Parameter List

Activity 1: Importing and Exporting the Data into S3 with the CLI

In this activity, we will be using the CLI to create a Bucket in S3 and import a second text file. Suppose that you are an entrepreneur and you are creating a chatbot. You have identified text documents that contain content that will allow your chatbot to interact with customers more effectively. Before the text documents can be parsed, they need to be uploaded to an S3 Bucket. Once they are in S3, further analysis will be possible. To ensure that this has happened correctly, you will need to have installed Python, have an environment set up, and have a user authenticated with the CLI:

  1. Configure the Command-Line Interface and verify that it is able to successfully connect to your AWS environment.

  2. Create a new S3 Bucket.

  3. Import a text file into the Bucket.

  4. Export the file from the Bucket and verify the exported objects.

Note

To refer to the detailed steps, go to the Appendix A at the end of this book on Page no. 192