i want to test my trained Chatterbot in a djano view like this:
from chatterbot import ChatBot
Male_bot = ChatBot(
"Male_bot",
storage_adapter={'import_path': 'chatterbot.storage.SQLStorageAdapter','database': 'Male'},
logic_adapters=[{
"import_path": "chatterbot.logic.BestMatch",},
{
'import_path': 'chatterbot.logic.LowConfidenceAdapter',
'threshold': 0.95,
'default_response': 'UNK' },])
reply = Male_bot.get_response(New_H)
i was using this way when i worked with it locally in my computer but with Django it seems to create a new instance.
So how i can use a trained Chatbot?
Did you try to train the bot initially and export the model into .yml or .json files?
if not then you can export it as shown below
chatbot = ChatBot('Export Example Bot')
chatbot.trainer.export_for_training('./export.yml')
Later you can use this trained model in your django application by specifying the training data location in your settings.py file.
More details can be found here
http://chatterbot.readthedocs.io/en/stable/corpus.html?highlight=export
@vhr121 i created the chatterbot and locating the training corps in the setting file then i trained it with python3 manage.py train and the DB was created..in my view i just want to call this trained chatbot and use it
@vhr121 is there a way to do this in Django? http://chatterbot.readthedocs.io/en/stable/corpus.html?highlight=export
No, I think you have to write a management command similar to train https://github.com/gunthercox/ChatterBot/blob/master/chatterbot/ext/django_chatterbot/management/commands/train.py
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.