Skip to content

Instantly share code, notes, and snippets.

@RootPat
Last active April 11, 2018 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RootPat/b9cbda237253c50e17e668379d080872 to your computer and use it in GitHub Desktop.
Save RootPat/b9cbda237253c50e17e668379d080872 to your computer and use it in GitHub Desktop.
from chatterbot import ChatBot
# Uncomment the following lines to enable verbose logging
# import logging
# logging.basicConfig(level=logging.INFO)
# Create a new ChatBot instance
bot = ChatBot(
'Terminal',
storage_adapter='chatterbot.storage.MongoDatabaseAdapter',
logic_adapters=[
'chatterbot.logic.BestMatch'
],
filters=[
'chatterbot.filters.RepetitiveResponseFilter'
],
input_adapter='chatterbot.input.TerminalAdapter',
output_adapter='chatterbot.output.TerminalAdapter',
database='chatterbot-database'
)
print('Type something to begin...')
while True:
try:
bot_input = bot.get_response(None)
# Press ctrl-c or ctrl-d on the keyboard to exit
except (KeyboardInterrupt, EOFError, SystemExit):
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment