code: def _ieer_read_text(s, root_label):
      stack = [Tree(root_label, [])]
      # s will be None if there is no headline in the text
      # return the empty list in place of a Tree
      if s is None:
          return []
      for piece_m in re.finditer(r"<[^>]+>|[^\s<]+", s):
          piece = piece_m.group()
          try:
              if piece.startswith("<b_"):
                  m = _IEER_TYPE_RE.match(piece)
                  if m is None:
                      print("XXXX", piece)
                  chunk = Tree(m.group("type"), [])
                  stack[-1].append(chunk)
                  stack.append(chunk)
              elif piece.startswith("<e_"):
                  stack.pop()
              #           elif piece.startswith('<'):
              #               print "ERROR:", piece
              #               raise ValueError # Unexpected HTML
              else:
                  stack[-1].append(piece)
          except (IndexError, ValueError) as e:
              raise ValueError(
                  f"Bad IEER string (error at character {piece_m.start():d})"
              ) from e
      if len(stack) != 1:
          raise ValueError("Bad IEER string")
      return stack[0]
  
imports: import re
  from nltk.metrics import accuracy
  from nltk.tag.mapping import map_tag
  from nltk.tag.util import str2tuple
  from nltk.tree import Tree
label_desc: Use image node_id 8 for calling a global function with example usage: _ieer_read_text(s, root_label) and returns: stack, list