Search This Blog

Friday, August 7, 2020

Python AutoBot - ChatterBot Plugin

 >install python 3.8

> create your app folder

> pip or pip3 install  chatterbot
> pip or pip3 install   chatterbot-corpus

>Program mychat.py

from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer

# Create a new chat bot named ArsenaliT
chatbot = ChatBot('ArsenaliT')

trainer = ListTrainer(chatbot)

trainer.train([
    "Hi",
    "Hi, can I help you?",
    "Sure, I'd like to book a flight to Iceland.",
    "Your flight has been booked."
])

user = "hi";
print("User : ", user)
response = chatbot.get_response(user)
print("Bot : ", response)

user = "I'd like to book a flight ";
print("User : ", user)
response = chatbot.get_response(user)
print("Bot : ", response)


> OUTPUT

User :  hi
Bot :  Hope you are safe and good
User :  I'd like to book a flight
Bot :  Your flight has been booked.



ENJOY

Hit Counter


View My Stats