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
I'm study the lib and I had a error in my first test, return o character as response.
the code:
I used a subdirectory with 4 .yml for training in treinadores: example format:
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