notice
This is documentation for Rasa & Rasa Pro Documentation v2.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.x).
rasa.shared.nlu.training_data.features
Features Objects
Stores the features produced by any featurizer.
__init__
Initializes the Features object.
Arguments:
features
- The features.feature_type
- Type of the feature, e.g. FEATURE_TYPE_SENTENCE.attribute
- Message attribute, e.g. INTENT or TEXT.origin
- Name of the component that created the features.
is_sparse
Checks if features are sparse or not.
Returns:
True, if features are sparse, false otherwise.
is_dense
Checks if features are dense or not.
Returns:
True, if features are dense, false otherwise.
combine_with_features
Combine the incoming features with this instance's features.
Arguments:
additional_features
- additional features to add
Returns:
Combined features.
__key__
Returns a 4-tuple of defining properties.
Returns:
Tuple of type, attribute, features, and origin properties.
__eq__
Tests if the self
Feature
equals to the other
.
Arguments:
other
- The other object.
Returns:
True
when the other object is a Feature
and has the same
type, attribute, and feature tensors.