Created
April 11, 2018 04:37
-
-
Save RootPat/81a8c9c9dc1b31091221d72278d666c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from chatterbot import ChatBot | |
# Uncomment the following lines to enable verbose logging | |
# import logging | |
# logging.basicConfig(level=logging.INFO) | |
# Create a new instance of a ChatBot | |
bot = ChatBot( | |
"SQLMemoryTerminal", | |
storage_adapter='chatterbot.storage.SQLStorageAdapter', | |
logic_adapters=[ | |
"chatterbot.logic.MathematicalEvaluation", | |
"chatterbot.logic.TimeLogicAdapter", | |
"chatterbot.logic.BestMatch" | |
], | |
input_adapter="chatterbot.input.TerminalAdapter", | |
output_adapter="chatterbot.output.TerminalAdapter", | |
) | |
print("Type something to begin...") | |
# The following loop will execute each time the user enters input | |
while True: | |
try: | |
# We pass None to this method because the parameter | |
# is not used by the TerminalAdapter | |
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