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.model_training
TrainingResult Objects
Holds information about the results of training.
train_async
Trains a Rasa model (Core and NLU).
Arguments:
domain- Path to the domain file.config- Path to the config for Core and NLU.training_files- Paths to the training data for Core and NLU.output_path- Output path.dry_run- IfTruethen no training will be done, and the information about whether the training needs to be done will be printed.force_training- IfTrueretrain model even if data has not changed.fixed_model_name- Name of model to be stored.persist_nlu_training_data-Trueif the NLU training data should be persisted with the model.core_additional_arguments- Additional training parameters for core training.nlu_additional_arguments- Additional training parameters forwarded to training method of each NLU component.model_to_finetune- Optional path to a model which should be finetuned or a directory in case the latest trained model should be used.finetuning_epoch_fraction- The fraction currently specified training epochs in the model configuration which should be used for finetuning.
Returns:
An instance of TrainingResult.
handle_domain_if_not_exists
Trains only the nlu model and prints a warning about missing domain.
dry_run_result
Returns a dry run result.
Arguments:
fingerprint_comparison- A result of fingerprint comparison operation.
Returns:
A tuple where the first element is the result code and the second is the list of human-readable texts that need to be printed to the end user.
train_core_async
Trains a Core model.
Arguments:
domain- Path to the domain file.config- Path to the config file for Core.stories- Path to the Core training data.output- Output path.train_path- IfNonethe model will be trained in a temporary directory, otherwise in the provided directory.fixed_model_name- Name of model to be stored.additional_arguments- Additional training parameters.model_to_finetune- Optional path to a model which should be finetuned or a directory in case the latest trained model should be used.finetuning_epoch_fraction- The fraction currently specified training epochs in the model configuration which should be used for finetuning.
Returns:
If train_path is given it returns the path to the model archive,
otherwise the path to the directory with the trained model files.
train_nlu
Trains an NLU model.
Arguments:
config- Path to the config file for NLU.nlu_data- Path to the NLU training data.output- Output path.train_path- IfNonethe model will be trained in a temporary directory, otherwise in the provided directory.fixed_model_name- Name of the model to be stored.persist_nlu_training_data-Trueif the NLU training data should be persisted with the model.additional_arguments- Additional training parameters which will be passed to thetrainmethod of each component.domain- Path to the optional domain file/Domain object.model_to_finetune- Optional path to a model which should be finetuned or a directory in case the latest trained model should be used.finetuning_epoch_fraction- The fraction currently specified training epochs in the model configuration which should be used for finetuning.
Returns:
If train_path is given it returns the path to the model archive,
otherwise the path to the directory with the trained model files.
train_nlu_async
Trains an NLU model asynchronously.
