Skip to main content

Making a Chatbot Using Python

 Hello and welcome back to the exciting coding post. In the class, Computer Science we have continued to code using python. This unit relates to the last unit and post that was made about Inputs. There I made a calculator and a form letter that can function when the user types in inputs that respond to some of the computer's questions. For this unit we have made a chatbot that will take inputs but also respond to the user. Chatbots are used on many different websites. There are some that are solely dedicated to having a computer talk to you based on your questions and answers. Some websites where it asks if you want to speak to a worker or other person use a chatbot to answer the user and direct them to a worker. In this piece of code I included some questions, a random response generator, and a few other modules and functions. If you would like to try the chatbot out for yourself you can. All you need to do is answer the questions it gives you on the right side of the code box. 



That is the last coding project of the term. I hope they were easy to understand and manage. I liked working on this chatbot. Taking the code piece by piece was interesting and when it all came together and worked it was better. Although I had some minor struggle with the coding I was able to continue working on it and eventually finish. The if/elif/else statements are fun to assemble. They can use input and print functions and they are good with creating chatbots. Of course this code that I made can be larger. With more questions and answers to give the chatbot can be better. There are also some ways that the code can look cleaner by adding a few functions to them. If you want to make a chatbot of your own it works how mine does and you can create many different questions that are asked or even show something else like a photo. Thank you for reading through this blog post and exploring the chatbot if you did. This project was pretty fun and I am excited to see what else I can code in the future.

Comments

Popular posts from this blog

What is your Carbon Footprint?

This is the last Action Project of the Fuel class for STEAM. This unit focused on chemical reactions, carbon emissions, and inequalities. This unit was very short compared to the other two but still enough time to learn everything we needed to get to. When working on the chemical reactions we talked about how certain molecules reacted to from something else. The main molecules we worked with were oxygen (O2), carbon dioxide (CO2), and water (H2O). Since the unit was only a couple weeks long there was not much time for Field Experiences so the only one that we had was going to a water cooling facility in downtown Chicago. Here we learned about how this plant cools down water for nearby buildings by using ice. I thought this FE was really cool and it was interesting to hear about the projects that they did and how they got them done. A lot of their work when connecting their water to the buildings involves large pipes underground which can be a difficulty when in a busy city. One of thei...

Diddley Bows: One-stringed guitars

Welcome back to my blog. This post is for the second Action Project of the STEAM class: Light, Sound, and Time. This unit, sound, was all about how sound is made and what happens for humans or animals to perceive it. Sound travels as a longitudinal wave and is explained as vibrations coming from a source that we perceive to be sound. To start, we examined how the human ear worked and our range of audible frequencies compared to infrasound and ultrasound which humans can’t hear. We then looked at the speed of sound and how it changes based on the medium it travels through. Following the understanding of how sound travels, we investigated traveling faster than the speed of sound or breaking the sound barrier and also the Doppler Effect. Lastly, we looked at stringed instruments like guitars and found how they make sounds. We also had one Field Experience at Guitar Center to look at the guitars and other instruments there. For this Action Project, the task is to create a diddley bow which...

How Should We Practice Kindness and Respect?

Welcome back to my blog. This post is for the second Action Project of the Humanities course: A Nation's Argument. In this unit, we have been investigating how a nation contradicts itself. We started by looking at the United States Supreme Court and valid and sound arguments. We then moved on to logical fallacies and the Scott versus Sandford Supreme Court case from 1857. For Field Experiences, we spoke with Northwestern Law Professor Paul Gowder and met later with 40th Ward Chicago Alderman Andre Vasquez. For Prof. Gowder, we talked about the rule of law in the United States and Critical Race Theory. We talked with Alderman Vasquez about what being an alderperson means and "consent of the governed," which the United States is based on. For this Action Project, we have been asked to look through GCE's student Social Contract in the Family Handbook. In this Social Contract, we are looking for something that we find is a contradiction or want to amend. One section I fou...