class_docstr: Class for training and inference examples for BERT.
  
  Attributes:
      editing_task: The EditingTask from which this example was created. Needed
          when realizing labels predicted for this example.
      features: Feature dictionary.
class_docstr_tok: ["Class","for","training","and","inference","examples","for","BERT",".","Attributes",":","editing_task",":","The","EditingTask","from","which","this","example","was","created",".","Needed","when","realizing","labels","predicted","for","this","example",".","features",":","Feature","dictionary","."]
docstr: Inputs to the example wrapper
  
  Args:
      input_ids: indices of tokens which constitute batches of masked text segments
      input_mask: bool tensor with 0s in place of source tokens to be masked
      segment_ids: bool tensor with 0's and 1's to denote the text segment type
      tag_labels: indices of tokens which should be predicted from each of the
          corresponding input tokens
      labels_mask: bool tensor with 0s in place of label tokens to be masked
      token_start_indices: the indices of the WordPieces that start a token.
      semiotic_labels: indices of semiotic classes which should be predicted from each of the
          corresponding input tokens
      semiotic_spans: list of tuples (class_id, start_wordpiece_idx, end_wordpiece_idx), end is exclusive
      task: Example Text-Editing Task used by the LaserTagger model during inference.
      default_label: The default label for the KEEP tag-ID
docstr_tok: ["Inputs","to","the","example","wrapper","Args",":","input_ids",":","indices","of","tokens","which","constitute","batches","of","masked","text","segments","input_mask",":","bool","tensor","with","0s","in","place","of","source","tokens","to","be","masked","segment_ids",":","bool","tensor","with","0","'s","and","1","'s","to","denote","the","text","segment","type","tag_labels",":","indices","of","tokens","which","should","be","predicted","from","each","of","the","corresponding","input","tokens","labels_mask",":","bool","tensor","with","0s","in","place","of","label","tokens","to","be","masked","token_start_indices",":","the","indices","of","the","WordPieces","that","start","a","token",".","semiotic_labels",":","indices","of","semiotic","classes","which","should","be","predicted","from","each","of","the","corresponding","input","tokens","semiotic_spans",":","list","of","tuples","(","class_id",",","start_wordpiece_idx",",","end_wordpiece_idx",")",",","end","is","exclusive","task",":","Example","Text-Editing","Task","used","by","the","LaserTagger","model","during","inference",".","default_label",":","The","default","label","for","the","KEEP","tag-ID"]
code: def __init__(
      self,
      input_ids: List[int],
      input_mask: List[int],
      segment_ids: List[int],
      labels_mask: List[int],
      tag_labels: List[int],
      semiotic_labels: List[int],
      semiotic_spans: List[Tuple[int, int, int]],
      token_start_indices: List[int],
      task: EditingTask,
      default_label: int,
  ) -> None:
      """Inputs to the example wrapper
  
      Args:
          input_ids: indices of tokens which constitute batches of masked text segments
          input_mask: bool tensor with 0s in place of source tokens to be masked
          segment_ids: bool tensor with 0's and 1's to denote the text segment type
          tag_labels: indices of tokens which should be predicted from each of the
              corresponding input tokens
          labels_mask: bool tensor with 0s in place of label tokens to be masked
          token_start_indices: the indices of the WordPieces that start a token.
          semiotic_labels: indices of semiotic classes which should be predicted from each of the
              corresponding input tokens
          semiotic_spans: list of tuples (class_id, start_wordpiece_idx, end_wordpiece_idx), end is exclusive
          task: Example Text-Editing Task used by the LaserTagger model during inference.
          default_label: The default label for the KEEP tag-ID
      """
      input_len = len(input_ids)
      if not (
          input_len == len(input_mask)
          and input_len == len(segment_ids)
          and input_len == len(labels_mask)
          and input_len == len(tag_labels)
          and input_len == len(semiotic_labels)
      ):
          raise ValueError(
              "All feature lists should have the same length ({})".format(
                  input_len
              )
          )
  
      self.features = OrderedDict(
          [
              ("input_ids", input_ids),
              ("input_mask", input_mask),
              ("segment_ids", segment_ids),
              ("labels_mask", labels_mask),
              ("tag_labels", tag_labels),
              ("semiotic_labels", semiotic_labels),
              ("semiotic_spans", semiotic_spans),
          ]
      )
      self._token_start_indices = token_start_indices
      self.editing_task = task
      self._default_label = default_label
  
imports: import logging
  from collections import OrderedDict
  from os import path
  from typing import Dict, List, Optional, Tuple, Union
  from transformers import PreTrainedTokenizerBase
  from nemo.collections.nlp.data.text_normalization_as_tagging.tagging import EditingTask, Tag
  from nemo.collections.nlp.data.text_normalization_as_tagging.utils import yield_sources_and_targets
label_desc: Use image node_id 1 to create a new BertExample object from inherited base classes: object with example: obj = BertExample(input_ids, input_mask, segment_ids, labels_mask, tag_labels, semiotic_labels, semiotic_spans, token_start_indices, task, default_label)