# Choosing a Pipeline

Choosing an NLU pipeline allows you to customize your model and finetune it on your dataset.

## [The Short Answer](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#the-short-answer)  
If your training data is in English, a good starting point is using `pretrained_embeddings_convert` pipeline.

```
language: "en"

pipeline: "pretrained_embeddings_convert"
```

In case your training data is multilingual and is rich with domain-specific vocabulary, use the `supervised_embeddings` pipeline:

```
language: "en"

pipeline: "supervised_embeddings"
```

## [A Longer Answer](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#a-longer-answer)  
The three most important pipelines are `supervised_embeddings`, `pretrained_embeddings_convert`, and `pretrained_embeddings_spacy`. The `pretrained_embeddings_spacy` pipeline uses pre-trained word vectors from either GloVe or fastText, whereas `pretrained_embeddings_convert` uses a pretrained sentence encoding model [ConveRT](https://github.com/PolyAI-LDN/polyai-models) to extract vector representations of complete user utterance as a whole. On the other hand, the `supervised_embeddings` pipeline doesn’t use any pre-trained word vectors or sentence vectors, but instead fits these specifically for your dataset.

### [pretrained_embeddings_spacy](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#pretrained-embeddings-spacy)  
The advantage of `pretrained_embeddings_spacy` pipeline is that if you have a training example like: "I want to buy apples", and Rasa is asked to predict the intent for "get pears", your model already knows that the words "apples" and "pears" are very similar.

### [pretrained_embeddings_convert](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#pretrained-embeddings-convert)  
> Warning  
> Since `ConveRT` model is trained only on an **English** corpus of conversations, this pipeline should only be used if your training data is in English language.

This pipeline uses [ConveRT](https://github.com/PolyAI-LDN/polyai-models) model to extract vector representation of a sentence and feeds them to `EmbeddingIntentClassifier` for intent classification.

### [supervised_embeddings](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#supervised-embeddings)  
The advantage of the `supervised_embeddings` pipeline is that your word vectors will be customized for your domain.

### [Comparing different pipelines for your data](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#comparing-different-pipelines-for-your-data)  
Rasa gives you the tools to compare the performance of both of these pipelines on your data directly.

## [Class imbalance](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#class-imbalance)  
Classification algorithms often do not perform well if there is a large class imbalance.

## [Multiple Intents](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#multiple-intents)  
If you want to split intents into multiple labels, you can only do this with the supervised embeddings pipeline.

## [Understanding the Rasa NLU Pipeline](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#understanding-the-rasa-nlu-pipeline)  
In Rasa NLU, incoming messages are processed by a sequence of components.

## [Component Lifecycle](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#component-lifecycle)  
Every component can implement several methods from the `Component` base class.

## [The “entity” object explained](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#the-entity-object-explained)  
After parsing, the entity is returned as a dictionary.

## [Pre-configured Pipelines](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#pre-configured-pipelines)  
A template is just a shortcut for a full list of components.

### [supervised_embeddings](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#section-supervised-embeddings-pipeline)  
To train a Rasa model in your preferred language, define the `supervised_embeddings` pipeline in your `config.yml`.

### [pretrained_embeddings_convert](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#section-pretrained-embeddings-convert-pipeline)  
To use the `pretrained_embeddings_convert` template.

### [pretrained_embeddings_spacy](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#section-pretrained-embeddings-spacy-pipeline)  
To use the `pretrained_embeddings_spacy` template.

### [MITIE](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#section-mitie-pipeline)  
To use the MITIE pipeline, you will have to train word vectors from a corpus.

### [Custom pipelines](https://legacy-docs-v1.rasa.com/1.5.3/nlu/choosing-a-pipeline/#custom-pipelines)  
You can run a fully custom pipeline by listing the names of the components you want to use.
