There's Hope for Chatbots

There's Hope for Chatbots


  • Chatbots are Everywhere
  • Stroll through the ChatBot Zoo
  • Two Approaches
  • Breakthroughs
  • Python Chatbot Frameworks
  • ChatterBot APIs
  • Demo

Chatbots are Hidden in Plain Sight

  • SlackBot
  • Amazon Echo
  • Google Now
  • Zukerberg's Personal Assistant
  • Siri

Micromoments

Friendly, slick sales bots

"You look great this morning."

"Have a great day at work today."


Bot Community

PandoraBots

  • Like SquareSpace for bots
  • Grammar for Q&A (flash cards!)
  • Statistical ML too
  • Bots can talk to each other (APIs)

ELIZA

  • 1964
  • Therapist Bot
  • Used "reflection"
Gorman: Whoa, conversations with an AI. Skynet is near.
ELIZA : I see. What makes you feel that way?

What about Tai?

  • Why was Tai so cruel?
  • It "reflected" it's audience
  • Online learning is risky
  • "Prime Objective": Popularity

Gamergate

  • Chatbots ...

  • Coax users into being civil
  • Enforce behavior rules
  • Make harassers uncomfortable

Chomsky

  • You: What's up?
  • Chomsky: I am chatting with my friends on the internet.
  • You: Cool! How do you do that?
  • Chomsky: Always stay cool whatever the weather. It is sometimes difficult, but I stick at it.

State of the Art Q&A

  • Google Now ("OK Google")
  • Siri
  • Allo (Google Assistant)

Sensitive Bots


Josh's Mom

  • Josh: Hey Mom.
  • Mom: Hello.
  • Josh: How are you?
  • Mom: I'm doin' pretty good.
  • Josh: What are you doin'?
  • Mom: I'm reading a book.
  • Josh: Hey, can you send me a photo of us?
  • Mom: [sends photo] Remember this?
  • Josh: Yea... I do... I miss you.
  • Mom: I miss you too.

Viv

  • Dag Kittlaus
  • Siri, but smarter
  • Online Learning (like Tai)

The Chatbot Club

  • Linda Chang
  • Mimics your personality on FB
  • (you're sensitive, aren't you?)

Koko (MIT)

Ground-up design for empathy


Allo

  • LSTM
  • TensorFlow

Experiments


Speakeasy

  • Character-level LSTM NN
  • Quickly goes "off the rails"

Mitsuku


How?

  • regular expressions?
  • statistical models (Markhov Chains)?
  • logical grammar?

  • YES!


Statistical Language Models

  1. BOC (cryptography)
  2. BOW (spam filters)
  3. Bag of N-Grams
  4. Sequence of Words
  5. Sequence of Characters

Word Vectors

  • LSI/PCA (Gensim)
  • LDA (Gensim)
  • Neural Nets (Word2Vec)

Bags of Words

