я следовал этому примеру , чтобы обучить моего болтуна с Ubuntu corpus
мой код следующий:
# import ChatBot
from chatterbot import ChatBot
# import Trainer
from chatterbot.trainers import UbuntuCorpusTrainer
# Declare a bot
bot = ChatBot('Zeus')
# Training
trainer3 = UbuntuCorpusTrainer(bot)
# Start by training our bot with the Ubuntu corpus data
trainer3.train()
# Get a response to an input statement
bot.get_response("Hello, how are you today?")
while True:
# Input from user
message = input('You: ')
# if message is not "Bye"
if message.strip() != 'Bye':
reply = bot.get_response(message)
print('Zeus:', reply)
# if message is "Bye"
if message.strip() == 'Bye':
print('Zeus: Bye')
break
Вывод показывает, что бот не получаетобучено с Ubuntu Corpus:
/usr/local/bin/python3.7 /home/user/Documents/python-workspace/zeus_bot/UbuntuCorpus.py
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data] /home/user/nltk_data...
[nltk_data] Package averaged_perceptron_tagger is already up-to-
[nltk_data] date!
[nltk_data] Downloading package stopwords to /home/user/nltk_data...
[nltk_data] Package stopwords is already up-to-date!
Training took 0.11888790130615234 seconds.
/usr/local/lib/python3.7/site-packages/chatterbot/corpus.py:38: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
return yaml.load(data_file)
You: Hi
Zeus: Hello, how are you today?
You: very well
Zeus: Hi
You: what news?
Zeus: Hello, how are you today?
You: i am fine
Zeus: Hi
You: Bye
Zeus: Bye
Process finished with exit code 0
не показывает процесс загрузки для обучения. когда я общаюсь с ботом, я получаю только ответ get и ничего больше.