Чаттер-бот в django_example возвращает случайные ответы - PullRequest
0 голосов
/ 05 августа 2020

Я установил чаттер-бота django, и он иногда работает. Я обучил бота с помощью chatterbot.corpus.engli sh. По какой-то причине он не может сказать мне свое имя.

Я инициализирую своего бота в view.py следующим образом. Все, что я добавил в пример кода, - это обучение:

chatterbot = ChatBot(**settings.CHATTERBOT)

trainer = ChatterBotCorpusTrainer(chatterbot)

trainer.train(
    "chatterbot.corpus.english"
)

Параметры, передаваемые чаттер-боту:

CHATTERBOT = {
    'name': 'Django ChatterBot Example',
    'django_app_name': 'django_chatterbot',
    'read_only': True,
    }

Разговор

Q Who Are you?
A I am just an artificial intelligence.
Q What is your name?
A i certainly do at times.

Вывод регистратора :

INFO:chatterbot.chatterbot:Beginning search for close text match
INFO:chatterbot.chatterbot:Processing search results
INFO:chatterbot.chatterbot:Similar text found: How are you? 0.92
INFO:chatterbot.chatterbot:Similar text found: Who are you? 1.0
INFO:chatterbot.chatterbot:Using "Who are you?" as a close match to "Who are you?" with a confidence of 1.0
INFO:chatterbot.chatterbot:0. Excluding recent repeated response of "Today's date is Tue Aug 4, 2020"
INFO:chatterbot.chatterbot:Selecting response from 36 optimal responses.
INFO:chatterbot.response_selection:Selecting first response from list of 36 options.
INFO:chatterbot.chatterbot:Response selected. Using "I am just an artificial intelligence."
INFO:chatterbot.chatterbot:BestMatch selected "I am just an artificial intelligence." as a response with a confidence of 1.0

[05/Aug/2020 10:23:55] "POST /api/chatterbot/ HTTP/1.1" 200 261
INFO:chatterbot.chatterbot:Beginning search for close text match
INFO:chatterbot.chatterbot:Processing search results
INFO:chatterbot.chatterbot:Similar text found: What is your name? 1.0
INFO:chatterbot.chatterbot:Using "What is your name?" as a close match to "What is your name?" with a confidence of 1.0
INFO:chatterbot.chatterbot:0. Excluding recent repeated response of "Today's date is Tue Aug 4, 2020"
INFO:chatterbot.chatterbot:No responses found. Generating alternate response list.
INFO:chatterbot.chatterbot:No known response to the input was found. Selecting a random response.
INFO:chatterbot.chatterbot:BestMatch selected "i certainly do at times." as a response with a confidence of 0

Бот находит совпадение с вопросом «Как вас зовут?», Но затем отбрасывает его в пользу случайного ответа. Это поведение согласуется каждый раз, когда я повторно инициализирую бота, и если я удаляю db и начинаю с fre sh db. У меня плохая конфигурация?

Спасибо!

Отметить

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...