code: def encode(self, text, pair=None, truncate_to=None):
      text_id = np.array(
          self.convert_tokens_to_ids(self.tokenize(text)),
          dtype=np.int64,
      )
      text_id_type = np.zeros_like(text_id, dtype=np.int64)
      if pair is not None:
          pair_id = np.array(
              self.convert_tokens_to_ids(self.tokenize(pair)),
              dtype=np.int64,
          )
      else:
          pair_id = []
      if truncate_to is not None:
          text_id, pair_id = self.truncate(
              text_id, [] if pair_id is None else pair_id, truncate_to
          )
  
      ret_id, ret_id_type = self.build_for_ernie(text_id, pair_id)
      return ret_id, ret_id_type
  
file_path: PaddleHub/modules/text/text_generation/reading_pictures_writing_poems_for_midautumn/MidAutumnPoetry/model/tokenizing_ernie.py
imports: import six
  import re
  import logging
  from functools import partial
  import numpy
  import io
label_desc: Use image node_id 6 for calling the ErnieTokenizer obj's underlying member method code with example usage: obj.encode(text, pair, truncate_to) and returns: ret_id,  ret_id_type