Chatterbot: I am getting a database error when running a simple chat bot with my own corpus

Created on 28 Oct 2017  路  7Comments  路  Source: gunthercox/ChatterBot

I have defined my own corpus which is being parsed successfully from what I can tell. However, when I run the bot, I am getting the following error.

   return connection._execute_clauseelement(self, multiparams, params)
  File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy\engine\base.py", line 1053, in _execute_clauseelement
    compiled_sql, distilled_params
  File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy\engine\base.py", line 1189, in _execute_context
    context)
  File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy\engine\base.py", line 1402, in _handle_dbapi_exception
    exc_info
  File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy\util\compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy\util\compat.py", line 186, in reraise
    raise value.with_traceback(tb)
  File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy\engine\base.py", line 1182, in _execute_context
    context)
  File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\sqlalchemy\engine\default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.InterfaceError: <exception str() failed>

I have sqlite3 installed. My code is below.

from chatterbot import ChatBot
import logging
logging.basicConfig(level=logging.INFO)
chatbot = ChatBot(
    'CISO',
    trainer='chatterbot.trainers.ChatterBotCorpusTrainer'
)

# Train based on the ciso corpus
chatbot.train("chatterbot.corpus.ciso")

# Get a response to an input statement
resp=chatbot.get_response("what is cyber security")
print(resp)
question

All 7 comments

Hi all,
I have further tested the bot on Linux and am getting the same error message. How do I troubleshoot this? I can see the database file being created. Could the problem be with my corpus? I am attaching the file with this issue.
I am also pasting the code of my bot.

pi@raspberrypi:~ $ cat cb.py                                                    
from chatterbot import ChatBot                                                  
import logging                                                                  
logging.basicConfig(level=logging.INFO)                                         
chatbot = ChatBot(    'CISO',                                                   
    storage_adapter='chatterbot.storage.SQLStorageAdapter',                     
    database='./database.sqlite3',                                              
    trainer='chatterbot.trainers.ChatterBotCorpusTrainer'                       
)                                                                               

# Train based on the ciso corpus                                                
chatbot.train("chatterbot.corpus.ciso")                                         

# Get a response to an input statement                                          
resp=chatbot.get_response("what is cyber security")                             
print(resp)pi@raspberrypi:~ $                                                   


[ciso_yml.txt](https://github.com/gunthercox/ChatterBot/files/1434376/ciso_yml.txt)

@pranavlal could you please post your Linux stack trace? So that will more idea on your failure?

Hi,

Sure. I am attaching the log to this message.
teraterm.log

@pranavlal Thanks, By looking error log, The error is

sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.

I found this thread useful to you https://stackoverflow.com/a/12953027/358458

These are guesses
paramter 0, is unsupported means The Statement is Unicode text element, Instead your supplying other data type. Is it possible to share your corpus ciso.yml file?

Hi,
I have already shared my yml file. I will attach it again. I will keep it as a txt extension.
ciso.txt

Was this page helpful?
0 / 5 - 0 ratings

Related issues

filipceglik picture filipceglik  路  3Comments

decode007 picture decode007  路  3Comments

hochochoc picture hochochoc  路  3Comments

AfrahAsif picture AfrahAsif  路  3Comments

yuvalBor picture yuvalBor  路  3Comments