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.shared.nlu.training_data.message
Message Objects
add_features
Adds the given features to the message.
Arguments:
features
- the features to be added
add_diagnostic_data
Adds diagnostic data from the origin
component.
Arguments:
origin
- Name of the component that created the data.data
- The diagnostic data.
set
Sets the message's property to the given value.
Arguments:
prop
- Name of the property to be set.info
- Value to be assigned to that property.add_to_output
- Decides whether to addprop
to theoutput_properties
.
as_dict_nlu
Get dict representation of message as it would appear in training data
__hash__
Calculate a hash for the message.
Returns:
Hash of the message.
fingerprint
Calculate a string fingerprint for the message.
Returns:
Fingerprint of the message.
build
Builds 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
Gets all sparse features for the attribute given the 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_sparse_feature_sizes
Gets sparse feature sizes for the attribute given the 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 feature sizes.
get_dense_features
Gets all dense features for the attribute given the 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.
get_all_features
Gets all features for the attribute given the list of featurizers.
If no featurizers are provided, all available features will be considered.
Arguments:
attribute
- message attributefeaturizers
- names of featurizers to consider
Returns:
Features.
features_present
Checks if there are any features present for the attribute and featurizers.
If no featurizers are provided, all available features will be considered.
Arguments:
attribute
- Message attribute.featurizers
- Names of featurizers to consider.
Returns:
True
, if features are present, False
otherwise.
is_core_or_domain_message
Checks whether the message is a core message or from the domain.
E.g. a core message is created from a story or a domain action, not from the NLU data.
Returns:
True, if message is a core or domain message, false otherwise.
is_e2e_message
Checks whether the message came from an e2e story.
Returns:
True
, if message is a from an e2e story, False
otherwise.
find_overlapping_entities
Finds any overlapping entity annotations.