AI as a Service
Serverless machine learning with AWS
Peter Elger, Eóin Shanaghy
  • MEAP began March 2019
  • Publication in October 2020 (estimated)
  • ISBN 9781617296154
  • 325 pages (estimated)
  • printed in black & white

Illustrates the full potential of AWS.

Maria Geminim
Companies everywhere are moving everyday business processes over to the cloud, and AI is increasingly being given the reins in these tasks. As this massive digital transformation continues, the combination of serverless computing and AI promises to become the de facto standard for business-to-consumer platform development—and developers who can design, develop, implement, and maintain these systems will be in high demand! AI as a Service is a practical handbook to building and implementing serverless AI applications, without bogging you down with a lot of theory. Instead, you’ll find easy-to-digest instruction and two complete hands-on serverless AI builds in this must-have guide!

About the Technology

In serverless computing, servers are replaced by cloud functions that are executed on demand, reducing—or even removing!—the need for managing complex infrastructures. With benefits including reduced operational costs and vendor dependencies, increased focus on functionality versus admin, and ease of management, it’s no wonder serverless computing is becoming the norm in business.

Artificial Intelligence (AI), a machine’s ability to learn and make predictions based on patterns it identifies, is already being leveraged by businesses around the world in areas like targeted product recommendations, financial forecasting and resource planning, customer service chatbots, healthcare diagnostics, data security, and more.

With the exciting combination of serverless computing and AI, software developers now have enormous power to improve their businesses’ existing systems and rapidly deploy new AI-enabled platforms. And to get on this fast-moving train, you don’t have to invest loads of time and effort in becoming a data scientist or AI expert, thanks to cloud platforms and the readily available off-the-shelf cloud-based AI services!

About the book

AI as a Service teaches you how to quickly harness the power of serverless computing and cloud-based AI services. After an introduction to the basics of this dynamic technology duo, you’ll dive right into your first hands-on serverless AI project: a system that can recognize images from arbitrary web pages. In it you’ll explore tools like Amazon Rekognition for image analysis and techniques like deployment of cloud infrastructure, a crawler service, and a simple API. When you’ve mastered the concepts and skills in that fun and interesting project, you’ll move on to building a serverless to-do application that employs cloud-based AI tools like AWS Transcribe and Polly for speech-to-text and text-to-speech functionality and Lex for creating interactive chatbots. When you’re finished with this essential book, you’ll have the skills to quickly build end-to-end serverless AI systems, making you indispensable as this rapidly emerging paradigm becomes the business standard!
Table of Contents detailed table of contents

Part 1: First steps

1. A Tale of Two Technologies

1.1 Cloud Landscape

1.2 What is Serverless?

1.3 The Need for Speed

1.3.1 The Early Days

1.3.2 The Unix Philosophy

1.3.3 Object Orientation and Patterns

1.3.4 Java, J2EE, .NET,

1.3.5 XML and SOA

1.3.6 Web Speed

1.3.7 Cloud Computing

1.3.8 Microservices (Re-Discovery)

1.3.9 Cloud Native Services

1.3.10 The Trend: Speed

1.4. What is AI?

1.4.1 History of AI

1.4.2 Real World AI

1.4.3 AI Services

1.4.4 AI and Machine Learning

1.4.5 Deep Learning

1.4.6 AI Challenges

1.5. The Democratization of Compute Power and Artificial Intelligence

1.6. Canonical AI as a Service architecture

1.6.1 Web Application

1.6.2 Realtime Services

1.6.3 Batch Services

1.6.4 Communication Services

1.6.5 Utility Services

1.6.6 AI Services

1.6.7 Data Services

1.6.8 Operational Support

1.6.9 Development Support

1.6.10 Off Platform

1.8. Realization on Amazon Web Services

1.9. Summary

2. Building a Serverless Image Recognition System Part 1

2.1. Our First System

2.2. Architecture

2.2.2 Synchronous Services

2.2.3 Asynchronous Services

2.2.4 Communication Services

2.2.5 AI Services

2.2.6 Data Services

2.2.7 Development Support and Operational Support

2.3. Getting Ready

2.3.1 DNS Domain and SSL/TLS Certificate

2.3.2 Setup Checklist

2.3.3 Get the Code

2.3.4 Setting Up Cloud Resources

2.4. Implementing the Asynchronous Services

2.4.1 Crawler Service

2.5. Summary

3. Building a Serverless Image Recognition System Part 2

3.1. Deploying the Asynchronous Services

3.1.1 Analysis Service

3.2. Implementing the Synchronous Services

3.2.1 UI Service

3.2.2 Front-end Service

