Skip to content

Commit

Permalink
Update training parameter for docs and examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunthercox committed Sep 7, 2016
1 parent 287dbae commit 796380d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 27 deletions.
7 changes: 0 additions & 7 deletions docs/index.rst
Expand Up @@ -29,13 +29,6 @@ The language independent design of ChatterBot allows it to be trained to speak a
Additionally, the machine-learning nature of ChatterBot allows an agent instance to improve
it's own knowledge of possible responses as it interacts with humans and other sources of informative data.

Training
========

ChatterBot comes with a data utility module that can be used to train chat bots.
Lists of statements representing conversations can also be used for training.
More information is available in the :ref:`training documentation <set_trainer>`

Report an Issue
===============

Expand Down
2 changes: 1 addition & 1 deletion docs/training.rst
Expand Up @@ -2,7 +2,7 @@
Training
========

ChatterBot has tools that simplify the process of training a bot instance.
ChatterBot has tools that simplify the process of training a chat bot instance.
These tools range from simple utility methods that update relations of known
statements, to a corpus of pre-loaded training data that you can use.

Expand Down
9 changes: 5 additions & 4 deletions examples/export_example.py
@@ -1,16 +1,17 @@
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer

'''
This is an example showing how to create an export file from
an existing chat bot that can then be used to train other bots.
'''

chatbot = ChatBot("Export Example Bot")
chatbot = ChatBot(
'Export Example Bot',
trainer='chatterbot.trainers.ChatterBotCorpusTrainer'
)

# First, lets train our bot with some data
chatbot.set_trainer(ChatterBotCorpusTrainer)
chatbot.train("chatterbot.corpus.english")
chatbot.train('chatterbot.corpus.english')

# Now we can export the data to a file
chatbot.trainer.export_for_training('./myfile.json')
17 changes: 8 additions & 9 deletions examples/hipchat_bot.py
@@ -1,5 +1,4 @@
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
from settings import HIPCHAT

'''
Expand All @@ -8,16 +7,16 @@
'''

chatbot = ChatBot(
"HipChatBot",
hipchat_host=HIPCHAT["HOST"],
hipchat_room=HIPCHAT["ROOM"],
hipchat_access_token=HIPCHAT["ACCESS_TOKEN"],
input_adapter="chatterbot.adapters.input.HipChat",
output_adapter="chatterbot.adapters.output.HipChat"
'HipChatBot',
hipchat_host=HIPCHAT['HOST'],
hipchat_room=HIPCHAT['ROOM'],
hipchat_access_token=HIPCHAT['ACCESS_TOKEN'],
input_adapter='chatterbot.adapters.input.HipChat',
output_adapter='chatterbot.adapters.output.HipChat',
trainer='chatterbot.trainers.ChatterBotCorpusTrainer'
)

chatbot.set_trainer(ChatterBotCorpusTrainer)
chatbot.train("chatterbot.corpus.english")
chatbot.train('chatterbot.corpus.english')

# The following loop will execute each time the user enters input
while True:
Expand Down
7 changes: 4 additions & 3 deletions readme.es.md
Expand Up @@ -34,10 +34,11 @@ pip install chatterbot

```
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
chatbot = ChatBot("Ron Obvious")
chatbot.set_trainer(ChatterBotCorpusTrainer)
chatbot = ChatBot(
'Ron Obvious',
trainer='chatterbot.trainers.ChatterBotCorpusTrainer'
)
# Enseñar de acuerdo al corpus español
chatbot.train("chatterbot.corpus.spanish")
Expand Down
7 changes: 4 additions & 3 deletions readme.md
Expand Up @@ -42,10 +42,11 @@ pip install chatterbot

```
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
chatbot = ChatBot("Ron Obvious")
chatbot.set_trainer(ChatterBotCorpusTrainer)
chatbot = ChatBot(
'Ron Obvious',
trainer='chatterbot.trainers.ChatterBotCorpusTrainer'
)
# Train based on the english corpus
chatbot.train("chatterbot.corpus.english")
Expand Down

0 comments on commit 796380d

Please sign in to comment.