notice
This is documentation for Rasa Open Source Documentation v2.0.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (2.3.x).
rasa.shared.nlu.training_data.message
Message Objects
as_dict_nlu
Get dict representation of message as it would appear in training data
build
Build a Message from UserUttered
data.
Arguments:
text
- text of a user's utteranceintent
- an intent of the user utteranceentities
- entities in the user's utteranceintent_metadata
- optional metadata for the intentexample_metadata
- optional metadata for the intent example
Returns:
Message
get_full_intent
Get intent as it appears in training data
get_combined_intent_response_key
Get intent as it appears in training data
get_sparse_features
Get all sparse features for the given attribute that are coming from the given list of featurizers. If no featurizers are provided, all available features will be considered.
Arguments:
attribute
- message attributefeaturizers
- names of featurizers to consider
Returns:
Sparse features.
get_dense_features
Get all dense features for the given attribute that are coming from the given list of featurizers. If no featurizers are provided, all available features will be considered.
Arguments:
attribute
- message attributefeaturizers
- names of featurizers to consider
Returns:
Dense features.
features_present
Check if there are any features present for the given attribute and featurizers. If no featurizers are provided, all available features will be considered.
Arguments:
attribute
- message attributefeaturizers
- names of featurizers to consider
Returns:
True
, if features are present, False
otherwise
is_core_message
Checks whether the message is a core message or not.
E.g. a core message is created from a story, not from the NLU data.
Returns:
True, if message is a core message, false otherwise.