class_docstr: Creates dataset to use during training for token classification tasks with a pretrained model.
  
  Converts from raw data to an instance that can be used by Dataloader.
  For dataset to use during inference without labels, see BertTokenClassificationInferDataset.
  
  Args:
      text_file: file to sequences, each line should a sentence, no header.
      label_file: file to labels, each line corresponds to word labels for a sentence in the text_file. No header.
      max_seq_length: max sequence length minus 2 for [CLS] and [SEP]
      tokenizer: such as AutoTokenizer
      num_samples: number of samples you want to use for the dataset.
          If -1, use all dataset. Useful for testing.
      pad_label: pad value use for labels. By default, it's the neutral label.
      label_ids: label_ids (dict): dict to map labels to label ids.
          Starts with pad_label->0 and then increases in alphabetical order
          For dev set use label_ids generated during training to support
          cases when not all labels are present in the dev set.
          For training set label_ids should be None.
      ignore_extra_tokens: whether to ignore extra tokens in the loss_mask
      ignore_start_end: whether to ignore bos and eos tokens in the loss_mask
      use_cache: whether to use processed data cache or not
docstr: Returns definitions of module output ports.
                 
docstr_tok: ["Returns","definitions","of","module","output","ports","."]
code: def output_types(self) -> Optional[Dict[str, NeuralType]]:
      """Returns definitions of module output ports."""
      return {
          "input_ids": NeuralType(("B", "T"), ChannelType()),
          "segment_ids": NeuralType(("B", "T"), ChannelType()),
          "input_mask": NeuralType(("B", "T"), MaskType()),
          "subtokens_mask": NeuralType(("B", "T"), MaskType()),
          "loss_mask": NeuralType(("B", "T"), MaskType()),
          "labels": NeuralType(("B", "T"), LabelsType()),
      }
  
imports: import os
  import pickle
  import tempfile
  import time
  from typing import Dict, List, Optional
  import numpy
  from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec
  from nemo.collections.nlp.data.data_utils.data_preprocessing import get_stats
  from nemo.core.classes import Dataset
  from nemo.core.neural_types import ChannelType, LabelsType, MaskType, NeuralType
  from nemo.utils import logging
  from nemo.utils.get_rank import is_global_rank_zero
label_desc: Use image node_id 1 for calling the BertTokenClassificationDataset obj's underlying member method code with example usage: obj.output_types() and returns: dict