AI as a Service

Book description

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
Cloud-based AI services can automate a variety of labor intensive business tasks in areas such as customer service, data analysis, and financial reporting. The secret is taking advantage of pre-built tools like Amazon Rekognition for image analysis or AWS Comprehend for natural language processing. That way, there's no need to build expensive custom software. 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 is a fast-paced guide to harnessing the power of cloud-based solutions. You'll learn to build real-world apps—such as chatbots and text-to-speech services—by stitching together cloud components. Work your way from small projects to large data-intensive applications.

What's Inside
  • Apply cloud AI services to existing platforms
  • Design and build scalable data pipelines
  • Debug and troubleshoot AI services
  • Start fast with serverless templates


About the Reader
For software developers familiar with cloud basics.

About the Authors
Peter Elger and Eóin Shanaghy are founders and CEO/CTO of fourTheorem, a software solutions company providing expertise on architecture, DevOps, and machine learning.

Quotes
A practical approach to real-life AI smartly based on a serverless approach. Enlightening!
- Alain Couniot, Sopra Steria Benelux

An excellent introduction to cloud-based AI services.
- Rob Pacheco, Vision Government Solutions

A great way to learn more about AI that would be incredibly helpful at any company. Absolutely recommended!
- Alex Gascon, CoverWallet

A must for anyone who wants to swiftly transition from academic machine learning to production ready machine learning using the cloud.
- Nirupam Sharma, Engine Group

