Szymon Rozga
Port Washington, New York, USA
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the books product page, located at www.apress.com/978-1-4842-3539-3 . For more detailed information, please visit www.apress.com/source-code .
ISBN 978-1-4842-3539-3 e-ISBN 978-1-4842-3540-9
https://doi.org/10.1007/978-1-4842-3540-9
Library of Congress Control Number: 2018949897
Szymon Rozga 2018
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
Preface
In mid-2016, I started work on a fascinating project. A client wanted to have users with type 2 diabetes be able to get advice from an automated coach, in other words, a chat bot. It was a fascinating idea. I had many questions. Why would anyone want to have a natural language conversation with a machine? Is it possible to make this thing smart enough to accomplish its goals? How do you even begin creating a chat bot? Through which means are users supposed to interact with it? When the project ended, we quickly realized that the technologies we just utilized, natural language understanding, Microsofts Bot Framework, and custom machine learning models, could serve as the technical base for a wide array of natural language applications between users and computing systems. Natural language interfaces, after all, were all the rage. The Alexa-powered Echo Dot had just been released, and the general population was quickly becoming fascinated with the idea of communicating with digital assistants by talking to them. My friend and I jumped on the opportunity to become experts in this space.
We tried many of the different platforms such as Api.ai (now DialogFlow), Wit.ai, and Watson Conversation but decided to focus on Microsofts Bot Framework as we felt it best complemented the enterprise space. Chat bot startups sprung up across the landscape promising the best bot or bot platform. The field became saturated, and our customers started paying attention. Suddenly, I found myself talking to multiple clients a day. Initially, these were high-level mentorship sessions. What is a chat bot? How does it work? What channels does it work with? Does it learn by itself? Can it integrate with live chat?
Starting around mid-2017, these conversations slowly shifted from educating clients to scoping the development effort for all types of use cases. Clients were starting to apply the technology to solve their business problems. In the second half of 2017, while working on delivering multiple chat bot implementations, a colleague of mine connected me to the editors who would make this book happen. Taking on this project was an easy decision to make; it was a fascinating topic, it was a new space, and it had lots of possibilities. Being slightly on the navely optimistic side about a three-month olds sleep patterns, I jumped on the opportunity.
I decided to write the book in the same way I would mentor engineers on the topics. It is divided roughly into three sections. First, I introduce the topics of chat bots and machine learning (ML) in Chapters is a deep dive into Microsofts Language Understanding Intelligence Service (LUIS), which we will utilize to create natural language understanding models for our chat bot.
The second section is all about hands-on Bot Framework development. Chapter explores the ability to connect any channel to our chat bot via the Direct Line API. We marry Twilio Voice into the picture to create a chat bot we can talk to via a phone.
The third section addresses a few additional topics that are essential to chat bot development. Chapter we put all our newly gained knowledge to work by creating a simple Alexa skill using Amazons Alexa Skills Kit and then replicate the same experience using a Bot Framework bot.
The chat bot space is dynamic. During the development of this book, Facebook acquired Wit.ai and shifted its focus to natural language understanding, Google acquired Api.ai, LUIS changed user interfaces not once but twice, the Bot Framework was officially released and moved to Azure, QnA Maker was officially released, Alexas user interface changed after I had written all the content, and Microsoft announced tons of new features at Build 2018 (which luckily did not drastically change the topics treated in this book). We have reached a point where the subjects of this book are relatively stable. It is my hope that the content is essential to any developer looking to begin chat bot development using Microsofts Bot Framework.
This project has been a humbling experience and would not have been possible without a small group of people for whose support I am forever grateful. I would like to thank my wife Kim, without whose patience, kindness, support, and late-night help with editing I would have never completed the process. I would also like to thank Jeff Dodge for the collaboration on building our chat bot practice, Bob Familiar for introducing me to the Apress team, and BlueMetal for allowing me the room to work on this project. Big thanks to Matt, Jimmy, and Andrew, and my parents, Hanna and Krzysztof Rozga, for providing much needed moral support and words of encouragement during times when I felt I was white knuckling it. I would also like to acknowledge the Apress editors Natalie and Jessica for their support during the book writing process.
This book is dedicated to Teddy.
Szymon Rozga
June 1, 2018