class_docstr: Builder class for BertExample objects.
class_docstr_tok: ["Builder","class","for","BertExample","objects","."]
docstr: Converts span_info string into a list of (class_id, start, end) where start, end are coordinates of starting and ending(exclusive) tokens in input_ids of BertExample
  
  Example:
      span_info_parts: ["CUSTOM 37 41", "CUSTOM 47 52", "CUSTOM 42 46", "CUSTOM 0 7"]
      result: [(1, 38, 42), (1, 48, 53), (1, 43, 47), (1, 1, 8)]
docstr_tok: ["Converts","span_info","string","into","a","list","of","(","class_id",",","start",",","end",")","where","start",",","end","are","coordinates","of","starting","and","ending","(","exclusive",")","tokens","in","input_ids","of","BertExample","Example",":","span_info_parts",":","[","``","CUSTOM","37","41","''",",","``","CUSTOM","47","52","''",",","``","CUSTOM","42","46","''",",","``","CUSTOM","0","7","''","]","result",":","[","(","1",",","38",",","42",")",",","(","1",",","48",",","53",")",",","(","1",",","43",",","47",")",",","(","1",",","1",",","8",")","]"]
code: def _get_spans(
      self, span_info_parts: List[str]
  ) -> List[Tuple[int, int, int]]:
      """Converts span_info string into a list of (class_id, start, end) where start, end are coordinates of starting and ending(exclusive) tokens in input_ids of BertExample
  
      Example:
          span_info_parts: ["CUSTOM 37 41", "CUSTOM 47 52", "CUSTOM 42 46", "CUSTOM 0 7"]
          result: [(1, 38, 42), (1, 48, 53), (1, 43, 47), (1, 1, 8)]
      """
      result_spans = []
  
      for p in span_info_parts:
          if p == "":
              break
          c, start, end = p.split(" ")
          if c not in self._semiotic_classes:
              raise KeyError(
                  "class=" + c + " not found in self._semiotic_classes"
              )
          cid = self._semiotic_classes[c]
          # +1 because this should be indexing on input_ids which has [CLS] token at beginning
          start = int(start) + 1
          end = int(end) + 1
          result_spans.append((cid, start, end))
      return result_spans
  
file_path: NeMo/nemo/collections/nlp/data/spellchecking_asr_customization/bert_example.py
imports: import logging
  from collections import OrderedDict
  from os import path
  from typing import Dict, List, Optional, Tuple, Union
  from transformers import PreTrainedTokenizerBase
label_desc: Use image node_id 3 for calling the BertExampleBuilder obj's underlying member method code with example usage: obj._get_spans(span_info_parts) and returns: result_spans