code: def gen_html(img):
      """
      Formats HTML code from tokenized annotation of img
      """
      html_code = img["html"]["structure"]["tokens"].copy()
      to_insert = [
          i for i, tag in enumerate(html_code) if tag in ("<td>", ">")
      ]
      for i, cell in zip(to_insert[::-1], img["html"]["cells"][::-1]):
          if cell["tokens"]:
              text = "".join(cell["tokens"])
              # skip empty text
              sp_char_list = [
                  "<b>",
                  "</b>",
                  "\u2028",
                  " ",
                  "<i>",
                  "</i>",
              ]
              text_remove_style = skip_char(text, sp_char_list)
              if len(text_remove_style) == 0:
                  continue
              html_code.insert(i + 1, text)
      html_code = "".join(html_code)
      html_code = "<html><body><table>{}</table></body></html>".format(
          html_code
      )
      return html_code
  
file_path: PaddleOCR/ppstructure/table/convert_label2html.py
imports: import json
  import argparse
  from tqdm import tqdm
label_desc: Use image node_id 3 for calling a global function with example usage: gen_html(img) and returns: html_code