3.3. Running the System

3.4. Removing the System

3.5. Summary

Part II Tools of the Trade

4. Build and Secure a Web Application the Serverless Way

4.1. The To Do List

4.2. Architecture

4.2.1 Web Application

4.2.2 Synchronous Services

4.2.3 Asynchronous Services

4.2.4 Communication Fabric

4.2.5 Utility Services

4.2.6 AI Services

4.2.7 Data Services

4.2.8 Development Support and Operational Support

4.3. Getting Ready

4.3.1 Get the Code

4.4. Step 1 The Basic Application

4.4.1 Resources

4.4.2 To-do Service

4.4.3 Front End

4.4.4 Deploying Step 1

4.5. Step 2 Securing with Cognito

4.5.1 Get the Code

4.5.2 User Service

4.5.3 To-do service

4.5.4 Front-end service

4.5.5 Deploying Step 2

4.6. Summary

5. Adding AI Interfaces to a Web Application

5.1. Step 3 Adding a Speech to Text Interface

5.1.1 Get the Code

5.1.2 Note Service

5.1.3 Front End Updates

5.1.4 Deploy Step 3

5.1.5 Test Step 3

5.2. Step 4 Adding Text to Speech

5.2.1 Get the Code

5.2.2 Schedule Service

5.2.3 Front End Updates

5.2.4 Deploy Step 4

5.2.5 Test Step 4

5.3. Step 5 Adding a Conversational Chat Bot Interface

5.3.1 Get the Code

5.3.2 Create the Bot

5.3.3 Front End Updates

5.3.4 Deploy Step 5

5.3.5 Test Step 5

5.4. Removing the System

5.5. Summary

6. How to be Effective with AI as a Service

6.1 Addressing the New Challenges of Serverless

6.1.1 Benefits and Challenges of Serverless

6.1.2 A Production-Grade Serverless Template

6.2 Establishing a Project Structure

6.2.1 The Source Repository - Monorepo or Polyrepo

6.2.2 Project Folder Structure

6.2.3 Get the Code

6.3 Continuous Deployment

6.3.1 Continuous Deployment Design

6.3.2 Implementing Continuous Deployment with AWS Services

6.4 Observability and Monitoring

6.5 Logs

6.5.1 Writing Structured Logs

6.5.2 Inspecting Log Output

6.5.3 Searching Logs using CloudWatch Logs Insights

6.6 Monitoring Service and Application Metrics

6.6.1 Service Metrics

6.6.2 Application Metrics

6.6.3 Using Metrics to Create Alarms

6.7 Using traces to make sense of distributed applications

6.7.1 Enabling X-Ray tracing

6.7.2 Exploring Traces and Maps

6.7.3 Advanced Tracing with Annotations and Custom Metrics

6.8 Summary

7. Applying AI to Existing Platforms

7.1. Integration Patterns for Serverless AI

7.1.1 Pattern 1 Synchronous API

7.1.2 Pattern 2 Asynchronous API

7.1.3 Pattern 3 VPN Stream In

7.1.4 Pattern 4 VPN Fully Connected Streaming

7.1.5 Which Pattern?

7.2. Improving identity verification with Textract

7.2.1 Get the Code

7.2.2 Text Analysis API

7.2.3 Client Code

7.2.4 Deploy the API

7.2.5 Test the API

7.2.6 Remove The API

7.3. An AI Enabled Data Processing Pipeline With Kinesis

7.3.1 Get the Code

7.3.2 Deploying the API

7.4. On the fly translation with Translate

7.5. Testing the Pipeline

7.6. Sentiment Analysis With Comprehend

7.7. Training a Custom Document Classifier

7.7.1 Create a Training Bucket

7.7.2 Upload Training Data

7.7.3 Create an IAM Role

7.7.4 Run Training

7.8. Using the Custom Classifier

7.9. Testing the Pipeline End to End

7.10. Removing the Pipeline

7.11. Benefits of Automation

7.12. Summary

Part III Bringing it all together

8. Gathering data at scale for real-world AI

8.1. Scenario: Finding Events and Speakers

8.1.1 Identifying data required

8.1.2 Sources of data

8.1.3 Preparing Data for Training

8.2. Gathering Data from the Web

8.3. Introduction to web Crawling

8.3.1 Typical Web Crawler Process

8.3.2 Web Crawler Architecture

8.3.3 Serverless Web Crawler Architecture

8.4. Implementing an Item Store

8.4.1 Get the Code

8.4.2 The Item Store Bucket

8.4.3 Deploying the Item Store

8.5. Creating a Frontier to Store and Manage URLs

8.5.1 Get the Code

