I was wondering if there was a slimmer version of rasa.nlu optimized for inference.
pip install rasa
installs a lot of dependencies (e.g matplotlib), that are not relevant for inference in production.
This could be helpful in case you want to deploy a model with limited resources, like on AWS Lambdas. Here is my minimal code for inference:
from rasa.nlu.model import Interpreter
PATH_TO_MODEL_FILE = "./test_nlu_model"
# load model
nlu_interpreter = Interpreter.load(PATH_TO_MODEL_FILE)
# here is what should happen on each inference call
input_message = "how much do I have on my credit card?"
res = nlu_interpreter.parse(input_message)
# get intent, confidenc and entities
print((res["intent"]["name"], res["intent"]["confidence"], res["entities"]))