notice
This is documentation for Rasa Open Source Documentation v2.1.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (2.2.x).
rasa.utils.train_utils
normalize
Normalizes an array of positive numbers over the top ranking_length
values.
Other values will be set to 0.
update_similarity_type
If SIMILARITY_TYPE is set to 'auto', update the SIMILARITY_TYPE depending on the LOSS_TYPE.
Arguments:
config
- model configurationReturns
- updated model configuration
align_token_features
Align token features to match tokens.
ConveRTTokenizer, LanguageModelTokenizers might split up tokens into sub-tokens. We need to take the mean of the sub-token vectors and take that as token vector.
Arguments:
list_of_tokens
- tokens for examplesin_token_features
- token features from ConveRTshape
- shape of feature matrix
Returns:
Token features.
update_evaluation_parameters
If EVAL_NUM_EPOCHS is set to -1, evaluate at the end of the training.
Arguments:
config
- model configurationReturns
- updated model configuration
load_tf_hub_model
Load model from cache if possible, otherwise from TFHub
check_deprecated_options
If old model configuration parameters are present in the provided config, replace them with the new parameters and log a warning.
Arguments:
config
- model configurationReturns
- updated model configuration