Changed trainers

This commit is contained in:
José Carlos Cuevas 2017-05-20 13:15:10 +02:00
parent a49f6130f0
commit 9ace3da9a6

View file

@ -13,6 +13,7 @@ from config import config
from simphaty import analyze
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer, ChatterBotCorpusTrainer
# Enable logging
@ -75,10 +76,12 @@ def randomchat(bot, update):
chat_history[update.message.chat_id] = msg
else:
chatbot.set_trainer(ListTrainer)
chatbot.train([prev, msg])
def initial_training(bot, update):
chatbot.set_trainer(ChatterBotCorpusTrainer)
chatbot.train("chatterbot.corpus.spanish")
bot.sendMessage(update.message.chat_id, text="Entrenamiento inicial completado.")