Introduction to conversational software

Building Chatbots in Python

Alan Nichol

Co-founder and CTO, Rasa

A short history

Conversational software is not a new idea!

  • Dates back to at least 1960s
  • First wave: command line applications
  • ELIZA: 1966

Building Chatbots in Python

Course content

  • Implementing smalltalk, ELIZA style
  • How to use regex and ML to extract meaning from free-form text
  • Build chatbots that can
    • Query a database
    • Plan a trip
    • Help you order coffee
  • Handling statefulness
Building Chatbots in Python

EchoBot I

USER: Hello!
BOT: I can hear you, you said: 'Hello!'
USER: How are you?
BOT: I can hear you, you said: 'How are you?'
Building Chatbots in Python

EchoBot II

def respond(message):
    return "I can hear you! you said: {}".format(message)

def send_message(message): # calls respond() to get response
send_message("hello!")
USER: hello!
BOT : I can hear you! you said: hello!
Building Chatbots in Python

EchoBot III

import time

time.sleep(0.5)
Building Chatbots in Python

Let's practice!

Building Chatbots in Python

Preparing Video For Download...