A simple bot package in python.
This project is based on this post
# import the package
import pybot as bot
#define
def greeting(*params):
return "Hi!"
def how_are_you(*params):
return "I'm fine and you?"
bot.train('./data.json')
bot.register_action('greeting', greeting)
bot.register_action('howareyou', how_are_you)
response = bot.interact('Hi')
print(response)
The training data file used on the package follows the structure:
[
{
"class": "greeting",
"sentences": [
"hi",
"hello",
"hey",
"what's up"
]
}
...
]
[Finish here]
[Finish Here]