notice
This is unreleased documentation for Rasa Documentation Main/Unreleased version.
For the latest released documentation, see the latest version (3.x).
rasa.utils.tensorflow.data_generator
RasaDataGenerator Objects
Abstract data generator.
__init__
Initializes the data generator.
Arguments:
model_data
- The model data to use.batch_size
- The batch size(s).batch_strategy
- The batch strategy.shuffle
- If 'True', data should be shuffled.
__len__
Number of batches in the Sequence.
Returns:
The number of batches in the Sequence.
__getitem__
Gets batch at position index
.
Arguments:
index
- position of the batch in the Sequence.
Returns:
A batch (tuple of input data and target data).
on_epoch_end
Update the data after every epoch.
prepare_batch
Slices model data into batch using given start and end value.
Arguments:
data
- The data to prepare.start
- The start index of the batchend
- The end index of the batchtuple_sizes
- In case the feature is not present we propagate the batch with None. Tuple sizes contains the number of how many None values to add for what kind of feature.
Returns:
The features of the batch.
RasaBatchDataGenerator Objects
Data generator with an optional increasing batch size.
__init__
Initializes the increasing batch size data generator.
Arguments:
model_data
- The model data to use.batch_size
- The batch size.epochs
- The total number of epochs.batch_strategy
- The batch strategy.shuffle
- If 'True', data will be shuffled.
__len__
Number of batches in the Sequence.
Returns:
The number of batches in the Sequence.
__getitem__
Gets batch at position index
.
Arguments:
index
- position of the batch in the Sequence.
Returns:
A batch (tuple of input data and target data).
on_epoch_end
Update the data after every epoch.