<p>I'm not sure if this is the right one, but according to the <a href="https://github.com/gunthercox/ChatterBot" rel="nofollow noreferrer">documentation</a> you need to create a trainer for it:</p>

<pre><code>from chatterbot.trainers import ChatterBotCorpusTrainer

# Create a new trainer for the chatbot
trainer = ChatterBotCorpusTrainer(chatbot)

# Train based on the english corpus
trainer.train("chatterbot.corpus.english")
</code></pre>

<p>Instead of "chatterbot.corpus.english" you obviously choose your own training data.</p>

CC BY-SA 4.0
2018-11-07T10:42:06.693Z
Basically, I just need to put my corpus, put in the chatbot folder and import on that page?
Mariana Bayonetta
CC BY-SA 4.0
2018-11-07T12:14:22.857Z
That's how I understand it. Not sure what format the corpus needs to be in -- you might have to look at the other example data sets.
Oliver Mason
CC BY-SA 4.0
2018-11-06T16:23:21.993Z
2018-11-06T16:23:21.993Z
Oliver Mason
<p>I created a very simple bot to learn how to use chatterbot. This library already comes with a training, but I wanted extra training with an import of a corpus in Portuguese that I found in github.</p>

<pre><code>from chatterbot import ChatBot

bot = Futaba(
"Terminal",
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",
database_uri="../database.db"
)

print("Type something to begin...")

while True:
    try:
        bot_input = bot.get_response(None)
    except (KeyboardInterrupt, EOFError, SystemExit):
        break
</code></pre>

<p>That's all I have.</p>

<p>How can I import this corpus into my chatbot?</p>

CC BY-SA 4.0
2018-11-06T11:23:24.410Z
I'm voting to close this question as off-topic because it's not really about AI, but about an implementation detail with a particular software package, which happens to be on an AI-related topic.
Oliver Mason
CC BY-SA 4.0
2018-11-06T11:25:20.710Z
Wow, but then I do not understand. If I ask questions about developing a chatbot in a programming forum the question is closed because it refers to AI. If I ask in an AI forum close for not being on IA.
Mariana Bayonetta
CC BY-SA 4.0
2018-11-06T13:35:20.627Z
This seems to me to be about a specific piece of software. To answer that question you need no expertise in AI, so that's my reasoning. I have worked with/in AI for about 20+ years, and I have no clue how to answer your question.  I don't even know what library you are talking about, so I cannot look up the documentation for it.
Oliver Mason
CC BY-SA 4.0
2018-11-06T14:36:50.670Z
Chatterbot for python
Mariana Bayonetta
CC BY-SA 4.0
2020-06-02T22:58:14.147Z
Programming issues are off-topic here. Please, read https://ai.stackexchange.com/help/on-topic for more details and to understand which questions are on-topic here. If you have a programming issue, the best place to ask your question is Stack Overflow.
nbro
<training><python><chat-bots>
How to add external training in chatterbot?
Mariana Bayonetta
# How to add external training in chatterbot?

(Asked by: username_0 on 2018-11-06)

I created a very simple bot to learn how to use chatterbot. This library already comes with a training, but I wanted extra training with an import of a corpus in Portuguese that I found in github.
from chatterbot import ChatBot

bot = Futaba(
"Terminal",
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",
database_uri="../database.db"
)

print("Type something to begin...")

while True:
    try:
        bot_input = bot.get_response(None)
    except (KeyboardInterrupt, EOFError, SystemExit):
        break

That's all I have.
How can I import this corpus into my chatbot?

**Tags:** training, python, chat-bots

> **Comments:**
> **username_1**: I'm voting to close this question as off-topic because it's not really about AI, but about an implementation detail with a particular software package, which happens to be on an AI-related topic.  
> **username_0**: Wow, but then I do not understand. If I ask questions about developing a chatbot in a programming forum the question is closed because it refers to AI. If I ask in an AI forum close for not being on IA.  
> **username_1**: This seems to me to be about a specific piece of software. To answer that question you need no expertise in AI, so that's my reasoning. I have worked with/in AI for about 20+ years, and I have no clue how to answer your question.  I don't even know what library you are talking about, so I cannot look up the documentation for it.  
> **username_0**: Chatterbot for python  
> **username_2**: Programming issues are off-topic here. Please, read https://ai.stackexchange.com/help/on-topic for more details and to understand which questions are on-topic here. If you have a programming issue, the best place to ask your question is Stack Overflow.  

---

## 1 answers

### Answer by username_1 on 2018-11-06. Score: 1

I'm not sure if this is the right one, but according to the documentation you need to create a trainer for it:
from chatterbot.trainers import ChatterBotCorpusTrainer

# Create a new trainer for the chatbot
trainer = ChatterBotCorpusTrainer(chatbot)

# Train based on the english corpus
trainer.train("chatterbot.corpus.english")

Instead of "chatterbot.corpus.english" you obviously choose your own training data.

> **Comments:**
> **username_0**: Basically, I just need to put my corpus, put in the chatbot folder and import on that page?  
> **username_1**: That's how I understand it. Not sure what format the corpus needs to be in -- you might have to look at the other example data sets.  

---

