from flask import Flask, render_template, request | |
from retrieve_bot import ChatBot | |
app = Flask(__name__) | |
chatSheldon = ChatBot() | |
chatSheldon.load() | |
# this script is running flask application | |
def index(): | |
return render_template("chat.html") | |
def chat(): | |
msg = request.form["msg"] | |
input = msg | |
return get_Chat_response(input) | |
def get_Chat_response(text): | |
answer = chatSheldon.generate_response(text) | |
return answer | |
if __name__ == "__main__": | |
app.run(debug=True, port=7860) | |