Search code examples
pythonchatbotchatterbot

Creating chatbot using chatterbot


I have installed chatterbot and now I am running a file using it but I am facing following error.....

OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

Please help me to fix this.

code is as following....

from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer


chatbot = ChatBot("Ron Obvious")



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

trainer = ChatterBotCorpusTrainer(chatbot)

trainer.train(conversation)

response = chatbot.get_response("Good morning!")
print(response)

Solution

  • you need to download the required packages

    try this

    python -m spacy download en