Python Tutorial: Introduction to Conversational Software

DataCamp · Beginner ·🔧 Backend Engineering ·6y ago

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 SQL Server Tutorial: Date manipulation
SQL Server Tutorial: Date manipulation
DataCamp
2 R Tutorial: Intermediate Interactive Data Visualization with plotly in R
R Tutorial: Intermediate Interactive Data Visualization with plotly in R
DataCamp
3 R Tutorial: Adding aesthetics to represent a variable
R Tutorial: Adding aesthetics to represent a variable
DataCamp
4 R Tutorial: Moving Beyond Simple Interactivity
R Tutorial: Moving Beyond Simple Interactivity
DataCamp
5 Python Tutorial: Why use ML for marketing? Strategies and use cases
Python Tutorial: Why use ML for marketing? Strategies and use cases
DataCamp
6 Python Tutorial: Preparation for modeling
Python Tutorial: Preparation for modeling
DataCamp
7 Python Tutorial: Machine Learning modeling steps
Python Tutorial: Machine Learning modeling steps
DataCamp
8 R Tutorial: The prior model
R Tutorial: The prior model
DataCamp
9 R Tutorial: Data & the likelihood
R Tutorial: Data & the likelihood
DataCamp
10 R Tutorial: The posterior model
R Tutorial: The posterior model
DataCamp
11 R Tutorial: An Introduction to plotly
R Tutorial: An Introduction to plotly
DataCamp
12 R Tutorial: Plotting a single variable
R Tutorial: Plotting a single variable
DataCamp
13 R Tutorial: Bivariate graphics
R Tutorial: Bivariate graphics
DataCamp
14 Python Tutorial: Customer Segmentation in Python
Python Tutorial: Customer Segmentation in Python
DataCamp
15 Python Tutorial: Time cohorts
Python Tutorial: Time cohorts
DataCamp
16 Python Tutorial: Calculate cohort metrics
Python Tutorial: Calculate cohort metrics
DataCamp
17 Python Tutorial: Cohort analysis visualization
Python Tutorial: Cohort analysis visualization
DataCamp
18 R Tutorial: Building Dashboards with flexdashboard
R Tutorial: Building Dashboards with flexdashboard
DataCamp
19 R Tutorial: Anatomy of a flexdashboard
R Tutorial: Anatomy of a flexdashboard
DataCamp
20 R Tutorial: Layout basics
R Tutorial: Layout basics
DataCamp
21 R Tutorial: Advanced layouts
R Tutorial: Advanced layouts
DataCamp
22 Python Tutorial: Time Series Analysis in Python
Python Tutorial: Time Series Analysis in Python
DataCamp
23 Python Tutorial: Correlation of Two Time Series
Python Tutorial: Correlation of Two Time Series
DataCamp
24 Python Tutorial: Simple Linear Regressions
Python Tutorial: Simple Linear Regressions
DataCamp
25 Python Tutorial: Autocorrelation
Python Tutorial: Autocorrelation
DataCamp
26 R Tutorial: The gapminder dataset
R Tutorial: The gapminder dataset
DataCamp
27 R Tutorial: The filter verb
R Tutorial: The filter verb
DataCamp
28 R Tutorial: The arrange verb
R Tutorial: The arrange verb
DataCamp
29 R Tutorial: The mutate verb
R Tutorial: The mutate verb
DataCamp
30 R Tutorial: What is cluster analysis?
R Tutorial: What is cluster analysis?
DataCamp
31 R Tutorial: Distance between two observations
R Tutorial: Distance between two observations
DataCamp
32 R Tutorial: The importance of scale
R Tutorial: The importance of scale
DataCamp
33 R Tutorial: Measuring distance for categorical data
R Tutorial: Measuring distance for categorical data
DataCamp
34 Python Tutorial: Plotting multiple graphs
Python Tutorial: Plotting multiple graphs
DataCamp
35 Python Tutorial: Customizing axes
Python Tutorial: Customizing axes
DataCamp
36 Python Tutorial: Legends, annotations, & styles
Python Tutorial: Legends, annotations, & styles
DataCamp
37 Python Tutorial: Introduction to iterators
Python Tutorial: Introduction to iterators
DataCamp
38 Python Tutorial: Playing with iterators
Python Tutorial: Playing with iterators
DataCamp
39 Python Tutorial: Using iterators to load large files into memory
Python Tutorial: Using iterators to load large files into memory
DataCamp
40 SQL Tutorial: Introduction to Relational Databases in SQL
SQL Tutorial: Introduction to Relational Databases in SQL
DataCamp
41 SQL Tutorial: Tables: At the core of every database
SQL Tutorial: Tables: At the core of every database
DataCamp
42 SQL Tutorial: Update your database as the structure changes
SQL Tutorial: Update your database as the structure changes
DataCamp
43 Python Tutorial: Classification-Tree Learning
Python Tutorial: Classification-Tree Learning
DataCamp
44 Python Tutorial: Decision-Tree for Classification
Python Tutorial: Decision-Tree for Classification
DataCamp
45 Python Tutorial: Decision-Tree for Regression
Python Tutorial: Decision-Tree for Regression
DataCamp
46 Python Tutorial: Census Subject Tables
Python Tutorial: Census Subject Tables
DataCamp
47 Python Tutorial: Census Geography
Python Tutorial: Census Geography
DataCamp
48 Python Tutorial: Using the Census API
Python Tutorial: Using the Census API
DataCamp
49 R Tutorial: A/B Testing in R
R Tutorial: A/B Testing in R
DataCamp
50 R Tutorial: Baseline Conversion Rates
R Tutorial: Baseline Conversion Rates
DataCamp
51 R Tutorial: Designing an Experiment - Power Analysis
R Tutorial: Designing an Experiment - Power Analysis
DataCamp
52 R Tutorial: Introduction to qualitative data
R Tutorial: Introduction to qualitative data
DataCamp
53 R Tutorial: Understanding your qualitative variables
R Tutorial: Understanding your qualitative variables
DataCamp
54 R Tutorial: Making Better Plots
R Tutorial: Making Better Plots
DataCamp
55 SQL Tutorial: OLTP and OLAP
SQL Tutorial: OLTP and OLAP
DataCamp
56 SQL Tutorial: Storing data
SQL Tutorial: Storing data
DataCamp
57 SQL Tutorial: Database design
SQL Tutorial: Database design
DataCamp
58 Python Tutorial: Introduction to spaCy
Python Tutorial: Introduction to spaCy
DataCamp
59 Python Tutorial: Statistical Models
Python Tutorial: Statistical Models
DataCamp
60 Python Tutorial: Rule-based Matching
Python Tutorial: Rule-based Matching
DataCamp

Related Reads

📰
Behind a Single "Paste" Button: The Tale of Two Completely Different APIs
Learn how to implement a 'paste image' feature in an upload component using two different APIs
Dev.to · Image2
📰
The Django — Snowflake couple… a therapy session
Learn how to integrate Django with Snowflake for efficient database management and explore the benefits of this combination for web application development
Medium · Python
📰
Port Numbers, In Order: Why the List Has Gaps, and the Best Stories Behind the Numbers
Explore the stories behind TCP/UDP port numbers and why the list has gaps, learning about the history and usage of key ports
Dev.to · Yuuki Yamashita
📰
Day 97 of Learning MERN Stack
Learn how to apply MERN stack skills in 100 days and boost backend and frontend engineering skills
Dev.to · Ali Hamza
Up next
Indian Express Editorial Analysis by Chandan Sharma - 1 JULY 2026 | UPSC Current Affairs 2026
StudyIQ IAS
Watch →