Hey,
I have built my bot with NLU and Core and use the GUI from https://github.com/scalableminds/chatroom. I also read this nice blog: http://smithstrategy.com/index.php/2018/03/14/chatbot-tutorial-nlu-in-docker-container/
My bot looks just like that.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from rasa_core.agent import Agent
from rasa_core.channels.console import ConsoleInputChannel
from rasa_core.interpreter import RegexInterpreter
from rasa_core.policies.keras_policy import KerasPolicy
from rasa_core.policies.memoization import MemoizationPolicy
from rasa_core.interpreter import RasaNLUInterpreter
from bot_server_channel import BotServerInputChannel
logger = logging.getLogger(__name__)
def train_dialogue(domain_file = 'domain.yml',
model_path = './models/dialogue',
training_data_file = './data/stories.md'):
agent = Agent(domain_file, policies = [MemoizationPolicy(),KerasPolicy()])#MemoizationPolicy(),
agent.train(
training_data_file,
max_history = 3,
epochs = 300,
batch_size = 15,
validation_split = 0.0,
augmentation_factor = 0)
agent.persist(model_path)
return agent
def run_bot(serve_forever=True):
interpreter = RasaNLUInterpreter('./nlu')
agent = Agent.load('./models/dialogue', interpreter = interpreter)
channel = BotServerInputChannel(agent)
agent.handle_channel(channel)
if __name__ == '__main__':
run_bot()
I am a docker newbie and so it seems simple to start to just docker this and let the GUI outside? Would I just just docker this complete code as a python code? What would I have to do with the GUI then. In the GUI I have to give the host where NLU is listening to. So I just give this port inside the dockerfile?