Running Rasa NLU and Core Separately

Hi. Wish everybody reading this are well!

I was wondering if i could run Rasa NLU and Rasa Core separately. I need to do that because we need to run a custom process between them (After NLU and before Core). According to NLU output, the middle process will decide if running Rasa Core or a module of our own for Similarity Matching.

I would be so pleased if you could help me about. Many Thanks!

Hello,

AFAIK, if you want to run Rasa server with command rasa run, you cannot run rasa NLU and Core separately. If you want to have some processes between NLU and Core while maintaining Rasa’s normal procedure, what you can do is to put whatever middle process that you need to do inside a custom NLU component and put your Similarity Matching system inside Custom Actions.

Another way to do this is to run the server fully with Python by calling rasa.nlu.model.Interpreter and rasa.core.agent.Agent separately, then do something like this:

nlu_model = Interpreter.load("path/to/nlu/model")
core_model = Agent.load_local_model("path/to/core/model")
message = nlu_model(input)

# Do middle process here

if match_middle_process:
    # do similarity matching
else:
    core_model.handle_message(message)