Table of contents

  1. AI as a Service
  2. Copyright
  3. dedication
  4. contents
  5. front matter
    1. foreword
    2. preface
    3. acknowledgments
    4. about this book
      1. Who should read this book
      2. How this book is organized: a roadmap
      3. About the code
      4. liveBook discussion forum
    5. about the authors
    6. about the cover illustration
  6. Part 1. First steps
  7. 1 A tale of two technologies
    1. 1.1 Cloud landscape
    2. 1.2 What is Serverless?
    3. 1.3 The need for speed
      1. 1.3.1 The early days
      2. 1.3.2 The Unix philosophy
      3. 1.3.3 Object orientation and patterns
      4. 1.3.4 Java, J2EE, .NET,
      5. 1.3.5 XML and SOAXML (Extensible Markup Language)SOA (service-oriented architecture)
      6. 1.3.6 Web speed
      7. 1.3.7 Cloud computing
      8. 1.3.8 Microservices (rediscovery)
      9. 1.3.9 Cloud native services
      10. 1.3.10 The trend: speed
    4. 1.4 What is AI?
      1. 1.4.1 History of AI
      2. 1.4.2 Real world AI
      3. 1.4.3 AI services
      4. 1.4.4 AI and machine learning
      5. 1.4.5 Deep learning
      6. 1.4.6 AI challenges
    5. 1.5 The democratization of compute power and artificial intelligence
    6. 1.6 Canonical AI as a Service architecture
      1. 1.6.1 Web application
      2. 1.6.2 Realtime services
      3. 1.6.3 Batch services
      4. 1.6.4 Communication services
      5. 1.6.5 Utility services
      6. 1.6.6 AI services
      7. 1.6.7 Data services
      8. 1.6.8 Operational support
      9. 1.6.9 Development support
      10. 1.6.10 Off-platform
    7. 1.7 Realization on Amazon Web Services
    8. 1.8 Summary
  8. 2 Building a serverless image recognition system, part 1
    1. 2.1 Our first system
    2. 2.2 Architecture
      1. 2.2.1 Web application
      2. 2.2.2 Synchronous services
      3. 2.2.3 Asynchronous services
      4. 2.2.4 Communication services
      5. 2.2.5 AI services
      6. 2.2.6 Data services
      7. 2.2.7 Development support and operational support
    3. 2.3 Getting ready
      1. 2.3.1 DNS domain and SSL/TLS certificate
      2. 2.3.2 Setup checklist
      3. 2.3.3 Get the code
      4. 2.3.4 Setting up cloud resources
    4. 2.4 Implementing the asynchronous services
      1. 2.4.1 Crawler service
    5. Summary
  9. 3 Building a serverless image recognition system, part 2
    1. 3.1 Deploying the asynchronous services
      1. 3.1.1 Analysis service
    2. 3.2 Implementing the synchronous services
      1. 3.2.1 UI service
      2. 3.2.2 Front end service
    3. 3.3 Running the system
    4. 3.4 Removing the system
    5. Summary
  10. Part 2. Tools of the trade
  11. 4 Building and securing a web application the serverless way
    1. 4.1 The to-do list
    2. 4.2 Architecture
      1. 4.2.1 Web application
      2. 4.2.2 Synchronous services
      3. 4.2.3 Asynchronous services
      4. 4.2.4 Communication fabric
      5. 4.2.5 Utility services
      6. 4.2.6 AI services
      7. 4.2.7 Data services
      8. 4.2.8 Development support and operational support
    3. 4.3 Getting ready
      1. 4.3.1 Getting the code
    4. 4.4 Step 1: The basic application
      1. 4.4.1 Resources
      2. 4.4.2 To-do service
      3. 4.4.3 Front end
      4. 4.4.4 Deploying step 1
    5. 4.5 Step 2: Securing with Cognito
      1. 4.5.1 Getting the code
      2. 4.5.2 User service
      3. 4.5.3 To-do service
      4. 4.5.4 Front-end service
      5. 4.5.5 Deploying step 2
    6. Summary
  12. 5 Adding AI interfaces to a web application
    1. 5.1 Step 3: Adding a speech-to-text interface
      1. 5.1.1 Getting the code
      2. 5.1.2 Note service
      3. 5.1.3 Front-end updates
      4. 5.1.4 Deploying step 3
      5. 5.1.5 Testing step 3
    2. 5.2 Step 4: Adding text-to-speech
      1. 5.2.1 Getting the code
      2. 5.2.2 Schedule service
      3. 5.2.3 Front-end updates
      4. 5.2.4 Deploying step 4
      5. 5.2.5 Testing step 4
    3. 5.3 Step 5: Adding a conversational chatbot interface
      1. 5.3.1 Getting the code
      2. 5.3.2 Creating the bot
      3. 5.3.3 Front-end updates
      4. 5.3.4 Deploying step 5
      5. 5.3.5 Testing step 5
    4. 5.4 Removing the system
    5. Summary
  13. 6 How to be effective with AI as a Service
    1. 6.1 Addressing the new challenges of Serverless
      1. 6.1.1 Benefits and challenges of Serverless
      2. 6.1.2 A production-grade serverless template
    2. 6.2 Establishing a project structure
      1. 6.2.1 The source repository--monorepo or polyrepo
      2. 6.2.2 Project folder structure
      3. 6.2.3 Get the code
    3. 6.3 Continuous deployment
      1. 6.3.1 Continuous deployment design
      2. 6.3.2 Implementing continuous deployment with AWS services
    4. 6.4 Observability and monitoring
    5. 6.5 Logs
      1. 6.5.1 Writing structured logs
      2. 6.5.2 Inspecting log output
      3. 6.5.3 Searching logs using CloudWatch Logs Insights
    6. 6.6 Monitoring service and application metrics
      1. 6.6.1 Service metrics
      2. 6.6.2 Application metrics
      3. 6.6.3 Using metrics to create alarms
    7. 6.7 Using traces to make sense of distributed applications
      1. 6.7.1 Enabling X-Ray tracing
      2. 6.7.2 Exploring traces and maps
      3. 6.7.3 Advanced tracing with annotations and custom metrics
    8. Summary
  14. 7 Applying AI to existing platforms
    1. 7.1 Integration patterns for serverless AI
      1. 7.1.1 Pattern 1: Synchronous API
      2. 7.1.2 Pattern 2: Asynchronous API
      3. 7.1.3 Pattern 3: VPN Stream In
      4. 7.1.4 Pattern 4 VPN: Fully connected streaming
      5. 7.1.5 Which pattern?
    2. 7.2 Improving identity verification with Textract
      1. 7.2.1 Get the code
      2. 7.2.2 Text Analysis API
      3. 7.2.3 Client code
      4. 7.2.4 Deploy the API
      5. 7.2.5 Test the API
      6. 7.2.6 Remove the API
    3. 7.3 An AI-enabled data processing pipeline with Kinesis
      1. 7.3.1 Get the code
      2. 7.3.2 Deploying the API
    4. 7.4 On-the-fly translation with Translate
    5. 7.5 Testing the pipeline
    6. 7.6 Sentiment analysis with Comprehend
    7. 7.7 Training a custom document classifier
      1. 7.7.1 Create a training bucket
      2. 7.7.2 Upload training data
      3. 7.7.3 Create an IAM role
      4. 7.7.4 Run training
    8. 7.8 Using the custom classifier
    9. 7.9 Testing the pipeline end to end
    10. 7.10 Removing the pipeline
    11. 7.11 Benefits of automation
    12. Summary
  15. Part 3. Bringing it all together
  16. 8 Gathering data at scale for real-world AI
    1. 8.1 Scenario: Finding events and speakers
      1. 8.1.1 Identifying data required
      2. 8.1.2 Sources of data
      3. 8.1.3 Preparing data for training
    2. 8.2 Gathering data from the web
    3. 8.3 Introduction to web crawling
      1. 8.3.1 Typical web crawler process
      2. 8.3.2 Web crawler architecture
      3. 8.3.3 Serverless web crawler architecture
    4. 8.4 Implementing an item store
      1. 8.4.1 Getting the code
      2. 8.4.2 The item store bucket
      3. 8.4.3 Deploying the item store
    5. 8.5 Creating a frontier to store and manage URLs
      1. 8.5.1 Getting the code
      2. 8.5.2 The frontier URL database
      3. 8.5.3 Creating the frontier API
      4. 8.5.4 Deploying and testing the frontier
    6. 8.6 Building the fetcher to retrieve and parse web pages
      1. 8.6.1 Configuring and controlling a headless browser
      2. 8.6.2 Capturing page output
      3. 8.6.3 Fetching multiple pages
      4. 8.6.4 Deploying and testing the fetcher
    7. 8.7 Determining the crawl space in a strategy service
    8. 8.8 Orchestrating the crawler with a scheduler
      1. 8.8.1 Grabbing the code
      2. 8.8.2 Using Step Functions
      3. 8.8.3 Deploying and testing the scheduler
    9. Summary
  17. 9 Extracting value from large data sets with AI
    1. 9.1 Using AI to extract significant information from web pages
      1. 9.1.1 Understanding the problem
      2. 9.1.2 Extending the architecture
    2. 9.2 Understanding Comprehend’s entity recognition APIs
    3. 9.3 Preparing data for information extraction
      1. 9.3.1 Getting the code
      2. 9.3.2 Creating an S3 event notification
      3. 9.3.3 Implementing the preparation handler
      4. 9.3.4 Adding resilience with a dead letter queue (DLQ)
      5. 9.3.5 Creating the DLQ and retry handler
      6. 9.3.6 Deploying and testing the preparation service
    4. 9.4 Managing throughput with text batches
      1. 9.4.1 Getting the code
      2. 9.4.2 Retrieving batches of text for extraction
    5. 9.5 Asynchronous named entity abstraction
      1. 9.5.1 Get the code
      2. 9.5.2 Starting an entity recognition job
    6. 9.6 Checking entity recognition progress
    7. 9.7 Deploying and testing batch entity recognition
    8. 9.8 Persisting recognition results
    9. 9.9 Tying it all together
      1. 9.9.1 Orchestrating entity extraction
      2. 9.9.2 End-to-end data extraction testing
      3. 9.9.3 Viewing conference data extraction results
    10. 9.10 Wrapping up
    11. Summary
  18. Appendixes
  19. appendix A. AWS account setup and configuration
    1. A.1 Set up an AWS account
      1. A.1.1 Providing your login credentials
      2. A.1.2 Providing your payment details
      3. A.1.3 Verifying your identity
      4. A.1.4 Choosing your support plan
    2. A.2 Signing in
    3. A.3 Best practice
    4. A.4 AWS Command Line Interface
      1. A.4.1 Installing the AWS CLI on Linux
      2. A.4.2 Installing the AWS CLI on MacOS
      3. A.4.3 Installing the AWS CLI on other platforms
      4. A.4.4 Configuring the local AWS environment
      5. A.4.5 Checking the setup
  20. appendix B. Data requirements for AWS managed AI services
  21. appendix C. Data sources for AI applications
    1. C.1 Public data sets
    2. C.2 Software analytics and logs
    3. C.3 Human data gathering
    4. C.4 Device data
  22. appendix D. Setting up a DNS domain and certificate
    1. D.1 Setting up a domain
      1. D.1.1 Registering a domain name
      2. D.1.2 Configuring your hosted zone
    2. D.2 Settting up a certificate
      1. D.2.1 Provisioning a new certificate
  23. appendix E. Serverless Framework under the hood
    1. E.1 Walkthrough
    2. E.2 Cleanup
  24. index

Product information

  • Title: AI as a Service
  • Author(s): Eóin Shanaghy, Peter Elger
  • Release date: September 2020
  • Publisher(s): Manning Publications
  • ISBN: 9781617296154