# Module: tf.keras.preprocessing.sequence

<br />

Utilities for preprocessing sequence data.

> [!WARNING]
> **Deprecated:** [`tf.keras.preprocessing.sequence`](https://www.tensorflow.org/versions/r2.12/api_docs/python/tf/keras/preprocessing/sequence) APIs are not recommended for new code. Prefer [`tf.keras.utils.timeseries_dataset_from_array`](https://www.tensorflow.org/versions/r2.12/api_docs/python/tf/keras/utils/timeseries_dataset_from_array) and the [`tf.data`](https://www.tensorflow.org/versions/r2.12/api_docs/python/tf/data) APIs which provide a much more flexible mechanisms for dealing with sequences. See the [tf.data guide](https://www.tensorflow.org/guide/data) for more details.

## Classes

[`class TimeseriesGenerator`](https://www.tensorflow.org/versions/r2.12/api_docs/python/tf/keras/preprocessing/sequence/TimeseriesGenerator): Utility class for generating batches of temporal data.

## Functions

[`make_sampling_table(...)`](https://www.tensorflow.org/versions/r2.12/api_docs/python/tf/keras/preprocessing/sequence/make_sampling_table): Generates a word rank-based probabilistic sampling table.

[`pad_sequences(...)`](https://www.tensorflow.org/versions/r2.12/api_docs/python/tf/keras/utils/pad_sequences): Pads sequences to the same length.

[`skipgrams(...)`](https://www.tensorflow.org/versions/r2.12/api_docs/python/tf/keras/preprocessing/sequence/skipgrams): Generates skipgram word pairs.