code: def analyze(errors_log_fp: str, visualization_fp: str):
      """
      This method generates a HTML visualization of the error cases logged in a log file.
  
      Args:
          errors_log_fp: Path to the error log file
          visualization_fp: Path to the output visualization file
  
      """
      # Read lines from errors log
      with open(errors_log_fp, "r", encoding="utf-8") as f:
          lines = f.readlines()
  
      # Process lines
      tn_error_cases, itn_error_cases = [], []
      for ix in range(0, len(lines), 8):
          mode_line = lines[ix]
          info_lines = lines[ix + 1 : ix + 7]
          # Append new error case
          if mode_line.startswith("Forward Problem"):
              mode = constants.TN_MODE
              tn_error_cases.append(
                  ErrorCase.from_lines(info_lines, mode)
              )
          elif mode_line.startswith("Backward Problem"):
              mode = constants.ITN_MODE
              itn_error_cases.append(
                  ErrorCase.from_lines(info_lines, mode)
              )
  
      # Basic stats
      print("---- Text Normalization ----")
      print("Number of TN errors: {}".format(len(tn_error_cases)))
  
      print("---- Inverse Text Normalization ---- ")
      print("Number of ITN errors: {}".format(len(itn_error_cases)))
  
      # Produce a visualization
      with open(visualization_fp, "w+", encoding="utf-8") as f:
          # Appendix
          f.write("Appendix</br>")
          f.write(
              '<a href="#tn_section">Text Normalization Analysis.</a></br>'
          )
          f.write(
              '<a href="#itn_section">Inverse Text Normalization Analysis.</a>'
          )
  
          # TN Section
          f.write('<h2 id="tn_section">Text Normalization</h2>\n')
          for errorcase in tn_error_cases:
              f.write(errorcase.get_html())
  
          # ITN Section
          f.write(
              '<h2 id="itn_section">Inverse Text Normalization</h2>\n'
          )
          for errorcase in itn_error_cases:
              f.write(errorcase.get_html())
  
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 2 for calling a global function with example usage: analyze(errors_log_fp, visualization_fp) without return types