287 26 15MB
English Pages [702] Year 2021
Mastering Voice Interfaces Creating Great Voice Apps for Real Users — Ann Thymé-Gobbel Charles Jankowski
Mastering Voice Interfaces Creating Great Voice Apps for Real Users
Ann Thymé-Gobbel Charles Jankowski
Mastering Voice Interfaces Ann Thymé-Gobbel Brisbane, CA, USA ISBN-13 (pbk): 978-1-4842-7004-2 https://doi.org/10.1007/978-1-4842-7005-9
Charles Jankowski Fremont, CA, USA ISBN-13 (electronic): 978-1-4842-7005-9
Copyright © 2021 by Ann Thymé-Gobbel, Charles Jankowski 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. Managing Director, Apress Media LLC: Welmoed Spahr Acquisitions Editor: Celestin Suresh John Development Editor: Matthew Moodie Coordinating Editor: Aditee Mirashi Cover designed by eStudioCalamar Cover image designed by Freepik (www.freepik.com) Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza, Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], 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. For information on translations, please e-mail [email protected]; for reprint, paperback, or audio rights, please e-mail [email protected]. Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales. Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book’s product page, located at www.apress.com/978-1-4842-7004-2. For more detailed information, please visit http://www.apress.com/source-code. Printed on acid-free paper
To all who strive to create better voice experiences—and all who want to use them.
Table of Contents About the Authors���������������������������������������������������������������������������������������������������xix About the Technical Reviewers������������������������������������������������������������������������������xxi Acknowledgments������������������������������������������������������������������������������������������������xxiii Introduction�����������������������������������������������������������������������������������������������������������xxv
Part I: Conversational Voice System Foundations��������������������������������� 1 Chapter 1: Say Hello to Voice Systems����������������������������������������������������������� 3 Voice-First, Voice-Only, and Conversational Everything���������������������������������������������������������������� 5 Claims About Voice Technology����������������������������������������������������������������������������������������������������� 7 Claim: Everyone Has a Smart Voice Device and Uses It All the Time��������������������������������������� 7 Claim: You Can Simply “Add Voice” to an Existing GUI or Touch Interface������������������������������� 8 Claim: Voice or Chatbot, Both Are Conversational So Basically the Same������������������������������� 9 Claim: I Speak the Language; What More Is There to VUI Design?������������������������������������������ 9 Claim: Every Voice Solution Needs a Strong Personality������������������������������������������������������� 10 Claim: Hire a Scriptwriter; They Can Write Conversations����������������������������������������������������� 10 Claim: Recognition Is a Solved Problem; It’s Basically Perfect Today������������������������������������ 11 Claim: AI Takes Care of Understanding What People Say������������������������������������������������������ 13 Claim: IVRs Are Irrelevant Today, Nothing to Be Learned from Them������������������������������������� 14 Claim: That Ship Has Sailed; Alexa Is the Winner������������������������������������������������������������������ 15 Claim: Everyone Needs a Voice Solution; Voice Is Great for Everything�������������������������������� 16 Introduction to Voice Technology Components��������������������������������������������������������������������������� 16 Speech-to-Text���������������������������������������������������������������������������������������������������������������������� 18 Natural Language Understanding������������������������������������������������������������������������������������������ 20 Dialog Management�������������������������������������������������������������������������������������������������������������� 21
v
Table of Contents
Natural Language Generation������������������������������������������������������������������������������������������������ 24 Text-to-Speech���������������������������������������������������������������������������������������������������������������������� 26 The House That Voice Built: The Phases of Voice Development Success������������������������������������ 29 Plan��������������������������������������������������������������������������������������������������������������������������������������� 31 Design����������������������������������������������������������������������������������������������������������������������������������� 33 Build�������������������������������������������������������������������������������������������������������������������������������������� 35 Test���������������������������������������������������������������������������������������������������������������������������������������� 36 Deploy and Assess����������������������������������������������������������������������������������������������������������������� 36 Iterate������������������������������������������������������������������������������������������������������������������������������������ 37 What Next?���������������������������������������������������������������������������������������������������������������������������������� 38 Summary������������������������������������������������������������������������������������������������������������������������������������ 39
Chapter 2: Keeping Voice in Mind����������������������������������������������������������������� 41 Why Voice Is Different����������������������������������������������������������������������������������������������������������������� 41 Hands-On: A Precoding Thought Experiment������������������������������������������������������������������������������ 44 Voice Dialog and Its Participants������������������������������������������������������������������������������������������������ 45 The Human: Spoken Natural Language��������������������������������������������������������������������������������� 46 The Computer: Voice Recognition and Interpretation������������������������������������������������������������ 54 Human-Computer Voice Dialog���������������������������������������������������������������������������������������������� 59 What’s Next?������������������������������������������������������������������������������������������������������������������������������� 66 Summary������������������������������������������������������������������������������������������������������������������������������������ 67
Chapter 3: Running a Voice App—and Noticing Issues�������������������������������� 69 Hands-On: Preparing the Restaurant Finder������������������������������������������������������������������������������� 69 Choosing Voice Platforms����������������������������������������������������������������������������������������������������������� 71 Hands-On: Implementing the Restaurant Finder������������������������������������������������������������������������� 72 Basic Setup��������������������������������������������������������������������������������������������������������������������������� 73 Step 1: Respond to an Invocation������������������������������������������������������������������������������������������ 73 Step 2: Specify What the User Says�������������������������������������������������������������������������������������� 74 Step 3: Specify What the VUI Says����������������������������������������������������������������������������������������� 74 Step 4: Connect Dialogflow to Actions on Google������������������������������������������������������������������ 75
vi
Table of Contents
Step 5: Test Your VUI�������������������������������������������������������������������������������������������������������������� 75 Step 6: Save, Export, or Import Your Work����������������������������������������������������������������������������� 78 Why We’re Using Actions on Google and Assistant��������������������������������������������������������������������� 79 Google’s Voice Development Ecosystem������������������������������������������������������������������������������������� 80 Actions on Google������������������������������������������������������������������������������������������������������������������ 81 The Pros and Cons of Relying on Tools��������������������������������������������������������������������������������������� 82 Hands-On: Making Changes�������������������������������������������������������������������������������������������������������� 84 Adding More Phrases with the Same Meaning��������������������������������������������������������������������� 86 Expanding Information Coverage������������������������������������������������������������������������������������������ 88 Adding Granularity����������������������������������������������������������������������������������������������������������������� 89 What’s Next?������������������������������������������������������������������������������������������������������������������������������� 92 Summary������������������������������������������������������������������������������������������������������������������������������������ 93
Part II: The Planning Phase: Requirements Discovery and High-Level Design Definition���������������������������������������������������� 95 Chapter 4: Define Through Discovery: Building What, How, and Why for Whom���������������������������������������������������������������������� 97 General Functionality: What Are You Building?���������������������������������������������������������������������������� 99 User Needs: Who’ll Use It and What Do They Want?����������������������������������������������������������������� 101 Demographics and Characteristics������������������������������������������������������������������������������������� 102 Engagement Patterns���������������������������������������������������������������������������������������������������������� 104 Mental Models and Domain Knowledge������������������������������������������������������������������������������ 105 Environment and State of Mind������������������������������������������������������������������������������������������� 106 From General to Detailed Functionality������������������������������������������������������������������������������������� 107 Step 1: Define the Core Features����������������������������������������������������������������������������������������� 108 Step 2: From Features to Intents and Slots������������������������������������������������������������������������� 110 Business Requirements: Why Are You Building It?�������������������������������������������������������������������� 117 General Purpose and Goal��������������������������������������������������������������������������������������������������� 118 Underlying Service and Existing Automation����������������������������������������������������������������������� 121 Branding and Terminology��������������������������������������������������������������������������������������������������� 122 Access and Availability�������������������������������������������������������������������������������������������������������� 124 Legal and Business Constraints������������������������������������������������������������������������������������������ 126 vii
Table of Contents
System Requirements: How Will You Build It?�������������������������������������������������������������������������� 129 Recognizer, Parser, and Interpreter������������������������������������������������������������������������������������� 130 External Data Sources��������������������������������������������������������������������������������������������������������� 133 Data Storage and Data Access�������������������������������������������������������������������������������������������� 133 Other System Concerns������������������������������������������������������������������������������������������������������� 134 What’s Next?����������������������������������������������������������������������������������������������������������������������������� 136 Summary���������������������������������������������������������������������������������������������������������������������������������� 136
Chapter 5: From Discovery to UX and UI: Tools of Voice Design����������������� 137 Where to Find Early User Data on Any Budget�������������������������������������������������������������������������� 137 Online Research and Crowdsourcing Options��������������������������������������������������������������������� 138 Dialog Participant Observation�������������������������������������������������������������������������������������������� 141 Focus Groups, Interviews, and Surveys������������������������������������������������������������������������������� 144 How Discovery Informs VUI Design Decisions��������������������������������������������������������������������������� 147 Discovery Informing Design: An Example���������������������������������������������������������������������������� 148 Dialog Manager Graph, Yes; Hierarchical Decision Tree, No������������������������������������������������ 153 Capturing and Documenting VUI Design����������������������������������������������������������������������������������� 155 Dialog Flows������������������������������������������������������������������������������������������������������������������������ 155 Sample Dialogs�������������������������������������������������������������������������������������������������������������������� 156 Detailed Design Specifications�������������������������������������������������������������������������������������������� 159 VUI Design Documentation Approaches������������������������������������������������������������������������������ 160 Prototyping and Testing Your Assumptions�������������������������������������������������������������������������� 166 Voice UX and Prototyping Approaches��������������������������������������������������������������������������������� 167 What’s Next?����������������������������������������������������������������������������������������������������������������������������� 170 Summary���������������������������������������������������������������������������������������������������������������������������������� 171
Part III: The Building Phase: Design-Informed Development������������� 173 Chapter 6: Applying Human “Rules of Dialog” to Reach Conversation Resolution��������������������������������������������������������������������������������� 175 Dialog Acts, Games, and Turns—and Grice������������������������������������������������������������������������������� 176 In-Depth: Reaching the End of a Dialog Through Grice’s Cooperative Principle������������������ 180
viii
Table of Contents
Question Answering������������������������������������������������������������������������������������������������������������������ 180 Building Out the Question Answering Example������������������������������������������������������������������� 181 In-Depth: Entities, Parameters, and Slots���������������������������������������������������������������������������� 190 Design Notes on Question Answering��������������������������������������������������������������������������������� 191 Action Requests������������������������������������������������������������������������������������������������������������������������ 194 Building Action Requests����������������������������������������������������������������������������������������������������� 195 Design Notes on Action Requests���������������������������������������������������������������������������������������� 196 Task Completion Requests�������������������������������������������������������������������������������������������������������� 198 Building Task Completion Example 1����������������������������������������������������������������������������������� 199 Building Task Completion Example 2����������������������������������������������������������������������������������� 201 Design Notes on Task Completion��������������������������������������������������������������������������������������� 207 Fully Specified Requests����������������������������������������������������������������������������������������������������������� 208 Single-Slot Requests����������������������������������������������������������������������������������������������������������� 209 Multi-slot Requests��