Chatterbot: how to use django adapter?

Created on 8 Dec 2017  路  2Comments  路  Source: gunthercox/ChatterBot

I use the django adpater like this:

chatterbot = ChatBot("yst",
                     storage_adapter='chatterbot.storage.DjangoStorageAdapter',
                     trainer='chatterbot.trainers.ChatterBotCorpusTrainer'
                     )
chatterbot.train('chatterbot.corpus.chinese')

When I run my project in django,got the error:

  chatterbot.train('chatterbot.corpus.chinese')
  File "/home/chris/.local/lib/python2.7/site-packages/chatterbot/trainers.py", line 133, in train
    statement = self.get_or_create(text)
  File "/home/chris/.local/lib/python2.7/site-packages/chatterbot/trainers.py", line 28, in get_or_create
    statement = self.storage.find(statement_text)
  File "/home/chris/.local/lib/python2.7/site-packages/chatterbot/storage/django_storage.py", line 41, in find
    Statement = self.get_model('statement')
  File "/home/chris/.local/lib/python2.7/site-packages/chatterbot/storage/storage_adapter.py", line 34, in get_model
    return get_model_method()
  File "/home/chris/.local/lib/python2.7/site-packages/chatterbot/storage/django_storage.py", line 22, in get_statement_model
    return apps.get_model(self.django_app_name, 'Statement')
  File "/home/chris/.local/lib/python2.7/site-packages/django/apps/registry.py", line 200, in get_model
    app_config = self.get_app_config(app_label)
  File "/home/chris/.local/lib/python2.7/site-packages/django/apps/registry.py", line 156, in get_app_config
    raise LookupError(message)
LookupError: No installed app with label 'django_chatterbot'.
answered question

Most helpful comment

All 2 comments

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gunthercox picture gunthercox  路  3Comments

engrphil picture engrphil  路  3Comments

AmusingThrone picture AmusingThrone  路  3Comments

gunthercox picture gunthercox  路  3Comments

coolrb picture coolrb  路  3Comments