Using the AWS Console to Identify ML Services
The AWS Console provides a web-based interface to navigate, discover, and utilize AWS services for AI and ML. In this topic, we will explore two ways to use the Console to search ML services. Also, we will test an ML API with text data retrieved from a website.
Exercise 1.04: Navigating the AWS Management Console
In this exercise, we will navigate the AWS Management Console to locate ML services. Starting from the console, https://console.aws.amazon.com/console/, and only using console search features, let's navigate to the Amazon Lex (https://console.aws.amazon.com/lex/) service information page:
- Click https://console.aws.amazon.com/console/ to navigate to the AWS Console. You might have to log in to your AWS account. Then, click Services:
- Scroll down the page to view all the ML services. Then, click Amazon Lex. If Lex is not available at your location, you may consider switching to a different one.
- You will be redirected to the Amazon Lex home screen:
You will get a chance to work with Amazon Lex in Chapter 5, Using Speech with the Chatbot. For now, you can click the different Learn More links to get to know Lex's features a bit better. If you're itching to try it out right away, you may click Get Started.
Locating new AWS services is an essential skill for discovering more tools to provide solutions for your data projects. Now, let's test the API features of Amazon Comprehend.
Exercise 1.05: Testing the Amazon Comprehend API Features
Now that you have mastered S3, let's do a quick exercise that extends beyond storing a file and prepares you for the rest of the chapters. In this exercise, we will display text analysis output by using a partial text file input in the API explorer. Exploring an API is a skill that saves development time by making sure that the output is in the desired format for your project. Here, we will test the AWS Comprehend text analysis features.
Note
You will work with Comprehend in more detail in Chapter 4, Conversational Artificial Intelligence. We will also introduce the various AWS AI services and how to work with them. Here, we are doing an exercise to get you familiar with interacting with AWS in multiple ways.
Here is the user story: suppose that you are creating a chatbot. Before taking any steps, we first need to understand the business goal or statements or objectives. Then we need to select the relevant AWS services. For example, if our business goal is related to storage, we will go for the storage domain.
You have identified a business topic and the corresponding text documents with content that will allow the chatbot to make your business successful. Your next step is to identify/verify an AWS service to parse the text document for sentiment, language, key phrases, and entities. Amazon's AI services include AWS Comprehend, which does this very well.
Before investing time in writing a complete program, you need to test the AWS service's features via the AWS Management Console's interface. To ensure that this happens correctly, you will need to search the web for an article (written in English or Spanish) that contains the subject matter that you're interested in. You are aware that exploring APIs is a skill that can save development time by ensuring that the output is in the desired format for your project.
Now that we have the user story, let's carry out this task:
Similarly, to Exercise 1.01, Using the AWS Management Console to Create an S3 Bucket, you should already have done the account setup as detailed earlier in this chapter.
- Go to https://aws.amazon.com/ and click My Account and then AWS Management Console to open the AWS Management Console in a new browser tab:
- Click inside the search bar (under Find Services) in the AWS Management Console to search for Amazon Comprehend and you will be directed to the Amazon Comprehend Console screen as shown below:
- Type in amazon comp. As you type, Amazon will autocomplete and show the services that match the name typed in the search box:
- You will see the Amazon Comprehend landing page:
- Click Launch Amazon Comprehend and you will be directed to the Real-time analysis page. You can either use their built-in model or you can provide a custom one. We will use their built-in model:
You can input text and click Analyze. Let's copy a poem by Walt Whitman from http://www.gutenberg.org/cache/epub/1322/pg1322.txt and analyze it. Navigate to Topic modeling and Documentation. There is a GUI for exploring the API, and the right side provides real-time output for text input.
- Click Clear text to clear all default services. Navigate to open the following URL in a new tab: http://www.gutenberg.org/cache/epub/1322/pg1322.txt.
- Copy the first poem and paste it in the Input text box:
- Click Analyze to see the output:
- Review the Entities, Key phrases, and Language tabs and click the Sentiment tab to view the sentiment analysis:
- You can try other tabs. The language will show English with 99% confidence, and the Syntax tab is interesting and has lots of information. The Key phrases tab underlines the key phrases and lists them:
Try some other text – maybe movie comments from IMDb or comments from Amazon product reviews – and see how Amazon Comprehend handles sentiment. A cool thing to try would be sarcasm or even comments that change their polarity at the last minute, for example, "The book is really good, but the movie is dreadful" or "The screenplay and direction were done by people who couldn't fathom what was good about the novel," for interesting results.
The Utility of the AWS Console Interface to AI Services
The Comprehend console interface is very useful for testing ideas. As you will see in later chapters, we can use a similar interface to Amazon Textract to see if we can extract tables and other information from forms such as tax returns, company statements such as profit and loss or balance sheets, medical forms, and so forth.
While we need programming and development to develop a robotic process automation application, the console interface helps us to quickly test our business hypotheses. For example, maybe you want to automate a loan processing pipeline in which you are manually entering information from different documents. To see if any AWS AI services would fit the need, you can scan all the relevant documents and test them with the AWS Textract console. Later, in Chapter 5, Computer Vision and Image Processing, you will work with scanned documents and Amazon Textract.
You can also check how accurately the AWS built-in models can extract the required information. Maybe you will need custom models, maybe the documents are not easily understandable by a machine, but you can find them earlier and plan accordingly. Maybe your application involves medical record handling, which might require more sophisticated custom models. In fact, you can upload a custom model and test it in the console as well.