Possible error in Guide?

The example shows this line:

def custom_standardization(input_data):
  lowercase = tf.strings.lower(input_data)
  stripped_html = tf.strings.regex_replace(lowercase, '<br />', ' ')
  return tf.strings.regex_replace(stripped_html,
                                  '[%s]' % re.escape(string.punctuation),
                                  '')

And it seems that string.punctuation cant be right, I presume it is tf.string.punctuation

@Mah_Neh,

The string.punctuation which is used in the code block is not from Tensorflow ecosystem.

It is imported from the string library available in python.

Please refer to the import libraries section in the tutorial.

Thank you!

1 Like