-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry_chatbot.py
More file actions
18 lines (18 loc) · 894 Bytes
/
try_chatbot.py
File metadata and controls
18 lines (18 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#creating module called try_chatbot.
#We will call functions and variables from this module in creating the GUI application
bot_name='EliBot'
#setting the bot's name to 'EliBot'
def elibot_responses(vbg):
#function created that accepts a parameter which the bot will respond to
import aiml
#the inbuilt AIML module
elibot_kernel=aiml.Kernel()
#the elibot_kernel is initialized
elibot_kernel.learn(r"std_startup_elibot.xml")
#the elibot_kernel is set to learn from a setup AIML/XML file
elibot_kernel.respond('Start Session')
#the elibot_kernel is set to respond to a particular phrase
#when the kernel responds to this ('Start Session'), the actual AIML file is loaded, and the bot can access it
while True:
return(elibot_kernel.respond(vbg))
# an infinite loop to set the bot to always respond to input from the user