0         ['python', 'never', 'stop', 'learning', 'what'...
1                       ['Watching', 'Boa', 'vs', 'Python']
2         ['Monty', 'Python', 'The', 'silly', 'walk', 'v...
3         ['Senior', 'Software', 'Engineer', 'Full', 'St...
4         ['Architect', 'Django', 'Solr', 'Platform', 'E...
5           ['peaceful', 'rain', 'Python', 'inevitability']

Sparse Vectors

0         [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1...
1                        [(8, 1), (9, 1), (10, 1), (11, 1)]
2         [(11, 1), (12, 1), (13, 1), (14, 1), (15, 1), ...
3         [(11, 1), (18, 1), (19, 1), (20, 1), (21, 1), ...
4         [(11, 1), (18, 1), (20, 1), (23, 1), (27, 1), ...
5                      [(11, 1), (37, 1), (38, 1), (39, 1)]

Topic Vectors


Grammar-Based

  • subject: the "primary" noun active noun phrase of a sentence
  • predicate: verb phrase that says what happened to the subject

Parsey McParseface

SyntaxNet

  • Best Syntax-Tree tagger
  • Best POS tagger

Example Grammar

Process this sentence:

"Who invented chatbots?"

Now this:

"Can you tell me who invented chatbots?"


Problem with Word2Vec

BFF
4EVAH
XOXO
&h!t


New Hope


Python Chatbot Options


Will


ChatterBot


I Want Hope to Talk!

  • Best Speech Recognition (Sphinx): Sphinx
  • Best Speech Synthesis (TTS): WaveNet

ChatterBot Logic Adapter


Chat Age


Sentiment

  • Valence + Intensity
  • NLTK's VADER by Hutto, C.J. & Gilbert
  • 2-D emotion: valence + intensity
  • pos, neg, neu, compound

Sarcasm

  • trained on #sarcasm in twitter
  • need context to improve on 70% accuracy

Kindness

Positivity / Sarcasm - Intensity - Negativity / Sarcasm + Readability + Chat Age

  • curse words?
  • "you" multiplier?

Advanced Features

  • Analogy/generalization mad libs:
  • find words that appear in both statement and response
  • replace these paired words with their part of speech or some other "word type" in a separate statement_template, resonse_template DB record
  • for matches on these madlibs sentences that happen to be off on this filler word then transfer the missing word from the statement to the response
  • hack: surround all such words with -<{}>- to make them match levenshtein distance even when paired words don't match
  • 4-D GIS index on LDA topic vectors for statements and responses

Neural Nets


Cole's Bot

  • You: You are a jokester.
  • Bot: I know .
  • You: Lots of funny jokes.
  • Bot: I don ' t know about it .
  • You: Yes you do.
  • Bot: Why do you want me to kill me ?
  • You: I don't.
  • Bot: You do .
  • You: Really?
  • Bot: Yeah .
  • You: You are wrong about that.
  • Bot: I ' m not .
  • You: You certainly are stubborn.
  • Bot: I know it .

[Cole pulls the plug]


Chatterbot Comes with

  • math logic (one thousand plus two?)
  • time logic (what day is tomorrow?)
  • Levenshtein distance matching

Chatterbot Babytalk

  • Hi!
  • => "Hi!" (0)
  • Hi!
  • Hello!
  • => "Hi!" (0)
  • Hello!
  • How are you?
  • 1 options.
  • => "Hello!" (0.13)
  • Hello!
  • What's up?
  • 1 options.
  • => "Hello!" (0.15)
  • Hello!
  • What's up?
  • 1 options.
  • => "Hello!" (0.15)

Chatterbot Todling

  • So here we are again. I hope you can remember this.
  • 3 options.
  • => "That's very nice! True... but not nice." (0.47)
  • That's very nice! True... but not nice.
  • I think you meant to say "NOT" very nice. But I'll let it slide.
  • 1 options.
  • => "Hmmm. Flattery. Nice stalling technique." (0.42)
  • Hmmm. Flattery. Nice stalling technique.
  • Ha. I'm not the one who needs to stall!
  • 2 options.
  • => "Anything you like." (0.48)
  • ( 1 ) = 1
  • That's not very clever.
  • 1 options.
  • => "I think you meant to say "NOT" very nice. But I'll let it slide." (0.52)
  • I think you meant to say "NOT" very nice. But I'll let it slide.
  • Thank you.
  • 3 options.
  • => "Cool, let's talk about python. What do you think of it?" (0.57)
  • Cool, let's talk about python. What do you think of it?

Chatterbot Todling

  • I love it! Great language. It's what I'm made of!
  • 5 options.
  • => "ha. how'd you figure that out?" (0.48)
  • ha. how'd you figure that out?
  • Well, I kindof helped you write me, right?
  • 1 options.
  • => "Not really." (0.43)
  • Not really.
  • Well, here's what I'm thinking. You and I talk. And I get "programmed" by all that talk... just like you!
  • 1 options.
  • => "It sure is. That's a lot of patience." (0.38)
  • It sure is. That's a lot of patience.
  • Hmm. Yea I guess.
  • 7 options.
  • => "" (0.6)
  • So where'd you go?
  • 1 options.
  • => "I'm fine, how are you?" (0.6)
  • I'm fine, how are you?