AttributeError: 'ChatBot' object has no attribute 'set_trainer'

#coding: utf-8 *

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

    bot = ChatBot('BORIS')
    bot = bot.set_trainer(ListTrainer)

    for _file in os.listdir('Chats'): #percorrer os arquivos em chats
    	lines = open('Chats/' + _file, 'r').readlines() #lendo as linhas
    	bot.train(lines)

Ao rodar no terminal:

[nltk_data] Downloading package stopwords to
[nltk_data]     /home/francine/nltk_data...
[nltk_data]   Package stopwords is already up-to-date!
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data]     /home/francine/nltk_data...
[nltk_data]   Package averaged_perceptron_tagger is already up-to-
[nltk_data]       date!
Traceback (most recent call last):
  File "trainee.py", line 8, in <module>
    bot = bot.set_trainer(ListTrainer)
AttributeError: 'ChatBot' object has no attribute 'set_trainer'

Da esse erro, mas o moço de um vídeo fez exatamente assim e deu certo, não sei o que tem de errado

1 curtida

make sure you are viewing the latest version of the documentation for 1.0.0a3. The default ( stable ) will be for version 0.8.

Palavras ditas pelo gunthercox

Fonte: https://github.com/gunthercox/ChatterBot/issues/1555


1 curtida

como eu faço pra ver a versão? baixei pelo terminal usando o pip3

pip3 uninstall chatterbot
pip3 chatterbot==0.8.

1 curtida