# Components

## Note
For clarity, we have renamed the pre-defined pipelines to reflect what they _do_ rather than which libraries they use as of Rasa NLU 0.15. The `tensorflow_embedding` pipeline is now called `supervised_embeddings`, and `spacy_sklearn` is now known as `pretrained_embeddings_spacy`. Please update your code if you are using these.

This is a reference of the configuration options for every built-in component in Rasa NLU. If you want to build a custom component, check out [Custom NLU Components](https://legacy-docs-v1.rasa.com/1.7.2/api/custom-nlu-components/#custom-nlu-components).

## Word Vector Sources

### [MitieNLP](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#id11)

**Short**: MITIE initializer

**Outputs**: nothing

**Requires**: nothing

**Description**: Initializes mitie structures. Every mitie component relies on this, hence this should be put at the beginning of every pipeline that uses any mitie components.

**Configuration**:
```yaml
pipeline:
- name: "MitieNLP"
  # language model to load
  model: "data/total_word_feature_extractor.dat"
```

### [SpacyNLP](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#id12)

**Short**: spacy language initializer

**Outputs**: nothing

**Requires**: nothing

**Description**: Initializes spacy structures. Every spacy component relies on this, hence this should be put at the beginning of every pipeline that uses any spacy components.

**Configuration**:
```yaml
pipeline:
- name: "SpacyNLP"
  # language model to load
  model: "en_core_web_md"

# when retrieving word vectors, this will decide if the casing
  # of the word is relevant. E.g. `hello` and `Hello` will
  # retrieve the same vector, if set to `false`. For some
  # applications and models it makes sense to differentiate
  # between these two words, therefore setting this to `true`.
  case_sensitive: false
```

## Text Featurizers

Text featurizers are divided into two different categories: sparse featurizers and dense featurizers. Sparse featurizers are featurizers that return feature vectors with a lot of missing values, e.g. zeros. As those feature vectors would normally take up a lot of memory, we store them as sparse features.

### [MitieFeaturizer](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#id14)

**Short**: MITIE intent featurizer

**Outputs**: nothing, used as an input to intent classifiers that need intent features (e.g. `SklearnIntentClassifier`)

**Requires**: [MitieNLP](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#mitienlp)

**Type**: Dense featurizer

**Description**: Creates feature for intent classification using the MITIE featurizer.

**Configuration**:
```yaml
pipeline:
- name: "MitieFeaturizer"
```

### [SpacyFeaturizer](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#id15)

**Short**: spacy intent featurizer

**Outputs**: nothing, used as an input to intent classifiers that need intent features (e.g. `SklearnIntentClassifier`)

**Requires**: [SpacyNLP](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#spacynlp)

**Type**: Dense featurizer

**Description**: Creates feature for intent classification using the spacy featurizer.

**Configuration**:
```yaml
pipeline:
- name: "SpacyFeaturizer"
```

## Intent Classifiers

### [MitieIntentClassifier](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#id20)

**Short**: MITIE intent classifier

**Outputs**: `intent`

**Requires**: A tokenizer and a featurizer

**Output-Example**:
```json
{
    "intent": {"name": "greet", "confidence": 0.98343}
}
```

**Configuration**:
```yaml
pipeline:
- name: "MitieIntentClassifier"
```

### [SklearnIntentClassifier](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#id21)

**Short**: sklearn intent classifier

**Outputs**: `intent` and `intent_ranking`

**Requires**: A featurizer

**Output-Example**:
```json
{
    "intent": {"name": "greet", "confidence": 0.78343},
    "intent_ranking": [
        {
            "confidence": 0.1485910906220309,
            "name": "goodbye"
        },
        {
            "confidence": 0.08161531595656784,
            "name": "restaurant_search"
        }
    ]
}
```

**Configuration**:
```yaml
pipeline:
- name: "SklearnIntentClassifier"
  # Specifies the list of regularization values to
  # cross-validate over for C-SVM.
  # This is used with the ``kernel`` hyperparameter in GridSearchCV.
  C: [1, 2, 5, 10, 20, 100]
  # Specifies the kernel to use with C-SVM.
  # This is used with the ``C`` hyperparameter in GridSearchCV.
  kernels: ["linear"]
```

## Selectors

### [Response Selector](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#id25)

**Short**: Response Selector

**Outputs**: A dictionary with key as `direct_response_intent` and value containing `response` and `ranking`

**Requires**: A featurizer

**Output-Example**:
```json
{
    "text": "What is the recommend python version to install?",
    "entities": [],
    "intent": {
        "confidence": 0.6485910906220309,
        "name": "faq"
    },
    "intent_ranking": [
        {
            "confidence": 0.6485910906220309,
            "name": "faq"
        },
        {
            "confidence": 0.1416153159565678,
            "name": "greet"
        }
    ],
    "response_selector": {
      "faq": {
        "response": {
            "confidence": 0.7356462617,
            "name": "Supports 3.5, 3.6 and 3.7, recommended version is 3.6"
        },
        "ranking": [
            {
                "confidence": 0.7356462617,
                "name": "Supports 3.5, 3.6 and 3.7, recommended version is 3.6"
            },
            {
                "confidence": 0.2134543431,
                "name": "You can ask me about how to get started"
            }
        ]
      }
    }
}
```

## Tokenizers

### [WhitespaceTokenizer](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#id27)

**Short**: Tokenizer using whitespaces as a separator

**Outputs**: nothing

**Requires**: nothing

**Description**: Creates a token for every whitespace separated character sequence.

**Configuration**:
```yaml
pipeline:
- name: "WhitespaceTokenizer"
  case_sensitive: false
```

### [MitieTokenizer](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#id29)

**Short**: Tokenizer using MITIE

**Outputs**: nothing

**Requires**: [MitieNLP](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#mitienlp)

**Description**: Creates tokens using the MITIE tokenizer.

**Configuration**:
```yaml
pipeline:
- name: "MitieTokenizer"
```

## Entity Extractors

### [MitieEntityExtractor](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#id33)

**Short**: MITIE entity extraction

**Outputs**: appends `entities`

**Requires**: [MitieNLP](https://legacy-docs-v1.rasa.com/1.7.2/nlu/components/#mitienlp)

**Output-Example**:
```json
{
    "entities": [{
                  "value": "New York City",
                  "start": 20,
                  "end": 33,
                  "confidence": null,
                  "entity": "city",
                  "extractor": "MitieEntityExtractor"
                }]
}
```

**Configuration**:
```yaml
pipeline:
- name: "MitieEntityExtractor"
```

---
