Customize which components get used in a request

I’m interested in using the same NLU model for a number of tasks, and want to be able to inform certain components they can be skipped in certain contexts.

An example would be an NLU pipeline that has

  • tokenizer
  • featurizer
  • regex entity extractor
  • crf entity extractor
  • intent classification

In some settings, I want the full pipeline. In others, I may want lower latency and am happy with only getting the result of the RegexEntityExtractor back.

Another example would be a component that reaches out to a data source for looking up an extracted entity, and I want to be able to control whether the lookup happens in different environments/contexts.

Is there a pattern for that kind of thing? In old rasa, I probably would have just hosted several models in different projects.

If the best solution is to host my own server that accepts more params in /parse that’s okay, though I’d also love thoughts on if there are clever ways to skip certain components when calling nlu_interpreter.parse()