Pipeline Behaviour

Hi everyone!

I’m creating a custom pipeline. I wanted to know how does the Rasa pipeline works.

For example, it is used just when you run rasa train command, or when someone sends a message to the bot?

Other question: how does it affects the number of intents? Every word from our sentence runs on the pipeline?

Thanks in advance!

The pipeline you define in your config file is used during training and prediction time. Every phrase/sentence you define in you NLU data will be processed by the components you defined in your pipeline. The order is kept. Let’s look at an example:

NLU data

# intent:request_restaurant
- I am looking for an [Italian](cuisine) restaurant
- ...

config.yml

language: "en"
pipeline:
- name: "WhitespaceTokenizer"
- name: "CRFEntityExtractor"
- name: "CountVectorsFeaturizer"
- name: "EmbeddingIntentClassifier"

The sentence (“I am looking for an Italian restaurant”) gets first tokenize by the WhitespaceTokenizer, afterwards the model for the entity extraction is trained to extract entities (e.g. Italian = cuisine). Then the CountVectorFeatuirzer extracts some features out of the sentence, which are used in the EmbddingIntentClassifier to predict the intent of the message.

When you run the bot via, for example, rasa shell, the trained models are used to predict the entities and the intent of the incoming messages. The same pipeline is used.

The number of intents does not matter for the pipeline.