# Module: tf.keras.preprocessing.text

<br />

|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/text) |

Utilities for text input preprocessing.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.keras.preprocessing.text`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/keras/preprocessing/text)

<br />

## Classes

[`class Tokenizer`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/preprocessing/text/Tokenizer): Text tokenization utility class.

## Functions

[`hashing_trick(...)`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/preprocessing/text/hashing_trick): Converts a text to a sequence of indexes in a fixed-size hashing space.

[`one_hot(...)`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/preprocessing/text/one_hot): One-hot encodes a text into a list of word indexes of size n.

[`text_to_word_sequence(...)`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/preprocessing/text/text_to_word_sequence): Converts a text to a sequence of words (or tokens).