class_docstr: Ags:
      base_path (:obj:`str`): The directory to the whole dataset.
      tokenizer (:obj:`PretrainedTokenizer` or :obj:`JiebaTokenizer`):
          It tokenizes the text and encodes the data as model needed.
      max_seq_len (:obj:`int`, `optional`, defaults to :128):
          If set to a number, will limit the total sequence returned so that it has a maximum length.
      mode (:obj:`str`, `optional`, defaults to `train`):
          It identifies the dataset mode (train, test or dev).
      data_file(:obj:`str`, `optional`, defaults to :obj:`None`):
          The data file name, which is relative to the base_path.
      label_file(:obj:`str`, `optional`, defaults to :obj:`None`):
          The label file name, which is relative to the base_path.
          It is all labels of the dataset, one line one label.
      label_list(:obj:`List[str]`, `optional`, defaults to :obj:`None`):
          The list of all labels of the dataset
      split_char(:obj:`str`, `optional`, defaults to :obj:``):
          The symbol used to split chars in text and labels
      no_entity_label(:obj:`str`, `optional`, defaults to :obj:`O`):
          The label used to mark no entities
      ignore_label(:obj:`int`, `optional`, defaults to :-100):
          If one token's label == ignore_label, it will be ignored when
          calculating loss
      is_file_with_header(:obj:bool, `optional`, default to :obj: False) :
          Whether or not the file is with the header introduction.
class_docstr_tok: ["Ags",":","base_path","(",":","obj",":","`","str","`",")",":","The","directory","to","the","whole","dataset",".","tokenizer","(",":","obj",":","`","PretrainedTokenizer","`","or",":","obj",":","`","JiebaTokenizer","`",")",":","It","tokenizes","the","text","and","encodes","the","data","as","model","needed",".","max_seq_len","(",":","obj",":","`","int","`",",","`","optional","`",",","defaults","to",":128",")",":","If","set","to","a","number",",","will","limit","the","total","sequence","returned","so","that","it","has","a","maximum","length",".","mode","(",":","obj",":","`","str","`",",","`","optional","`",",","defaults","to","`","train","`",")",":","It","identifies","the","dataset","mode","(","train",",","test","or","dev",")",".","data_file","(",":","obj",":","`","str","`",",","`","optional","`",",","defaults","to",":","obj",":","`","None","`",")",":","The","data","file","name",",","which","is","relative","to","the","base_path",".","label_file","(",":","obj",":","`","str","`",",","`","optional","`",",","defaults","to",":","obj",":","`","None","`",")",":","The","label","file","name",",","which","is","relative","to","the","base_path",".","It","is","all","labels","of","the","dataset",",","one","line","one","label",".","label_list","(",":","obj",":","`","List","[","str","]","`",",","`","optional","`",",","defaults","to",":","obj",":","`","None","`",")",":","The","list","of","all","labels","of","the","dataset","split_char","(",":","obj",":","`","str","`",",","`","optional","`",",","defaults","to",":","obj",":","`","\u0002","`",")",":","The","symbol","used","to","split","chars","in","text","and","labels","no_entity_label","(",":","obj",":","`","str","`",",","`","optional","`",",","defaults","to",":","obj",":","`","O","`",")",":","The","label","used","to","mark","no","entities","ignore_label","(",":","obj",":","`","int","`",",","`","optional","`",",","defaults","to",":","-100",")",":","If","one","token","'s","label","==","ignore_label",",","it","will","be","ignored","when","calculating","loss","is_file_with_header","(",":","obj",":","bool",",","`","optional","`",",","default","to",":","obj",":","False",")",":","Whether","or","not","the","file","is","with","the","header","introduction","."]
docstr: Returns a list[dict] including all the input information what the model need.
  Args:
      examples (list): the data examples, returned by _read_file.
  Returns:
      a list with all the examples record.
docstr_tok: ["Returns","a","list","[","dict","]","including","all","the","input","information","what","the","model","need",".","Args",":","examples","(","list",")",":","the","data","examples",",","returned","by","_read_file",".","Returns",":","a","list","with","all","the","examples","record","."]
code: def _convert_examples_to_records(
      self, examples: List[InputExample]
  ) -> List[dict]:
      """
      Returns a list[dict] including all the input information what the model need.
      Args:
          examples (list): the data examples, returned by _read_file.
      Returns:
          a list with all the examples record.
      """
      records = []
      for example in examples:
          tokens = example.text_a.split(self.split_char)
          labels = example.label.split(self.split_char)
  
          # convert tokens into record
          if isinstance(self.tokenizer, PretrainedTokenizer):
              pad_token = self.tokenizer.pad_token
  
              tokens, labels = reseg_token_label(
                  tokenizer=self.tokenizer, tokens=tokens, labels=labels
              )
              if Version(paddlenlp.__version__) <= Version("2.0.0rc2"):
                  record = self.tokenizer.encode(
                      text=tokens, max_seq_len=self.max_seq_len
                  )
              else:
                  record = self.tokenizer(
                      text=tokens,
                      max_seq_len=self.max_seq_len,
                      pad_to_max_seq_len=True,
                      is_split_into_words=True,
                      return_length=True,
                  )
          elif isinstance(self.tokenizer, JiebaTokenizer):
              pad_token = self.tokenizer.vocab.pad_token
  
              ids = [
                  self.tokenizer.vocab.to_indices(token)
                  for token in tokens
              ]
              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
  
          # convert labels into record
          if labels:
              record["label"] = []
              if isinstance(self.tokenizer, PretrainedTokenizer):
                  tokens_with_specical_token = (
                      self.tokenizer.convert_ids_to_tokens(
                          record["input_ids"]
                      )
                  )
              elif isinstance(self.tokenizer, JiebaTokenizer):
                  tokens_with_specical_token = [
                      self.tokenizer.vocab.to_tokens(id_)
                      for id_ in record["text"]
                  ]
              else:
                  raise RuntimeError(
                      "Unknown type of self.tokenizer: {}, it must be an instance of  PretrainedTokenizer or JiebaTokenizer".format(
                          type(self.tokenizer)
                      )
                  )
  
              tokens_index = 0
              for token in tokens_with_specical_token:
                  if (
                      tokens_index < len(tokens)
                      and token == tokens[tokens_index]
                  ):
                      record["label"].append(
                          self.label_list.index(labels[tokens_index])
                      )
                      tokens_index += 1
                  elif token in [pad_token]:
                      record["label"].append(
                          self.ignore_label
                      )  # label of special token
                  else:
                      record["label"].append(
                          self.label_list.index(self.no_entity_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 SeqLabelingDataset obj's underlying member method code with example usage: obj._convert_examples_to_records(examples) and returns: records