class_docstr: This class represents an error case
  
  Args:
      _input: Original input string
      target: Ground-truth target string
      pred: Predicted string
      mode: A string indicates the mode (i.e., constants.ITN_MODE or constants.TN_MODE)
class_docstr_tok: ["This","class","represents","an","error","case","Args",":","_input",":","Original","input","string","target",":","Ground-truth","target","string","pred",":","Predicted","string","mode",":","A","string","indicates","the","mode","(","i.e.",",","constants.ITN_MODE","or","constants.TN_MODE",")"]
docstr: This method generates a HTML string for a string sequence from its spans.
  
  Args:
      spans: A list of contiguous spans in a sequence. Each span is represented by a tuple of 3 elements: (1) Start Index (2) End Index (3) A boolean value indicating whether the span needs to be hightlighted.
      tokens: All tokens in the sequence
  Returns:
      html_str: A HTML string for the string sequence.
docstr_tok: ["This","method","generates","a","HTML","string","for","a","string","sequence","from","its","spans",".","Args",":","spans",":","A","list","of","contiguous","spans","in","a","sequence",".","Each","span","is","represented","by","a","tuple","of","3","elements",":","(","1",")","Start","Index","(","2",")","End","Index","(","3",")","A","boolean","value","indicating","whether","the","span","needs","to","be","hightlighted",".","tokens",":","All","tokens","in","the","sequence","Returns",":","html_str",":","A","HTML","string","for","the","string","sequence","."]
code: def get_spans_html(self, spans, tokens):
      """
      This method generates a HTML string for a string sequence from its spans.
  
      Args:
          spans: A list of contiguous spans in a sequence. Each span is represented by a tuple of 3 elements: (1) Start Index (2) End Index (3) A boolean value indicating whether the span needs to be hightlighted.
          tokens: All tokens in the sequence
      Returns:
          html_str: A HTML string for the string sequence.
      """
      html_str = ""
      for start, end, type in spans:
          color = "red" if type else "black"
          span_tokens = tokens[start : end + 1]
          span_str = '<span style="color:{}">{}</span> '.format(
              color, " ".join(span_tokens)
          )
          html_str += span_str
      return html_str
  
file_path: NeMo/examples/nlp/duplex_text_normalization/analyze_errors.py
imports: from argparse import ArgumentParser
  from typing import List
  from nemo.collections.nlp.data.text_normalization import constants
label_desc: Use image node_id 5 for calling the ErrorCase obj's underlying member method code with example usage: obj.get_spans_html(spans, tokens) and returns: html_str