Conversational AI

Book description

Design, develop, and deploy human-like AI solutions that chat with your customers, solve their problems, and streamline your support services.

In Conversational AI, you will learn how to:

  • Pick the right AI assistant type and channel for your needs
  • Write dialog with intentional tone and specificity
  • Train your AI’s classifier from the ground up
  • Create question-and-direct-response AI assistants
  • Design and optimize a process flow for web and voice
  • Test your assistant’s accuracy and plan out improvements

Conversational AI: Chatbots that work teaches you to create the kind of AI-enabled assistants that are revolutionizing the customer service industry. You’ll learn to build effective conversational AI that can automate common inquiries and easily address your customers' most common problems. This engaging and entertaining book delivers the essential technical and creative skills for designing successful AI solutions, from coding process flows and training machine learning, to improving your written dialog.

About the Technology
Create AI-driven chatbots and other intelligent agents that humans actually enjoy talking to! Adding intelligence to automated response systems saves time and money for you and your customers. Conversational AI systems excel at routine tasks such as answering common questions, classifying issues, and routing customers to the appropriate human staff. This book will show you how to build effective, production-ready AI assistants.

About the Book
Conversational AI is a guide to creating AI-driven voice and text agents for customer support and other conversational tasks. This practical and entertaining book combines design theory with techniques for building and training AI systems. In it, you’ll learn how to find training data, assess performance, and write dialog that sounds human. You’ll go from building simple chatbots to designing the voice assistant for a complete call center.

What's Inside
  • Pick the right AI for your needs
  • Train your AI classifier
  • Create question-and-direct-response assistants
  • Design and optimize a process flow


About the Reader
For software developers. Examples use Watson Assistant and Python.

About the Author
Andrew R. Freed is a Master Inventor and Senior Technical Staff Member at IBM. He has worked in AI solutions since 2012.

Quotes
A thorough guide to the entire process of designing and implementing virtual assistants. Goes way beyond the technicalities.
- Maxim Volgin, KLM

All you need to know about building your own virtual assistant.
- Fernando Antonio da Silva Bernardino, Transferwise

Learn how to build virtual assistants in all platforms; IBM Watson, but also Azure and AWS.
- Jose Luis Perez, PolyhedraTech

All the steps for developing a real-world virtual assistant without overwhelming you with complex technical details.
- Sowmya Vajjala, National Research Council, Canada

Publisher resources

View/Submit Errata

