Book Image

AI Blueprints

By : Dr. Joshua Eckroth, Eric Schoen
Book Image

AI Blueprints

By: Dr. Joshua Eckroth, Eric Schoen

Overview of this book

AI Blueprints gives you a working framework and the techniques to build your own successful AI business applications. You’ll learn across six business scenarios how AI can solve critical challenges with state-of-the-art AI software libraries and a well thought out workflow. Along the way you’ll discover the practical techniques to build AI business applications from first design to full coding and deployment. The AI blueprints in this book solve key business scenarios. The first blueprint uses AI to find solutions for building plans for cloud computing that are on-time and under budget. The second blueprint involves an AI system that continuously monitors social media to gauge public feeling about a topic of interest - such as self-driving cars. You’ll learn how to approach AI business problems and apply blueprints that can ensure success. The next AI scenario shows you how to approach the problem of creating a recommendation engine and monitoring how those recommendations perform. The fourth blueprint shows you how to use deep learning to find your business logo in social media photos and assess how people interact with your products. Learn the practical techniques involved and how to apply these blueprints intelligently. The fifth blueprint is about how to best design a ‘trending now’ section on your website, much like the one we know from Twitter. The sixth blueprint shows how to create helpful chatbots so that an AI system can understand customers’ questions and answer them with relevant responses. This book continuously demonstrates a working framework and strategy for building AI business applications. Along the way, you’ll also learn how to prepare for future advances in AI. You’ll gain a workflow and a toolbox of patterns and techniques so that you can create your own smart code.
Table of Contents (14 chapters)
AI Blueprints
Foreword
Contributors
Preface
Other Books You May Enjoy
Index

Overview of the chapters


The projects detailed in chapters 2 through 7 showcase multiple AI use cases and techniques. In each chapter, the AI workflow is addressed in the context of the specific project. The reader is encouraged not only to practice with the techniques and learn new coding skills but also to critically consider how the AI workflow might apply to new situations that are beyond the scope of this book.

Chapter 2, A Blueprint for Planning Cloud Infrastructure, shows how AI can be used in a planning engine to provide suggestions for optimal allocation of cloud computing resources. Often, AI and ML require significant computational time for training or processing. Today, cloud computing is a cost-effective option for these large computing jobs. Of course, cloud computing carries a certain cost in money and time. Depending on the job, tasks may be run in parallel on multiple cloud instances, thus significantly reducing time, but possibly increasing costs depending on how long the tasks take to start up on each instance.

This chapter shows how to use the open source OptaPlanner constraint solver planning engine to create a plan for cloud computing resources. 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.

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 ML with the CoreNLP library. The sentiment data is then visualized with plotly.js in a dashboard view for real-time updates.

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.

Chapter 5, A Blueprint for Detecting Your Logo in Social Media, shows how to build a CNN to detect certain objects, such as products and 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. Then the Twitter and Reddit API codes from Chapter 3, A Blueprint for Making Sense of Feedback, are 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.

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. Using statistical models and anomaly detection algorithms, the code is developed with the Python library scikit-learn. Different approaches in ML are compared to address different use cases.

Chapter 7, A Blueprint for Understanding Queries and Generating Responses, explains how to use the Rasa Python library and Prolog to build two custom chatbots 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.

The final part of this book, Chapter 8, Preparing for Your Future and Surviving the Hype Cycle, examines the various highs and lows of interest in AL and ML over the last several decades. A case is made that AI has continued to improve and grow over all this time, but often the AI is behind the scenes or accepted as standard practice and thus not perceived as exciting. However, as long as a business case continues to exist for the AI solutions and the AI workflow is followed, the hype cycles should not impact the development of an effective solution. The chapter ends with advice on how to identify new approaches and advances in AI and how to decide whether or not these advances are relevant for real business need.