class_docstr: The base class for Transformer models.
class_docstr_tok: ["The","base","class","for","Transformer","models","."]
code: def _batchify(
      self,
      data: List[List[str]],
      max_seq_len: int,
      batch_size: int,
      split_char: str,
  ):
      def _parse_batch(batch):
          if self.task != "text-matching":
              input_ids = [entry[0] for entry in batch]
              segment_ids = [entry[1] for entry in batch]
              return input_ids, segment_ids
          else:
              query_input_ids = [entry[0] for entry in batch]
              query_segment_ids = [entry[1] for entry in batch]
              title_input_ids = [entry[2] for entry in batch]
              title_segment_ids = [entry[3] for entry in batch]
              return (
                  query_input_ids,
                  query_segment_ids,
                  title_input_ids,
                  title_segment_ids,
              )
  
      if not hasattr(self, "tokenizer"):
          self.tokenizer = self.get_tokenizer()
      examples = []
  
      for texts in data:
          encoded_inputs = self._convert_text_to_input(
              self.tokenizer, texts, max_seq_len, split_char
          )
          example = []
          for inp in encoded_inputs:
              input_ids = inp["input_ids"]
              if Version(paddlenlp.__version__) >= Version("2.0.0rc5"):
                  token_type_ids = inp["token_type_ids"]
              else:
                  token_type_ids = inp["segment_ids"]
              example.extend((input_ids, token_type_ids))
          examples.append(example)
  
      # Seperates data into some batches.
      one_batch = []
      for example in examples:
          one_batch.append(example)
          if len(one_batch) == batch_size:
              yield _parse_batch(one_batch)
              one_batch = []
      if one_batch:
          # The last batch whose size is less than the config batch_size setting.
          yield _parse_batch(one_batch)
  
imports: import copy
  import functools
  import inspect
  import io
  import json
  import os
  import six
  from typing import List, Tuple, Union
  import paddle
  import paddle.nn
  from packaging.version import Version
  from paddle.dataset.common import DATA_HOME
  from paddle.utils.download import get_path_from_url
  from paddlehub.module.module import serving, RunModule, runnable
  from paddlehub.utils.log import logger
  from paddlehub.utils.utils import reseg_token_label
  import paddlenlp
  from paddlenlp.embeddings.token_embedding import EMBEDDING_HOME, EMBEDDING_URL_ROOT
  from paddlenlp.data import JiebaTokenizer
  from paddlehub.compat.module.nlp_module import DataFormatError
label_desc: Use image node_id 3 for calling the TransformerModule obj's underlying member method code with example usage: obj._batchify(data, max_seq_len, batch_size, split_char) and returns: input_ids,  segment_ids, query_input_ids,  query_segment_ids,  title_input_ids,  title_segment_ids