Version: Main/Unreleased
rasa.nlu.featurizers.featurizer
Featurizer Objects
class Featurizer(Generic[FeatureType], ABC)
Base class for all featurizers.
get_default_config
@staticmethod
def get_default_config() -> Dict[Text, Any]
Returns the component's default config.
__init__
def __init__(name: Text, config: Dict[Text, Any]) -> None
Instantiates a new featurizer.
Arguments:
config
- configurationname
- a name that can be used as identifier, in case the configuration does not specify analias
(or thisalias
is None)
validate_config
@classmethod
@abstractmethod
def validate_config(cls, config: Dict[Text, Any]) -> None
Validates that the component is configured properly.
add_features_to_message
def add_features_to_message(sequence: FeatureType,
sentence: Optional[FeatureType], attribute: Text,
message: Message) -> None
Adds sequence and sentence features for the attribute to the given message.
Arguments:
sequence
- sequence feature matrixsentence
- sentence feature matrixattribute
- the attribute which both features describemessage
- the message to which we want to add those features
raise_if_featurizer_configs_are_not_compatible
@staticmethod
def raise_if_featurizer_configs_are_not_compatible(
featurizer_configs: Iterable[Dict[Text, Any]]) -> None
Validates that the given configurations of featurizers can be used together.
Raises:
InvalidConfigException
if the given featurizers should not be used in
the same graph.