class_docstr: The Tree object factorize a constituency tree into four fields, each associated with one or more :class:`Field` objects.
  
  Attributes:
      WORD:
          Words in the sentence.
      POS:
          Part-of-speech tags, or underscores if not available.
      TREE:
          The raw constituency tree in :class:`nltk.tree.Tree` format.
      CHART:
          The factorized sequence of binarized tree traversed in pre-order.
class_docstr_tok: ["The","Tree","object","factorize","a","constituency","tree","into","four","fields",",","each","associated","with","one","or","more",":","class",":","`","Field","`","objects",".","Attributes",":","WORD",":","Words","in","the","sentence",".","POS",":","Part-of-speech","tags",",","or","underscores","if","not","available",".","TREE",":","The","raw","constituency","tree","in",":","class",":","`","nltk.tree.Tree","`","format",".","CHART",":","The","factorized","sequence","of","binarized","tree","traversed","in","pre-order","."]
docstr: Conducts binarization over the tree.
  
  First, the tree is transformed to satisfy `Chomsky Normal Form (CNF)`_.
  Here we call :meth:`~nltk.tree.Tree.chomsky_normal_form` to conduct left-binarization.
  Second, all unary productions in the tree are collapsed.
  
  Args:
      tree (nltk.tree.Tree):
          The tree to be binarized.
  
  Returns:
      The binarized tree.
  
  Examples:
      >>> tree = nltk.Tree.fromstring('''
                                      (TOP
                                        (S
                                          (NP (_ She))
                                          (VP (_ enjoys) (S (VP (_ playing) (NP (_ tennis)))))
                                          (_ .)))
                                      )'''
      >>> print(Tree.binarize(tree))
      (TOP
        (S
          (S|<>
            (NP (_ She))
            (VP
              (VP|<> (_ enjoys))
              (S+VP (VP|<> (_ playing)) (NP (_ tennis)))))
          (S|<> (_ .))))
  
  .. _Chomsky Normal Form (CNF):
      https://en.wikipedia.org/wiki/Chomsky_normal_form
code: def binarize(cls, tree):
      r"""
      Conducts binarization over the tree.
  
      First, the tree is transformed to satisfy `Chomsky Normal Form (CNF)`_.
      Here we call :meth:`~nltk.tree.Tree.chomsky_normal_form` to conduct left-binarization.
      Second, all unary productions in the tree are collapsed.
  
      Args:
          tree (nltk.tree.Tree):
              The tree to be binarized.
  
      Returns:
          The binarized tree.
  
      Examples:
          >>> tree = nltk.Tree.fromstring('''
                                          (TOP
                                            (S
                                              (NP (_ She))
                                              (VP (_ enjoys) (S (VP (_ playing) (NP (_ tennis)))))
                                              (_ .)))
                                          )'''
          >>> print(Tree.binarize(tree))
          (TOP
            (S
              (S|<>
                (NP (_ She))
                (VP
                  (VP|<> (_ enjoys))
                  (S+VP (VP|<> (_ playing)) (NP (_ tennis)))))
              (S|<> (_ .))))
  
      .. _Chomsky Normal Form (CNF):
          https://en.wikipedia.org/wiki/Chomsky_normal_form
      """
  
      tree = tree.copy(True)
      nodes = [tree]
      while nodes:
          node = nodes.pop()
          if isinstance(node, nltk.Tree):
              nodes.extend([child for child in node])
              if len(node) > 1:
                  for i, child in enumerate(node):
                      if not isinstance(child[0], nltk.Tree):
                          node[i] = nltk.Tree(
                              f"{node.label()}|<>", [child]
                          )
      tree.chomsky_normal_form("left", 0, 0)
      tree.collapse_unary()
  
      return tree
  
imports: from collections.abc import Iterable
  import nltk
  from tqdm import tqdm
  from underthesea.utils.sp_parallel import is_master
label_desc: Use image node_id 5 for calling the Tree obj's underlying member method code with example usage: obj.binarize(cls, tree) and returns: tree