我在创建Python Chatterbot实例时遇到一个“unrecognedinputformatexception”。我使用的代码基于发布的示例here。代码如下:
from chatterbot import ChatBot
def main():
from chatterbot.training.trainers import ChatterBotCorpusTrainer
# create a new instance of a chatbot
bot = ChatBot("proactive_response1",
storage_adapter="chatterbot.adapters.storage.JsonDatabaseAdapter",
logic_adapters=["chatterbot.adapters.logic.ClosestMatchAdapter"],
input_adapter="chatterbot.adapters.input.VariableInputTypeAdapter",
output_adapter="chatterbot.adapters.output.OutputFormatAdapter",
output_format='text',
database="../database.db"
)
# set up machine learning training
bot.set_trainer(ChatterBotCorpusTrainer)
bot.train("chatterbot.corpus.english.proactive_corpus.proactive_response1")
print('Welcome , I\'m theProActive Response Bot, how are you today?')
while True:
try:
bot_input = bot.get_response(None)
print(bot_input)
# Press ctrl-c or ctrl-d on the keyboard to exit
except (KeyboardInterrupt, EOFError, SystemExit):
break
main()
这是stacktrace:
^{pr2}$进程结束,退出代码为1
目前没有回答
相关问题 更多 >
编程相关推荐