Skip to content

Commit 1cddaa7

Browse files
committed
Added base chatbot.
1 parent 79e9a03 commit 1cddaa7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

chatbot.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from chatterbot import ChatBot
2+
from chatterbot.trainers import ChatterBotCorpusTrainer
3+
4+
5+
if __name__ == "__main__":
6+
chatbot = ChatBot(
7+
"Training example",
8+
storage_adapter="chatterbot.storage.SQLStorageAdapter",
9+
database_uri="sqlite:///database.sqlite3",
10+
)
11+
12+
trainer = ChatterBotCorpusTrainer(chatbot)
13+
14+
trainer.train("chatterbot.corpus.english")
15+
16+
# ubuntu_trainer = UbuntuCorpusTrainer(chatbot)
17+
# ubuntu_trainer.train()
18+
19+
while True:
20+
user_input = input("> ")
21+
print(chatbot.get_response(user_input), flush=True)

0 commit comments

Comments
 (0)