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: Args:
      data (list[list] or str):
          A list of instances or a filename.
      max_len (int):
          Sentences exceeding the length will be discarded. Default: ``None``.
  
  Returns:
      A list of :class:`TreeSentence` instances.
code: def load(self, data, max_len=None, **kwargs):
      r"""
      Args:
          data (list[list] or str):
              A list of instances or a filename.
          max_len (int):
              Sentences exceeding the length will be discarded. Default: ``None``.
  
      Returns:
          A list of :class:`TreeSentence` instances.
      """
      if isinstance(data, str):
          with open(data, "r") as f:
              trees = [nltk.Tree.fromstring(string) for string in f]
          self.root = trees[0].label()
      else:
          data = [data] if isinstance(data[0], str) else data
          trees = [self.totree(i, self.root) for i in data]
  
      i, sentences = 0, []
      for tree in progress_bar(trees, leave=False):
          if len(tree) == 1 and not isinstance(tree[0][0], nltk.Tree):
              continue
          sentences.append(TreeSentence(self, tree))
          i += 1
      if max_len is not None:
          sentences = [i for i in sentences if len(i) < max_len]
  
      return sentences
  
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 8 for calling the Tree obj's underlying member method code with example usage: obj.load(data, max_len) and returns: sentences