Skip to content

Instantly share code, notes, and snippets.

@math77
Created September 3, 2018 02:09
Show Gist options
  • Save math77/8c096634a39c92971f05853de8963c4a to your computer and use it in GitHub Desktop.
Save math77/8c096634a39c92971f05853de8963c4a to your computer and use it in GitHub Desktop.
ChatBot básico feito com Python3 e a biblioteca chatterbot.
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
chatbot = ChatBot("Jarvis")
conversation = [
"Olá",
"Oi, tudo bem?",
"Tudo ótimo, e com vc?",
"Tudo muito bem.",
"Como vai sua família?",
"Muito bem, e a sua?",
"Bem também.",
"Tenho que ir agora, até mais!!",
"Até, tchau!!!"
]
chatbot.set_trainer(ListTrainer)
chatbot.train(conversation)
response = chatbot.get_response("Oi, como vai?")
print(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment