class_docstr: Transformer-based (duplex) tagger model for TN/ITN.
docstr: Decoding the raw tag predictions to locate the semiotic spans in the
  input texts.
  
  Args:
      tag_preds: A list of list where each list contains the raw tag predictions for the corresponding input words.
  
  Returns:
      nb_spans: A list of ints where each int indicates the number of semiotic spans in each input.
      span_starts: A list of lists where each list contains the starting locations of semiotic spans in an input words.
      span_ends: A list of lists where each list contains the inclusive ending locations of semiotic spans in an input words.
docstr_tok: ["Decoding","the","raw","tag","predictions","to","locate","the","semiotic","spans","in","the","input","texts",".","Args",":","tag_preds",":","A","list","of","list","where","each","list","contains","the","raw","tag","predictions","for","the","corresponding","input","words",".","Returns",":","nb_spans",":","A","list","of","ints","where","each","int","indicates","the","number","of","semiotic","spans","in","each","input",".","span_starts",":","A","list","of","lists","where","each","list","contains","the","starting","locations","of","semiotic","spans","in","an","input","words",".","span_ends",":","A","list","of","lists","where","each","list","contains","the","inclusive","ending","locations","of","semiotic","spans","in","an","input","words","."]
code: def decode_tag_preds(self, tag_preds: List[List[str]]):
      """Decoding the raw tag predictions to locate the semiotic spans in the
      input texts.
  
      Args:
          tag_preds: A list of list where each list contains the raw tag predictions for the corresponding input words.
  
      Returns:
          nb_spans: A list of ints where each int indicates the number of semiotic spans in each input.
          span_starts: A list of lists where each list contains the starting locations of semiotic spans in an input words.
          span_ends: A list of lists where each list contains the inclusive ending locations of semiotic spans in an input words.
      """
      nb_spans, span_starts, span_ends = [], [], []
      for i, preds in enumerate(tag_preds):
          cur_nb_spans, cur_span_start = 0, None
          cur_span_starts, cur_span_ends = [], []
          for ix, pred in enumerate(preds + ["EOS"]):
              if pred != constants.I_PREFIX + constants.TRANSFORM_TAG:
                  if not cur_span_start is None:
                      cur_nb_spans += 1
                      cur_span_starts.append(cur_span_start)
                      cur_span_ends.append(ix - 1)
                  cur_span_start = None
              if pred == constants.B_PREFIX + constants.TRANSFORM_TAG:
                  cur_span_start = ix
          nb_spans.append(cur_nb_spans)
          span_starts.append(cur_span_starts)
          span_ends.append(cur_span_ends)
      return nb_spans, span_starts, span_ends
  
imports: from time import perf_counter
  from typing import Dict, List, Optional
  import torch
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from torch import nn
  from transformers import AutoModelForTokenClassification, AutoTokenizer, DataCollatorForTokenClassification
  from transformers.tokenization_utils_base import BatchEncoding
  from nemo.collections.nlp.data.text_normalization import TextNormalizationTaggerDataset, constants
  from nemo.collections.nlp.metrics.classification_report import ClassificationReport
  from nemo.collections.nlp.models.duplex_text_normalization.utils import has_numbers
  from nemo.collections.nlp.models.nlp_model import NLPModel
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types import ChannelType, LogitsType, MaskType, NeuralType
  from nemo.utils import logging
label_desc: Use image node_id 14 for calling the DuplexTaggerModel obj's underlying member method code with example usage: obj.decode_tag_preds(tag_preds) and returns: nb_spans,  span_starts,  span_ends