import tensorflow as tf


  def Decode(self, ids):
    txt = tf.strings.reduce_join(self._TokenToString(ids))
    txt = tf.strings.regex_replace(txt, BOW_STR, ' ')
    # Note that this strips spaces from the end of the input as well.
    # We assume no inputs rely on the existence of trailing whitespace.
