From 5330ac26b3c5a87075c7c4d58c7327968bc9ca7c Mon Sep 17 00:00:00 2001 From: ABIR ROY <72157530+abhuman@users.noreply.github.com> Date: Fri, 20 Oct 2023 02:29:14 +0530 Subject: [PATCH] Create Chatbot.py --- Chatbot.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Chatbot.py diff --git a/Chatbot.py b/Chatbot.py new file mode 100644 index 0000000000..e57be9835a --- /dev/null +++ b/Chatbot.py @@ -0,0 +1,15 @@ +from chatterbot import ChatBot +from chatterbot.trainers import ChatterBotCorpusTrainer + +# Create a new instance of a ChatBot +chatbot = ChatBot('Example Bot') + +# Create a new trainer for the chatbot +trainer = ChatterBotCorpusTrainer(chatbot) + +# Train the chatbot based on the english corpus +trainer.train("chatterbot.corpus.english") + +# Get a response for some input text +response = chatbot.get_response("Hello, how are you?") +print(response)