Components
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.
Word Vector Sources
MitieNLP
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:
pipeline:
- name: "MitieNLP"
# language model to load
model: "data/total_word_feature_extractor.dat"
SpacyNLP
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:
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
Short: MITIE intent featurizer
Outputs: nothing, used as an input to intent classifiers that need intent features (e.g. SklearnIntentClassifier)
Requires: MitieNLP
Type: Dense featurizer
Description: Creates feature for intent classification using the MITIE featurizer.
Configuration:
pipeline:
- name: "MitieFeaturizer"
SpacyFeaturizer
Short: spacy intent featurizer
Outputs: nothing, used as an input to intent classifiers that need intent features (e.g. SklearnIntentClassifier)
Requires: SpacyNLP
Type: Dense featurizer
Description: Creates feature for intent classification using the spacy featurizer.
Configuration:
pipeline:
- name: "SpacyFeaturizer"
Intent Classifiers
MitieIntentClassifier
Short: MITIE intent classifier
Outputs: intent
Requires: A tokenizer and a featurizer
Output-Example:
{
"intent": {"name": "greet", "confidence": 0.98343}
}
Configuration:
pipeline:
- name: "MitieIntentClassifier"
SklearnIntentClassifier
Short: sklearn intent classifier
Outputs: intent and intent_ranking
Requires: A featurizer
Output-Example:
{
"intent": {"name": "greet", "confidence": 0.78343},
"intent_ranking": [
{
"confidence": 0.1485910906220309,
"name": "goodbye"
},
{
"confidence": 0.08161531595656784,
"name": "restaurant_search"
}
]
}
Configuration:
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
Short: Response Selector
Outputs: A dictionary with key as direct_response_intent and value containing response and ranking
Requires: A featurizer
Output-Example:
{
"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
Short: Tokenizer using whitespaces as a separator
Outputs: nothing
Requires: nothing
Description: Creates a token for every whitespace separated character sequence.
Configuration:
pipeline:
- name: "WhitespaceTokenizer"
case_sensitive: false
MitieTokenizer
Short: Tokenizer using MITIE
Outputs: nothing
Requires: MitieNLP
Description: Creates tokens using the MITIE tokenizer.
Configuration:
pipeline:
- name: "MitieTokenizer"
Entity Extractors
MitieEntityExtractor
Short: MITIE entity extraction
Outputs: appends entities
Requires: MitieNLP
Output-Example:
{
"entities": [{
"value": "New York City",
"start": 20,
"end": 33,
"confidence": null,
"entity": "city",
"extractor": "MitieEntityExtractor"
}]
}
Configuration:
pipeline:
- name: "MitieEntityExtractor"