gunthercox / chatterbot-corpus

A multilingual dialog corpus
http://chatterbot-corpus.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.36k stars 1.15k forks source link

Only return one character after trainer #176

Closed viniciusyaunner closed 4 years ago

viniciusyaunner commented 4 years ago

I'm study the lib and I had a error in my first test, return o character as response.

the code:

from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
import os

bot = ChatBot('teste')
treino = ListTrainer(bot)

diretorio = '/Users/archo/PycharmProjects/untield/venv/testechatbot/treinadores/'
for treinadores in os.listdir(diretorio):
    treino.train(diretorio + treinadores)

while True:
    req = str(input("Voce: "))
    req = bot.get_response(req)
    print('Bot: ' + str(req))

I used a subdirectory with 4 .yml for training in treinadores: example format:

categories:
  - pedidos
conversations:
 - - Gostaria de uma pizza grande 4 queijos
 - Anotado, mais alguma coisa?

console:

[nltk_data] Downloading package stopwords to /Users/archo/nltk_data... [nltk_data] Package stopwords is already up-to-date! [nltk_data] Downloading package averaged_perceptron_tagger to [nltk_data] /Users/archo/nltk_data... [nltk_data] Package averaged_perceptron_tagger is already up-to- [nltk_data] date! List Trainer: [####################] 100% List Trainer: [####################] 100% List Trainer: [####################] 100% List Trainer: [####################] 100% Voce: oi Bot: a Voce: como vai? Bot: e