gunthercox/chatterbot-corpus

I am geeting this error.. tried all the versions.

aryan9868 opened this issue · 1 comments

[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data] C:\Users\santosh.rawat\AppData\Roaming\nltk_data...
[nltk_data] Package averaged_perceptron_tagger is already up-to-
[nltk_data] date!
[nltk_data] Downloading package punkt to
[nltk_data] C:\Users\santosh.rawat\AppData\Roaming\nltk_data...
[nltk_data] Package punkt is already up-to-date!
[nltk_data] Downloading package stopwords to
[nltk_data] C:\Users\santosh.rawat\AppData\Roaming\nltk_data...
[nltk_data] Package stopwords is already up-to-date!
Traceback (most recent call last):
File "C:\Users\santosh.rawat\AppData\Local\Programs\Python\Python37\chatnew.py", line 13, in
chatbot.set_trainer(ListTrainer)
AttributeError: 'ChatBot' object has no attribute 'set_trainer'

Hi @aryan9868 Please take a look at your code and modify where set_trainer is being called from. Here is an example:

from chatterbot.trainers import ListTrainer

conversation = [
    "Hello",
    "Hi there!",
    "How are you doing?",
    "I'm doing great.",
    "That is good to hear",
    "Thank you.",
    "You're welcome."
]

trainer = ListTrainer(chatbot)

trainer.train(conversation)