class_docstr: A container for the nodes and labelled edges of a dependency structure.
docstr: Dependency graph.
  
  We place a dummy `TOP` node with the index 0, since the root node is
  often assigned 0 as its head. This also means that the indexing of the
  nodes corresponds directly to the Malt-TAB format, which starts at 1.
  
  If zero-based is True, then Malt-TAB-like input with node numbers
  starting at 0 and the root node assigned -1 (as produced by, e.g.,
  zpar).
  
  :param str cell_separator: the cell separator. If not provided, cells
      are split by whitespace.
  
  :param str top_relation_label: the label by which the top relation is
      identified, for examlple, `ROOT`, `null` or `TOP`.
docstr_tok: ["Dependency","graph",".","We","place","a","dummy","`","TOP","`","node","with","the","index","0",",","since","the","root","node","is","often","assigned","0","as","its","head",".","This","also","means","that","the","indexing","of","the","nodes","corresponds","directly","to","the","Malt-TAB","format",",","which","starts","at","1",".","If","zero-based","is","True",",","then","Malt-TAB-like","input","with","node","numbers","starting","at","0","and","the","root","node","assigned","-1","(","as","produced","by",",","e.g.",",","zpar",")",".",":","param","str","cell_separator",":","the","cell","separator",".","If","not","provided",",","cells","are","split","by","whitespace",".",":","param","str","top_relation_label",":","the","label","by","which","the","top","relation","is","identified",",","for","examlple",",","`","ROOT","`",",","`","null","`","or","`","TOP","`","."]
code: def __init__(
      self,
      tree_str=None,
      cell_extractor=None,
      zero_based=False,
      cell_separator=None,
      top_relation_label="ROOT",
  ):
      """Dependency graph.
  
      We place a dummy `TOP` node with the index 0, since the root node is
      often assigned 0 as its head. This also means that the indexing of the
      nodes corresponds directly to the Malt-TAB format, which starts at 1.
  
      If zero-based is True, then Malt-TAB-like input with node numbers
      starting at 0 and the root node assigned -1 (as produced by, e.g.,
      zpar).
  
      :param str cell_separator: the cell separator. If not provided, cells
          are split by whitespace.
  
      :param str top_relation_label: the label by which the top relation is
          identified, for examlple, `ROOT`, `null` or `TOP`.
      """
      self.nodes = defaultdict(
          lambda: {
              "address": None,
              "word": None,
              "lemma": None,
              "ctag": None,
              "tag": None,
              "feats": None,
              "head": None,
              "deps": defaultdict(list),
              "rel": None,
          }
      )
  
      self.nodes[0].update({"ctag": "TOP", "tag": "TOP", "address": 0})
  
      self.root = None
  
      if tree_str:
          self._parse(
              tree_str,
              cell_extractor=cell_extractor,
              zero_based=zero_based,
              cell_separator=cell_separator,
              top_relation_label=top_relation_label,
          )
  
imports: import subprocess
  import warnings
  from collections import defaultdict
  from itertools import chain
  from pprint import pformat
  from nltk.internals import find_binary
  from nltk.tree import Tree
label_desc: Use image node_id 1 to create a new DependencyGraph object  with example: obj = DependencyGraph(tree_str, cell_extractor, zero_based, cell_separator, top_relation_label)