RasaHQ / rasa-nlu-examples

This repository contains examples of custom components for educational purposes.

Home Page:https://RasaHQ.github.io/rasa-nlu-examples/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A custom component that can execute other components in parallel

dingusagar opened this issue · comments

Currently all the components in nlu execute in a sequential manner. But many a times, a couple of components can be executed in parallel.

For eg, DucklingEntityExtracter and another custom component like SentimentClassifier can be executed parallely since there is no dependency between them.

This way can we bring down the overall prediction time ?

Thanks for the issue, @desmarchris will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

Theoretically, this could indeed happen in parallel. But the question is if the parallelism overhead is worth it. You will need to start a pool of resources that is tasked with tracking tasks in queues.

Another practicality is that we don't know upfront what the entity models require. Maybe they only need a tokenizer, maybe they require some features as well, and ... technically, they may also depend on the output of the intent classifier.

You're free to explore and benchmark the idea if you're interested, but for sake of simplicity, I'd prefer to simply stick to the pipeline implementation inside of Rasa. The goal of this repo is to contribute components that are compatible with the latest Rasa version, not to overwrite main implementations inside of Rasa.