From 53ae1fce37c93226a2e260f38fffb52be4ba091e Mon Sep 17 00:00:00 2001 From: Yash Katariya <yashkatariya@google.com> Date: Thu, 15 Oct 2020 16:10:25 -0700 Subject: [PATCH] Fix the code block escaping. See https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/text/text_to_word_sequence?hl=en PiperOrigin-RevId: 337402890 Change-Id: I23d0b41b721f5a0ba8d021ffe8e64f66befa65a2 --- tensorflow/python/keras/preprocessing/text.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tensorflow/python/keras/preprocessing/text.py b/tensorflow/python/keras/preprocessing/text.py index 5a343e0069c..372dc18b61d 100644 --- a/tensorflow/python/keras/preprocessing/text.py +++ b/tensorflow/python/keras/preprocessing/text.py @@ -63,7 +63,7 @@ def one_hot(input_text, filters='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~\t\n', lower=True, split=' '): - """One-hot encodes a text into a list of word indexes of size `n`. + r"""One-hot encodes a text into a list of word indexes of size `n`. This function receives as input a string of text and returns a list of encoded integers each corresponding to a word (or token) @@ -73,8 +73,11 @@ def one_hot(input_text, input_text: Input text (string). n: int. Size of vocabulary. filters: list (or concatenation) of characters to filter out, such as - punctuation. Default: ``!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~\\t\\n``, - includes basic punctuation, tabs, and newlines. + punctuation. Default: + ``` + '!"#$%&()*+,-./:;<=>?@[\]^_`{|}~\t\n + ```, + includes basic punctuation, tabs, and newlines. lower: boolean. Whether to set the text to lowercase. split: str. Separator for word splitting.