Table of contents

  1. inside front cover
  2. Conversational AI
  3. Copyright
  4. dedication
  5. brief contents
  6. contents
  7. front matter
    1. preface
    2. acknowledgments
    3. 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. Other online resources
    4. about the author
    5. about the cover illustration
  8. Part 1. Foundations
  9. 1 Introduction to conversational AI
    1. 1.1 Introduction to AI assistants and their platforms
      1. 1.1.1 Types of AI assistants
      2. 1.1.2 A snapshot of AI assistant platforms
    2. 1.2 Primary use cases for AI assistant technology
      1. 1.2.1 Self-service assistant
      2. 1.2.2 Agent assist
      3. 1.2.3 Classification and routing
    3. 1.3 Follow along with this book
      1. 1.3.1 What you need to create your assistant
      2. 1.3.2 Useful spreadsheet software
      3. 1.3.3 Recommended programming language and code repository
      4. Summary
  10. 2 Building your first conversational AI
    1. 2.1 Building a conversational AI for Fictitious Inc.
    2. 2.2 What’s the user’s intent?
      1. 2.2.1 What’s an utterance?
      2. 2.2.2 What’s a response?
      3. 2.2.3 How does the assistant understand what the user means?
      4. 2.2.4 Why machine learning?
      5. 2.2.5 What’s an intent?
      6. 2.2.6 What’s an entity?
      7. 2.2.7 Combining intents and entities
      8. 2.2.8 intents to the Fictitious Inc. assistant
    3. 2.3 Responding to the user
      1. 2.3.1 Simple question-and-answer responses
      2. 2.3.2 Contextualizing a response by using entities
      3. 2.3.3 An alternative way to provide contextual responses
      4. 2.3.4 Responding with a process flow
    4. 2.4 Other useful responses
      1. 2.4.1 Detecting low confidence
      2. 2.4.2 Counting misunderstandings
      3. 2.4.3 Implementing confidence detection and the two-strikes rule
    5. 2.5 Try to build this conversational AI yourself
    6. Summary
  11. Part 2. Designing for success
  12. 3 Designing effective processes
    1. 3.1 What processes will the assistant handle?
      1. 3.1.1 Designing for the most common user needs
      2. 3.1.2 Assembling a plan and a dream team
      3. 3.1.3 Managing the design process
      4. 3.1.4 Cross-cutting design aspects
    2. 3.2 Choosing the channel to implement first
      1. 3.2.1 How users receive information in voice and web
      2. 3.2.2 How the assistant receives information in voice and web
      3. Summary
  13. 4 Designing effective dialogue
    1. 4.1 Writing dialogue
      1. 4.1.1 Take a conversational tone
      2. 4.1.2 Don’t repeat yourself (much)
      3. 4.1.3 Acknowledge the user
    2. 4.2 Asking questions
    3. 4.3 What if the assistant doesn’t understand?
      1. 4.3.1 Reprompting
      2. 4.3.2 Disambiguation
      3. 4.3.3 Escalation
      4. Summary
  14. 5 Building a successful AI assistant
    1. 5.1 AI assistant use cases
    2. 5.2 Conversational AI success metrics
      1. 5.2.1 Containment
      2. 5.2.2 Time to resolution
      3. 5.2.3 Net promoter score
      4. 5.2.4 Coverage
      5. 5.2.5 Instrumenting your conversational AI
    3. 5.3 Command interpreter success metrics
      1. 5.3.1 Usage
      2. 5.3.2 Stickiness
      3. 5.3.3 Instrumenting your command interpreter
    4. 5.4 Event classifier success metrics
      1. 5.4.1 Time to resolution
      2. 5.4.2 Number of hand-offs
      3. 5.4.3 Other customer satisfaction metrics
      4. 5.4.4 Instrumenting your classifier
    5. Summary
  15. Part 3. Training and testing
  16. 6 Training your assistant
    1. 6.1 Training an AI assistant
    2. 6.2 Finding training data
      1. 6.2.1 Production logs
      2. 6.2.2 A mock user interface
      3. 6.2.3 Subject-matter experts
      4. 6.2.4 Organizing training data into intents
    3. 6.3 Assessing whether you have the right training data
      1. 6.3.1 Training data variety
      2. 6.3.2 Training data volume
      3. 6.3.3 Training data veracity
      4. Summary
  17. 7 How accurate is your assistant?
    1. 7.1 Testing an AI assistant for accuracy
      1. 7.1.1 Testing a single utterance
      2. 7.1.2 Testing multiple utterances
      3. 7.1.3 Selecting a test data set
    2. 7.2 Comparing testing methodologies
      1. 7.2.1 Blind testing
      2. 7.2.2 k-folds cross-validation test
    3. 7.3 Selecting the right accuracy metric for the job
    4. Summary
  18. 8 Testing your dialogue flows
    1. 8.1 Functionally testing a dialogue flow
      1. 8.1.1 Manually testing a conversation flow
      2. 8.1.2 Automating a conversation flow test
      3. 8.1.3 Testing the dialogue flowchart
      4. 8.1.4 Testing the unexpected error paths
    2. 8.2 Nonfunctionally testing a dialogue flow
      1. 8.2.1 User experience testing
      2. 8.2.2 Load testing
      3. Summary
  19. Part 4. Maintenance
  20. 9 Deployment and management
    1. 9.1 Where to store your code
      1. 9.1.1 Taking the Wild West approach
      2. 9.1.2 Using source control for code
    2. 9.2 Where to run your code
      1. 9.2.1 Development environment
      2. 9.2.2 Test environment
      3. 9.2.3 Production environment
      4. 9.2.4 After the first production deployment
    3. 9.3 Using source control for other assets
      1. Summary
  21. 10 Improving your assistant
    1. 10.1 Using a success metric to determine where to start improvements
      1. 10.1.1 Improving the first flow to fix containment problems
      2. 10.1.2 Inspecting other process flows for containment problems
    2. 10.2 Analyzing the classifier to predict future containment problems
      1. 10.2.1 Representative baseline
      2. 10.2.2 Finding gaps in the training data
    3. 10.3 When and why to improve your assistant
      1. 10.3.1 You can’t fix everything at once
      2. 10.3.2 You can’t always predict how users will react
      3. 10.3.3 User needs will change
      4. 10.3.4 Not every problem is technical
      5. Summary
  22. Part 5. Advanced/optional topics
  23. 11 Building your own classifier
    1. 11.1 Why build your own classifier?
      1. 11.1.1 Classification is a differentiator
      2. 11.1.2 Classification is a core competency
      3. 11.1.3 Traceability
      4. 11.1.4 To learn
      5. 11.1.5 Build or buy?
    2. 11.2 Build a simple classifier from first principles
      1. 11.2.1 The simplest text classifier
      2. 11.2.2 The mathematics behind a simple classifier
    3. 11.3 Expanding the simple classifier
      1. 11.3.1 Predicting more than one class
      2. 11.3.2 An all-in-one classifier
      3. 11.3.3 Comparing binary classifiers to all-in-one classifiers
    4. 11.4 Extending even further
      1. 11.4.1 What happens when you add more training data?
      2. 11.4.2 Exercise: Experiment on your own
      3. Summary
  24. 12 Additional training for voice assistants
    1. 12.1 Collecting data to test a speech-to-text model
      1. 12.1.1 Call recordings as speech training data
      2. 12.1.2 Generating synthetic speech data
    2. 12.2 Testing the speech-to-text model
      1. 12.2.1 Word error rate
      2. 12.2.2 Intent error rate
      3. 12.2.3 Sentence error rate
    3. 12.3 Training a speech-to-text model
      1. 12.3.1 Custom training with a language model
      2. 12.3.2 Custom training with an acoustic model
      3. 12.3.3 Custom training with grammars
    4. Summary
  25. Appendix. Glossary of terms and abbreviations
  26. index
  27. inside back cover

Product information

  • Title: Conversational AI
  • Author(s): Andrew Freed
  • Release date: October 2021
  • Publisher(s): Manning Publications
  • ISBN: 9781617298837