code: def encode(self, s):
      
      s = tf.compat.as_text(s)
      tokens = self._tokenizer.tokenize(s)
      tokens = _prepare_tokens_for_encode(tokens)
      ids = []
      for token in tokens:
        ids.extend(self._token_to_ids(token))
      return text_encoder.pad_incr(ids)
docs: Encodes text into a list of integers.