8.5.2 The Frontier URL Database

8.5.3 Creating the Frontier API

8.5.4 Deploying and Testing the Frontier

8.6. Building the Fetcher to Retrieve and Parse Web Pages

8.6.1 Configuring and Controlling a Headless Browser

8.6.2 Capturing Page Output

8.6.3 Fetching Multiple Pages

8.6.4 Deploying and Testing the Fetcher

8.7. Determining the Crawl Space in a Strategy Service

8.8. Orchestrating the Crawler with a Scheduler

8.8.1 Grab the Code

8.8.2 Using Step Functions

8.8.3 Deploying and Testing the Scheduler

8.9. Summary

9. Extracting Value from Large Data Sets with AI

9.1 Using AI to Extract Significant Information from Web Pages

9.1.1 Understanding the Problem

9.1.2 Extending the Architecture

9.2 Understanding Comprehend Entity Recognition APIs

9.3 Preparing Data for Information Extraction

9.3.1 Get the Code

9.3.2 Creating an S3 Event Notification

9.3.3 Implementing the Preparation Handler

9.3.4 Adding Resilience with a Dead Letter Queue (DLQ)

9.3.5 Creating the DLQ and Retry Handler

9.3.6 Deploying and Testing the Preparation Service

9.4 Managing Throughput with Text Batches

9.4.1 Get the Code

9.4.2 Retrieving Batches of Text for Extraction

9.5 Asynchronous Named Entity Abstraction

9.5.1 Get the Code

9.5.2 Starting an Entity Recognition Job

9.6 Checking Entity Recognition Progress

9.7 Deploying and Testing Batch Entity Recognition

9.8 Persisting Recognition Results

9.9. Tieing it all Together

9.9.1 Orchestrating Entity Extraction

9.9.2 End-to-End Data Extraction Testing

9.9.3 Viewing Conference Data Extraction Results

9.10 Wrapping Up

9.11 Summary


A. AWS account setup and configuration

A.1 Set up an AWS Account

A.1.1 Providing your login credentials

A.1.2 Providing your payment details

A.1.3 Verifying your identity

A.1.4 Choosing your support plan

A.2 Signing In

A.3 Best Practice

A.4 AWS Command Line

A.4.1 Installing the AWS CLI on Linux

A.4.2 Installing the AWS CLI on MacOS

A.4.3 Installing the AWS CLI on other platforms

A.4.4 Configuring the Local AWS Environment

A.4.5 Checking the setup

B. Data Requirements for AWS Managed AI Service

C. Data Sources for AI Applications

C.1 Public Data Sets

C.2 Software Analytics and Logs

C.3 Human Data Gathering

C.4 Device Data

D. Setting up a DNS Domain and Certificate

D.1 Set up a Domain

D.1.1 Registering a Domain Name

D.1.2 Configuring your Hosted Zone

D.2 Set up a Certificate

D.2.1 Provisioning a new Certificate

E. Serverless Framework Under the Hood

E.1 Walkthrough

E.2 Cleanup

What's inside

  • Cloud AI from development to production
  • Applying cloud AI services to your existing platform
  • Understanding orchestration patterns for cloud AI systems
  • How to architect and build scalable, resilient data pipelines
  • Debugging and troubleshooting cloud AI services
  • Getting started immediately with serverless templates

About the reader

For software developers with intermediate skills in at least one programming language and a basic understanding of IP networking and HTTP protocol. Familiarity with cloud-based version control systems such as GitHub would be helpful. No prior knowledge of AI is necessary.

About the authors

Peter Elger is the founder and CEO of fourTheorem, a software solutions company providing expertise on architecture, development, DevOps, and machine learning. He is also the cofounder and CTO of two other companies: nearForm, a Node.js consultancy, and StitcherAds, a digital advertising platform. He is a regular conference speaker and coauthor of The Node Cookbook as well as several academic papers.

Eóin Shanaghy is the cofounder and CTO fourTheorem and the founder of Showpiper, a machine learning-driven video content marketing startup. He previously created real-time trading applications for Fortis Bank and developed Hewlett-Packard's enterprise application server as well as 3G network management systems for Ericsson and Arantech (now Netscout).

placing your order...

Don't refresh or navigate away from the page.
Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
print book $29.99 $49.99 pBook + eBook + liveBook
Additional shipping charges may apply
AI as a Service (print book) added to cart
continue shopping
go to cart

eBook $24.99 $39.99 3 formats + liveBook
AI as a Service (eBook) added to cart
continue shopping
go to cart

Prices displayed in rupees will be charged in USD when you check out.

FREE domestic shipping on three or more pBooks