Phone

+919997782184

Email

support@roboticswithpython.com

Geeks of Coding

Join us on Telegram

Home Forums Cody Bank Chatbot Using Flask

Tagged: 

Viewing 0 reply threads
  • Author
    Posts
    • #1029
      Sahil KumarSahil Kumar
      Moderator

      To download code, templates and static files here is the link
      https://github.com/ghostman-ai/Chatbot-Using-Flask.git

      from flask import Flask, render_template, request
      from chatterbot import ChatBot
      from chatterbot.trainers import ChatterBotCorpusTrainer
      
      app = Flask(__name__)
      
      english_bot = ChatBot("Chatterbot")
      trainer = ChatterBotCorpusTrainer(english_bot)
      trainer.train("chatterbot.corpus.english")
      
      @app.route("/")
      def home():
          return render_template("index.html")
      
      @app.route("/get")
      def get_bot_response():
          userText = request.args.get('msg')
          return str(english_bot.get_response(userText))
      
      if __name__ == "__main__":
          app.run()
Viewing 0 reply threads
  • You must be logged in to reply to this topic.