class_docstr: The dataset class which is fit for all datatset of text classification.
class_docstr_tok: ["The","dataset","class","which","is","fit","for","all","datatset","of","text","classification","."]
docstr: Converts all examples to records which the model needs.
  Args:
      examples(obj:`List[InputExample]`): All data examples returned by _read_file.
  Returns:
      records(:obj:`List[dict]`): All records which the model needs.
docstr_tok: ["Converts","all","examples","to","records","which","the","model","needs",".","Args",":","examples","(","obj",":","`","List","[","InputExample","]","`",")",":","All","data","examples","returned","by","_read_file",".","Returns",":","records","(",":","obj",":","`","List","[","dict","]","`",")",":","All","records","which","the","model","needs","."]
code: def _convert_examples_to_records(
      self, examples: List[InputExample]
  ) -> List[dict]:
      """
      Converts all examples to records which the model needs.
      Args:
          examples(obj:`List[InputExample]`): All data examples returned by _read_file.
      Returns:
          records(:obj:`List[dict]`): All records which the model needs.
      """
      records = []
      for example in examples:
          if isinstance(self.tokenizer, PretrainedTokenizer):
              if Version(paddlenlp.__version__) <= Version("2.0.0rc2"):
                  record = self.tokenizer.encode(
                      text=example.text_a,
                      text_pair=example.text_b,
                      max_seq_len=self.max_seq_len,
                  )
              else:
                  record = self.tokenizer(
                      text=example.text_a,
                      text_pair=example.text_b,
                      max_seq_len=self.max_seq_len,
                      pad_to_max_seq_len=True,
                      return_length=True,
                  )
          elif isinstance(self.tokenizer, JiebaTokenizer):
              pad_token = self.tokenizer.vocab.pad_token
  
              ids = self.tokenizer.encode(sentence=example.text_a)
              seq_len = min(len(ids), self.max_seq_len)
              if len(ids) > self.max_seq_len:
                  ids = trunc_sequence(ids, self.max_seq_len)
              else:
                  pad_token_id = self.tokenizer.vocab.to_indices(
                      pad_token
                  )
                  ids = pad_sequence(
                      ids, self.max_seq_len, pad_token_id
                  )
              record = {"text": ids, "seq_len": seq_len}
          else:
              raise RuntimeError(
                  "Unknown type of self.tokenizer: {}, it must be an instance of  PretrainedTokenizer or JiebaTokenizer".format(
                      type(self.tokenizer)
                  )
              )
  
          if not record:
              logger.info(
                  "The text %s has been dropped as it has no words in the vocab after tokenization."
                  % example.text_a
              )
              continue
          if example.label:
              record["label"] = self.label_map[example.label]
          records.append(record)
      return records
  
imports: import csv
  import io
  import os
  from typing import Dict, List, Optional, Union, Tuple
  import numpy
  import paddle
  import paddlenlp
  from packaging.version import Version
  from paddlehub.env import DATA_HOME
  from paddlenlp.transformers import PretrainedTokenizer
  from paddlenlp.data import JiebaTokenizer
  from paddlehub.utils.log import logger
  from paddlehub.utils.utils import download, reseg_token_label, pad_sequence, trunc_sequence
  from paddlehub.utils.xarfile import is_xarfile, unarchive
label_desc: Use image node_id 3 for calling the TextClassificationDataset obj's underlying member method code with example usage: obj._convert_examples_to_records(examples) and returns: records