May 2015
Intermediate to advanced
330 pages
7h 18m
English
To check whether the module is properly installed on your machine, open a Python IDLE and import the aiml module:
>>> import aiml
If the module is imported correctly, it will not show any error and comes to the next line. Then, we can confirm that the installation is correct.
The most important class we are handling in the aiml module is Kernel(). We are mainly using this class to learn from AIML files and get a response from the AIML dataset to user input. The following line will create an object of the aiml.Kernel() class:
>>> mybot = aiml.Kernel()
After creating the Kernel() object, we can assign the robot name using the following command. We will assign Chefbot as the name for this robot:
>>> mybot.setBotPredicate("name","Chefbot") ...Read now
Unlock full access