我刚刚使用flask开发了一个chatterbot web,并将其部署在heroku上,但我也使用了一个自定义的myown.yml converstaion,我不知道如何在heroku应用程序上传输此文件
from flask import Flask, render_template, request
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
app = Flask(__name__)
#create chatbot
englishBot = ChatBot("Chatterbot", storage_adapter="chatterbot.storage.SQLStorageAdapter")
trainer = ChatterBotCorpusTrainer(englishBot)
trainer.train("chatterbot.corpus.english","chatterbot.corpus.custom.myown") #train the chatter bot for english
#define app routes
@app.route("/")
def index():
return render_template("index.html")
@app.route("/get")
#function for the bot response
def get_bot_response():
userText = request.args.get('msg')
return str(englishBot.get_response(userText))
if __name__ == "__main__":
app.run()
谢谢
目前没有回答
相关问题 更多 >
编程相关推荐