title: How to iterate on keras Dataset and edit content
body: <p>I am working on this movie classification problem
  <a href="https://www.tensorflow.org/tutorials/keras/text_classification" rel="nofollow noreferrer">https://www.tensorflow.org/tutorials/keras/text_classification</a></p>
  <p>In this example text files(12500 files with movie revies) are read and a batched dataset is prepared like below</p>
  <pre class="lang-py prettyprint-override"><code>raw_train_ds = tf.keras.preprocessing.text_dataset_from_directory(
      'aclImdb/train', 
      batch_size=batch_size, 
      validation_split=0.2, 
      subset='training', 
      seed=seed)
  </code></pre>
  <p>at the time of standardization</p>
  <pre><code>def custom_standardization(input_data):
    lowercase = tf.strings.lower(input_data)
    stripped_html = tf.strings.regex_replace(lowercase, '&lt;br /&gt;', ' ')
  #I WANT TO REMOVE STOP WORDS HERE, CAN I DO
    return tf.strings.regex_replace(stripped_html,'[%s]' % re.escape(string.punctuation),'')
  </code></pre>
  <p>Problem: I understand that I have got training dataset with labels in variable '<strong>raw_train_ds</strong>'. Now I want to iterate over this dataset and remove stop words from the movie review text and store back to same variable, I tried to do it in function 'custom_standardization' but it gives type error,</p>
  <p>I also tried to use <code>tf.strings.as_strings</code> but it returns error
  <em>InvalidArgumentError: Value for attr 'T' of string is not in the list of allowed values: int8, int16, int32, int64</em></p>
  <p>can someone please help on it OR simply please help how to remove stopwords from the batch dataset</p>