Python Tutorial: Introduction to Conversational Software
Skills:
ML Maths Basics60%
Key Takeaways
Introduces conversational software using Python
Full Transcript
hello and welcome to this course on chatbots and conversational software conversational software is not a new idea in fact the invention of the keyboard and video screen terminal brought on the first wave of command-line apps back in the 1960s to use a command line app you have to type instructions using a language that's very strict but already much closer to human language than the underlying machine instructions around the same time the iliza program was created this now-famous program was able to hold the conversation by using a rule matching engine and despite the relatively simple code behind Eliza it's actually quite a compelling conversation list in this chapter you will build your own minimal version of the Eliza chat bot in the following chapters you will learn how to use regular expressions as well as machine learning to extract meaning from freeform text you will build chat boats that can query a database plan a trip and help you order coffee you'll see that often the tricky part of building more complicated BOTS is to keep track of the state of a conversation you'll first learn techniques for avoiding this safe fulness which is usually the easiest solution later you'll learn how to handle state in the cases where you really have to in this first set of exercises you'll start with the basics the first pot you'll build is called echo bot because it simply echoes back to you whatever you say to it for simplicity all of the bots that you build in this course will receive messages in Python code and will print the responses to the screen at the end of the course we will provide you with some Python code for connecting your BOTS to various messaging apps to build an echo bot you need to define a respond function which takes a message as an argument and returns an appropriate response here we define a function using the keyword def then the name of the function then it's arguments in parentheses and then a colon the body of the function is indented by one level we specify the output generated by the function using the return keyword if a function doesn't have a return statement that means it returns a none one way we can insert variables into a string in Python is by using the strings format method inside the response function is a string containing curly brackets these acts as placeholders and will get replaced by the value of the argument we pass when we call format to keep track of everything that's being said we'll define another function called send message this prints what the user just said gets the response by calling the respond function and then prints the bots response as well even when we know we're talking to a bot it can feel a little strange to see a response come back immediately it just doesn't feel natural we can create an artificial delay by importing the time module and running time dot sleep passing the number of seconds to weight as an argument in this example we've created a half second delay now it's time for you to create your own echo bot
Original Description
Want to learn more? Take the full course at https://learn.datacamp.com/courses/building-chatbots-in-python at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work.
---
Hello, and welcome to this course on chatbots and conversational software.
Conversational software is not a new idea!
In fact, the invention of the keyboard+video screen terminal brought on the first wave of command line apps in the 1960s.
To use a command line app, you have to type instructions using a language that's very strict, but already much closer to human language than the underlying machine instructions.
Around the same time, the ELIZA program was created.
This now famous program was able to hold a conversation by using a rule-matching engine.
Despite the relatively simple code behind ELIZA, it's actually a pretty compelling conversationalist.
In this chapter you will build up your own, minimal version of the ELIZA chatbot.
In the following chapters, you will learn how use regular expressions, as well as machine learning to extract meaning from free-form text.
You will build chatbots that can query a database for you, plan a trip,
and help you order coffee.
You will see that often, the tricky part of building more complicated bots is to keep track of the _state_ of the conversation.
You'll first learn techniques for avoiding this statefulness, which is usually the easiest solution.
Later, you'll learn how to handle state in the cases where you really have to.
In this first set of exercises, you'll start with the basics.
The first bot you'll build is called EchoBot, because it simply echoes back to you whatever you say to it.
For simplicity, all the bots you build in this course will receive messages in python code, and will print their responses to the screen.
At the end of the course we will provide you with some python code for connecting your bots to various messaging apps.
To build an echobot you need to define a `respond`
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from DataCamp · DataCamp · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
SQL Server Tutorial: Date manipulation
DataCamp
R Tutorial: Intermediate Interactive Data Visualization with plotly in R
DataCamp
R Tutorial: Adding aesthetics to represent a variable
DataCamp
R Tutorial: Moving Beyond Simple Interactivity
DataCamp
Python Tutorial: Why use ML for marketing? Strategies and use cases
DataCamp
Python Tutorial: Preparation for modeling
DataCamp
Python Tutorial: Machine Learning modeling steps
DataCamp
R Tutorial: The prior model
DataCamp
R Tutorial: Data & the likelihood
DataCamp
R Tutorial: The posterior model
DataCamp
R Tutorial: An Introduction to plotly
DataCamp
R Tutorial: Plotting a single variable
DataCamp
R Tutorial: Bivariate graphics
DataCamp
Python Tutorial: Customer Segmentation in Python
DataCamp
Python Tutorial: Time cohorts
DataCamp
Python Tutorial: Calculate cohort metrics
DataCamp
Python Tutorial: Cohort analysis visualization
DataCamp
R Tutorial: Building Dashboards with flexdashboard
DataCamp
R Tutorial: Anatomy of a flexdashboard
DataCamp
R Tutorial: Layout basics
DataCamp
R Tutorial: Advanced layouts
DataCamp
Python Tutorial: Time Series Analysis in Python
DataCamp
Python Tutorial: Correlation of Two Time Series
DataCamp
Python Tutorial: Simple Linear Regressions
DataCamp
Python Tutorial: Autocorrelation
DataCamp
R Tutorial: The gapminder dataset
DataCamp
R Tutorial: The filter verb
DataCamp
R Tutorial: The arrange verb
DataCamp
R Tutorial: The mutate verb
DataCamp
R Tutorial: What is cluster analysis?
DataCamp
R Tutorial: Distance between two observations
DataCamp
R Tutorial: The importance of scale
DataCamp
R Tutorial: Measuring distance for categorical data
DataCamp
Python Tutorial: Plotting multiple graphs
DataCamp
Python Tutorial: Customizing axes
DataCamp
Python Tutorial: Legends, annotations, & styles
DataCamp
Python Tutorial: Introduction to iterators
DataCamp
Python Tutorial: Playing with iterators
DataCamp
Python Tutorial: Using iterators to load large files into memory
DataCamp
SQL Tutorial: Introduction to Relational Databases in SQL
DataCamp
SQL Tutorial: Tables: At the core of every database
DataCamp
SQL Tutorial: Update your database as the structure changes
DataCamp
Python Tutorial: Classification-Tree Learning
DataCamp
Python Tutorial: Decision-Tree for Classification
DataCamp
Python Tutorial: Decision-Tree for Regression
DataCamp
Python Tutorial: Census Subject Tables
DataCamp
Python Tutorial: Census Geography
DataCamp
Python Tutorial: Using the Census API
DataCamp
R Tutorial: A/B Testing in R
DataCamp
R Tutorial: Baseline Conversion Rates
DataCamp
R Tutorial: Designing an Experiment - Power Analysis
DataCamp
R Tutorial: Introduction to qualitative data
DataCamp
R Tutorial: Understanding your qualitative variables
DataCamp
R Tutorial: Making Better Plots
DataCamp
SQL Tutorial: OLTP and OLAP
DataCamp
SQL Tutorial: Storing data
DataCamp
SQL Tutorial: Database design
DataCamp
Python Tutorial: Introduction to spaCy
DataCamp
Python Tutorial: Statistical Models
DataCamp
Python Tutorial: Rule-based Matching
DataCamp
More on: ML Maths Basics
View skill →Related Reads
📰
📰
📰
📰
Behind a Single "Paste" Button: The Tale of Two Completely Different APIs
Dev.to · Image2
The Django — Snowflake couple… a therapy session
Medium · Python
Port Numbers, In Order: Why the List Has Gaps, and the Best Stories Behind the Numbers
Dev.to · Yuuki Yamashita
Day 97 of Learning MERN Stack
Dev.to · Ali Hamza
🎓
Tutor Explanation
DeepCamp AI