diff --git a/app.py b/app.py new file mode 100644 index 0000000..3e85f4a --- /dev/null +++ b/app.py @@ -0,0 +1,26 @@ +from flask import Flask, render_template, request +from chatterbot import ChatBot +from chatterbot.trainers import ChatterBotCorpusTrainer +from chatterbot.trainers import ListTrainer + +app = Flask(__name__) + +bot = ChatBot("Candice") +bot.set_trainer(ListTrainer) +bot.train(['What is your name?', 'My name is Candice']) +bot.train(['Who are you?', 'I am a bot' ]) +bot.train(['Do created you?', 'Tony Stark', 'Sahil Rajput', 'You?']) +bot.set_trainer(ChatterBotCorpusTrainer) +bot.train("chatterbot.corpus.english") + +@app.route("/") +def home(): + return render_template("home.html") + +@app.route("/get") +def get_bot_response(): + userText = request.args.get('msg') + return str(bot.get_response(userText)) + +if __name__ == "__main__": + app.run() diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000..9c266cc --- /dev/null +++ b/templates/home.html @@ -0,0 +1,140 @@ + + + Candice + + + + + + + +

CANDICEYour Personal ChatBot

+

+

Like this? ❤️ Tweet me 👉 @_sahilrajput. Find this project on GitHub.

+

+
+
+
+
+ CANDICE +

Hi! I'm Candice your personal ChatBot ❤️

+
+
+ +
+
+ +
+ + \ No newline at end of file