notice
This is documentation for Rasa Documentation v2.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.x).
rasa.core.featurizers.single_state_featurizer
SingleStateFeaturizer Objects
Base class to transform the dialogue state into an ML format.
Subclasses of SingleStateFeaturizer will decide how a bot will
transform the dialogue state into a dictionary mapping an attribute
to its features. Possible attributes are: INTENT, TEXT, ACTION_NAME,
ACTION_TEXT, ENTITIES, SLOTS and ACTIVE_LOOP. Each attribute will be
featurized into a list of rasa.utils.features.Features
.
__init__
Initialize the single state featurizer.
prepare_for_training
Gets necessary information for featurization from domain.
Arguments:
domain
- An instance of :class:rasa.shared.core.domain.Domain
.interpreter
- The interpreter used to encode the statebilou_tagging
- indicates whether BILOU tagging should be used or not
encode_state
Encodes the given state with the help of the given interpreter.
Arguments:
state
- The state to encodeinterpreter
- The interpreter used to encode the state
Returns:
A dictionary of state_type to list of features.
encode_entities
Encodes the given entity data with the help of the given interpreter.
Produce numeric entity tags for tokens.
Arguments:
entity_data
- The dict containing the text and entity labels and locationsinterpreter
- The interpreter used to encode the statebilou_tagging
- indicates whether BILOU tagging should be used or not
Returns:
A dictionary of entity type to list of features.
encode_all_labels
Encodes all labels from the domain using the given interpreter.
Arguments:
domain
- The domain that contains the labels.interpreter
- The interpreter used to encode the labels.
Returns:
A list of encoded labels.
encode_all_actions
Encodes all actions from the domain using the given interpreter.
This method is deprecated and will be removed in Rasa Open Source 3.0.0 .
It is recommended to use encode_all_labels
instead.
Arguments:
domain
- The domain that contains the actions.interpreter
- The interpreter used to encode the actions.
Returns:
A list of encoded actions.
IntentTokenizerSingleStateFeaturizer Objects
A SingleStateFeaturizer for use with policies that predict intent labels.
encode_all_labels
Encodes all relevant labels from the domain using the given interpreter.
Arguments:
domain
- The domain that contains the labels.interpreter
- The interpreter used to encode the labels.
Returns:
A list of encoded labels.
BinarySingleStateFeaturizer Objects
Dialogue State featurizer which features the state as binaries.
__init__
Creates featurizer.