sqlalchemy.exc.OperationalError:(sqlite3.OperationalError)集成chatterbot时出错

时间:2019-03-02 06:35:04

标签: python python-3.x sqlite chatterbot operationalerror

我正在尝试使用python集成chatterbot。我的代码看起来不错,并且可以正常工作,然后在我回复机器人No value for search_text was available on the provided input时出现此错误,并且我收到了类似的sqlite3.OperationalError

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: statement.search_text [SQL: "SELECT count(*) AS count_1 \nFROM (SELECT statement.id AS statement_id, statement.text AS statement_text, statement.search_text AS statement_search_text, statement.conversation AS statement_conversation, statement.created_at AS statement_created_at, statement.in_response_to AS statement_in_response_to, statement.search_in_response_to AS statement_search_in_response_to, statement.persona AS statement_persona \nFROM statement \nWHERE (statement.persona NOT LIKE ? || '%') AND (statement.search_text LIKE '%' || ? || '%')) AS anon_1"] [parameters: ('bot:', 'hi')] (Background on this error at: http://sqlalche.me/e/e3q8)

我花费大量时间来发现此错误,我使用的是python3版本。我的代码如下:

from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
import os
import glob

bot = ChatBot('Bot')

for _file in os.listdir('files'):
   data = open('files/' + _file, 'r').readlines()

   #bot.set_trainer(ListTrainer)

   #bot.train(data)


while True:
   message = input('You: ')
   if message.strip() != 'Bye':
      reply = bot.get_response(message)
      print('LIN: ',reply)
   if message.strip() == 'bye':
      print('LIN : Bye')
      break

您能帮我找到解决方法吗?

0 个答案:

没有答案