What this book covers
Chapter 1, The AI Workflow, introduces the AI workflow, which is a series of four steps in a mature process for building and deploying AI. This chapter also discusses the role of AI in context of a larger software system. The chapter ends with an introduction to each of the projects developed in Chapter 2, A Blueprint for Planning Cloud Infrastructure to Chapter 7, A Blueprint for Understanding Queries and Generating Responses.
Chapter 2, A Blueprint for Planning Cloud Infrastructure, shows how to use the open source OptaPlanner constraint solver planning engine to create a plan for cloud computing resources.
Given a time and money budget and a set of computing tasks to complete, this chapter develops a Java-based solution for the optimal number of cloud resources to complete the tasks in the shortest time and lowest budget. Benchmarks are detailed to show that the solution is accurate. Each step of the AI workflow is addressed to help readers prepare to deploy the solution.
Chapter 3, A Blueprint for Making Sense of Feedback, shows how to acquire feedback from customers and the general public about a company's products and services, and how to identify the sentiment, or general mood, of the feedback for particular products, services, or categories. The Twitter and Reddit APIs are demonstrated for acquiring feedback.
Two approaches are demonstrated for sentiment analysis: a dictionary-based approach and a method using machine learning with the CoreNLP
library. The sentiment data is then visualized with plotly.js
in a dashboard view for real-time updates. Each step of the AI workflow is addressed to help readers prepare to deploy the solution.
Chapter 4, A Blueprint for Recommending Products and Services, shows how to build and deploy a recommendation engine for products and services. Given a history of all user activity (purchases, clicks, ratings), a system is designed that can produce appropriate recommendations for individual users. An overview of the relevant mathematics is included, and the Python implicit
library is used for building the solution. A continuous evaluation methodology is detailed to ensure the recommender continues to provide appropriate recommendations after it is deployed. Each step of the AI workflow is addressed to help readers prepare to deploy the solution.
Chapter 5, A Blueprint for Detecting Your Logo in Social Media, shows how to build a convolutional neural network (CNN) to detect logos in other people's photos. Using the Python library TensorFlow
, readers are shown how to take an existing pre-trained object recognition model such as Xception and refine it for detecting specific objects using a small training set of images. We also demonstrate the use of YOLO and compare results.
Then the Twitter API code from Chapter 3, A Blueprint for Making Sense of Feedback is reused to acquire images from social media, and the detector is run on these images to pick out photos of interest. A short introduction to CNNs and deep learning is included. Each step of the AI workflow is addressed to help readers prepare to deploy the solution.
Chapter 6, A Blueprint for Discovering Trends and Recognizing Anomalies, explains how to discover and track trends on a blog, storefront, or social media platform, as well as recognizing anomalous events that defy the trends. Using statistical models and anomaly detection algorithms, code is developed with the Python library scikit-learn
. Different approaches are compared to address different use cases. Each step of the AI workflow is addressed to help readers prepare to deploy the solution.
Chapter 7, A Blueprint for Understanding Queries and Generating Responses, shows how to build and deploy an automated helpdesk chatbot. Using the Rasa Python library and Prolog coding, two custom chatbots are developed that examine the user's question and construct an appropriate answer using natural language generation. The Prolog code helps us develop a logical reasoning agent that is able to answer complex questions. Each step of the AI workflow is addressed to help readers prepare to deploy the solution.
Chapter 8, Preparing for Your Future and Surviving the Hype Cycle, examines the current state and near future of artificial intelligence. It examines the hype cycle and the dramatic shifts in popular interest in AI over the years and provides guidance for how to be successful in such unpredictable environments. The chapter includes advice for how to identify new approaches and advances in AI and how to decide whether or not these advances are relevant for real business needs.