Chapter 9. Applying Artificial Intelligence to ChefBot Using Python

In the previous chapter, we have discussed and implemented speech recognition and speech synthesis using Python and ROS. In this chapter, we will discuss how to apply AI to ChefBot to communicate with people intelligently, like a human. Actually, these features are add-ons in ChefBot, which can increase human-robot interaction and make the robot resemble a human food supplier. In this chapter, we will mainly cover the following topics:

  • Block diagram of ChefBot's communication system
  • Introduction to AIML and PyAIML
  • Interfacing ChefBot's AI module to ROS

AI (Artificial Intelligence) can be defined as the intelligent behavior exhibited by computers or machines. Using AI, we can create a virtual intelligence in machines to perform a specific task like a human. In this chapter, we will use a simple method to apply AI to the robot. This intelligence will work using pattern matching and searching algorithms. The input-output dialog patterns between the user and robot are stored in files called Artificial Intelligence Markup Language (AIML) and we will interpret these stored patterns using a Python module called PyAIML. The user can store desired patterns in AIML files and the interpreter module will search for appropriate response from the dataset. We can develop our own pattern dataset for our robot simply by writing logical patterns. In one section of this chapter, we will see how to write AIML tags and patterns in a robot. In the first section, we will discuss where we will use AI in ChefBot.

Block diagram of the communication system in ChefBot

The following block diagram shows how ChefBot communicates and interacts with humans using speech:

Block diagram of the communication system in ChefBot

Robot communication block diagram

The robot can convert human speech to text using the speech recognition system and can convert textual data to speech using speech synthesis. We have already discussed these processes in the previous chapter. The AI we will discuss here is contained in between these two blocks. After receiving the text data from a speech to text conversion stage, it is sent to the AIML interpreter. The AIML interpreter retrieves the most meaningful reply from the AIML dataset. The dataset of the robot can be anything, such as food details, casual talks, and so on. The user can write any kind of pattern in AIML files. In the case of ChefBot, the user can ask about food details or can command the robot to do something. The robot command system checks whether the converted text is a command to the robot. If it's a command, it is directly sent to the hardware nodes to execute. The output text from AIML will be converted to speech using a text-to-speech system. Also, we can put an LCD display to show the result of speech in the form of an animated face. All these features enhance the robot's interaction. Before we discuss the Python interpreter for AIML, we will discuss AIML and AIML tags in detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.235.79