-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add training class for Ubuntu corpus
- Loading branch information
1 parent
bf1fd63
commit 817feaa
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ docs/_build/ | |
*.iml | ||
|
||
examples/settings.py | ||
examples/ubuntu_dialogs* |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from chatterbot import ChatBot | ||
import logging | ||
|
||
|
||
''' | ||
This is an example showing how to train a chat bot using the | ||
Ubuntu Corpus of conversation dialog. | ||
''' | ||
|
||
# Enable info level logging | ||
logging.basicConfig(level=logging.INFO) | ||
|
||
chatbot = ChatBot( | ||
'Example Bot', | ||
trainer='chatterbot.trainers.UbuntuCorpusTrainer' | ||
) | ||
|
||
# Start by training our bot with the Ubuntu corpus data | ||
chatbot.train() | ||
|
||
# Now let's get a response to a greeting | ||
response = chatbot.get_response('How are you doing today?') | ||
print(response) |