дрессировка с помощью джанго - PullRequest
0 голосов
/ 04 июля 2019

Я хочу обучить болтовню, используя отдельный train.py в django, но получаю ошибку

Код:

from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
from chatterbot.ext.django_chatterbot import settings
bot = ChatBot(**settings.CHATTERBOT)
trainer =ChatterBotCorpusTrainer(bot)
trainer.train('./training_data/')

Ошибка:

Traceback (most recent call last):
File "train.py", line 3, in 
from chatterbot.ext.django_chatterbot import settings
File "C:\Users\nuthalapativ\AppData\Local\Continuum\anaconda3\lib\site- 
packages\chatterbot\ext\django_chatterbot\settings.py", line 8, in 
CHATTERBOT_SETTINGS = getattr(settings, 'CHATTERBOT', {})
File "C:\Users\nuthalapativ\AppData\Local\Continuum\anaconda3\lib\site- 
packages\django\conf_init_.py", line 79, in getattr
self.setup(name)
File "C:\Users\nuthalapativ\AppData\Local\Continuum\anaconda3\lib\site- 
packages\django\conf_init.py", line 64, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting 
CHATTERBOT, but settings are not configured. You must either define the 
environment variable DJANGO_SETTINGS_MODULE or call settings.configure() 
before accessing settings.
...