gunthercox / chatterbot-corpus

A multilingual dialog corpus
http://chatterbot-corpus.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.37k stars 1.14k forks source link

Tranning data taking ages, alternatives? #104

Closed mcpeixoto closed 5 years ago

mcpeixoto commented 6 years ago

My code:

`from chatterbot import ChatBot from chatterbot.trainers import ListTrainer import os

bot = ChatBot('Bot') bot.set_trainer(ListTrainer)

for files in os.listdir('PATH TO DATA'): data = open('PATH TO DATA' + files, 'r', encoding="utf8").readlines() bot.train(data)

while True: message = input('You:') if message.strip() != 'Bye':

    reply = bot.get_response(message)
    print('Chatbot :', reply)
if message.strip() == 'Bye':
        print('ChatBot : Bye')
        break`

Heya! I have this tranning data but when I start the program It takes ages on "List Trainer".... Can't I train the data one time and put it in a file or something and never train it again?

gunthercox commented 6 years ago

Each time the chat bot is trained it changes how the bot will respond, training is however only required to be done once.

mcpeixoto commented 6 years ago

Second day and it's 60%, where is the data saved? I see some "db.sqlite3" files beeing created, it inicializes withing those data next time I start the chatbot or I have to specify the path?

gunthercox commented 6 years ago

Second day and it's 60%, where is the data saved?

The data is saved in a database which is named db.sqlite3 by default. I am aware of the speed issues that currently exist an I am working on changes that should decrease training and response times significantly.

I see some "db.sqlite3" files beeing created, it inicializes withing those data next time I start the chatbot or I have to specify the path?

db.sqlite3 is the default database name, but you can specify a different name by passing a parameter, for example: database_uri='xxx.sqlite3'

mcpeixoto commented 6 years ago

Thank you so much!!

gunthercox commented 5 years ago

I'm going to close this ticket. Keep an eye out for the 1.0 release with the improvements mentioned above. https://github.com/gunthercox/ChatterBot/releases