1 of 21

Chatbots

Unit 2, Module 2.7

1

2 of 21

Module Objectives

Students should be able to:

  • Explain how semantic information webs capture meaningful relationships between entities
  • Identify the limitations of chatbots

2

3 of 21

What is a chatbot? Is it a virtual assistant? (No.)

Chatbots are designed to have conversations with you.

  • They are specific to a particular company or website.
  • They can help with accomplishing a task such as ordering a pizza or making an airline reservation.
  • They can also help you find information about the company’s products, or answer frequently asked customer service questions.

Virtual assistants such as Siri or Alexa don’t usually engage in lengthy dialogs the way chatbots do.

  • They are general purpose helpers not tied to a specific company or website.

  • They are designed to handle a wide variety of simple requests, such as
  • telling you the weather forecast
  • adding something to your shopping list.�
  • They respond to your request and then forget about it and wait for the next one.

3

4 of 21

Different Types of Chatbot

Customer service chatbots answer frequently asked questions such as:

  • What is the status of my order?
  • How do I return something?
  • What hours is your store open?
  • How do I make a warranty claim?

Sales chatbots help you find the product you want and submit an order.

  • Talks with you about what you’re looking for, e.g., color and size for clothes.
  • Takes you through the steps of constructing and order and arranging payment and shipping.

Entertainment chatbots converse with you to tell a story or present a fictional character.

  • Rose is an entertainment chatbot.
  • Some chatbots are modeled after famous persons, either real or fictional, such as Albert Einstein. They are programmed with lots of facts about the person’s life and accomplishments

4

5 of 21

Customer

Service Chatbot

5

6 of 21

Dominos Ordering Chatbot

6

7 of 21

Building a Chatbot

7

8 of 21

Strategies for Building a Chatbot

Technique: keyword matching

Useful for: answering common questions

  • Ask the user how you can help.
  • Examine their response for keywords you recognize.
    • If you find “return”, give information about how to return an item.
    • If you find “cancel”, give information about how to cancel an order.
    • If you find “repair”, give information about repair service.
  • If no keyword recognized, ask the user to restate their request.

8

9 of 21

Strategies for Building a Chatbot

Technique: template filling

Useful for: constructing an order or reservation

  • Define a template for the thing the chatbot will help people with, e.g., ordering a pizza
  • Define the slots of the template, e.g.,
    • Size
    • Type of crust
    • Toppings
  • For each slot, define the allowable values, e.g.,
    • Size can be Small, Medium, or Large

9

10 of 21

Strategies for Building a Chatbot

Technique: intent recognition

Useful for: flexible interaction, avoiding the need to use specific keywords

  • For each thing the user might want to do (an “intent”), give several examples of how they might express that intent:
    • “I want to order a pizza”
    • “I have a pizza order; it’s for delivery”
    • “I need a medium pizza”
  • Use these examples to train an AI system to recognize new sentences that express the same intent, e.g.:
    • “Can I get a large pizza?”

10

11 of 21

Strategies for Building a Chatbot

Technique: story snippets

Useful for: an entertainment chatbot telling you a character’s story, such as Rose.

  • Give your character a biography: name, age, hobbies, etc.
  • Make up a story in your character’s life that they want to tell you about.
  • Divide the story up into snippets of text that can be shown one at a time.
  • The order of presentation can vary, but some snippets must precede others in order for the story to make sense. Draw a graph to show these relationships.
  • Program the chatbot to answer questions about itself either from its biography or by showing a story snippet. If the user says something random, program the chatbot to respond with a snippet. Keep track of which snippets have already been shown.

11

12 of 21

Little Red Riding Hood: Biography

Real name: Blanchette

Age: 10

Favorite color: red

Likes: animals, cake, colorful clothes

Favorite things to do: dancing, singing,� walking in the woods

Favorite relative: grandmother

12

13 of 21

Little Red Riding Hood: Story Snippets

13

I set out for my grandmother’s house.

Along the way I met a huge wolf.

My grandmother was sick and I was bringing her a cake.

The wolf asked me where I was going.

I told him I was going to visit my sick grandmother.

He seemed wary of some woodcutters nearby.

14 of 21

Try It: Unplugged Activity: Design a chatbot

  1. Pick a strategy for designing your chatbot
    1. Build your own keyword-based chatbot
    2. Build your own Template-Filling chatbot
    3. Build your own Intent recognition chatbot
  2. Complete the template
  3. Simulate the chatbot with a friend
  4. Reflect on how it worked and how to improve it.

14

15 of 21

Take-away Lessons on Chatbots

Chatbots have limited understanding of language -- just enough to be useful.

Intent recognition makes a chatbot seem more flexible and human-like, but it’s still using a fixed, pre-defined set of intents.

Many companies are now using chatbots for customer service, with varying success.

There are multiple companies developing chatbot software and offering to create custom chatbots for businesses.

Walmart bought a chatbot company in 2021.

15

16 of 21

Optional Videos & Activities & Discussions

16

17 of 21

17

Video: Chatbots - Brief Overview and History

18 of 21

18

  • Semantic information webs can capture meaningful relationships between entities, which can help computers craft sentences
  • Rule based chatbots rely on someone adding examples of what a user might say to the code, as well as examples of how the program should reply
  • More advanced dialog systems are trained on large amounts of examples of real humans conversing, and are then more robust

Takeaways: Chatbots Video

19 of 21

19

  • Created 1964-1966
  • One of the first chatbots
  • Pattern-matches an answer based on the start of what you said.
  • Built to mimic the kind of therapist that just says back to

you what you said to them.

  • For it’s time, it was very impressive

Eliza - Therapist Chatbot

20 of 21

Try It #3: Talk with of other chatbots

Step #1: Pick a chatbot to talk with

Step #2: Talk with the chatbot

  • Try to see if it can have a natural conversation
  • Try to make it say something that doesn’t make sense

Copy and paste conversation here

Step #3: Reflect

  • What sorts of questions trip it up?
  • What sorts of questions is it good at?
  • Would you believe it was a person or AI?

20

21 of 21

TPS Discussion

What sort of questions did you ask the chatbot?

Did it answer in a way that made sense?

What wasn’t it able to do?

Does it seem like AI? Why or why not?

21