class_docstr:     Dependency-parsing-tree based graph construction class
  
  Parameters
  ----------
  vocab: VocabModel
      Vocabulary including all words appeared in graphs.
class_docstr_tok: ["Dependency-parsing-tree","based","graph","construction","class","Parameters","--","--","--","--","--","vocab",":","VocabModel","Vocabulary","including","all","words","appeared","in","graphs","."]
docstr:     Graph building method.
  
  Parameters
  ----------
  raw_text_data: str or list[list]
      Raw text data, it can be multi-sentences.
      When it is ``str`` type, it is the raw text.
      When it is ``list[list]`` type, it is the tokenized token lists.
  nlp_processor: StanfordCoreNLP
      NLP parsing tools
  processor_args: dict
      The configure dict for StanfordCoreNLP.annotate
  merge_strategy: None or str, option=[None, "tailhead", "user_define"]
      Strategy to merge sub-graphs into one graph
      ``None``: It will be the default option. We will do as ``"tailhead"``.
      ``"tailhead"``: Link the sub-graph  ``i``'s tail node with ``i+1``'s head node
      ``"user_define"``: We will give this option to the user. User can override this method to define your merge # noqa
                         strategy.
  edge_strategy: None or str, option=[None, "homogeneous", "heterogeneous", "as_node"]
      Strategy to process edge.
      ``None``: It will be the default option. We will do as ``"homogeneous"``.
      ``"homogeneous"``: We will drop the edge type information.
                         If there is a linkage among node ``i`` and node ``j``, we will add an edge whose weight # noqa
                         is ``1.0``. Otherwise there is no edge.
      ``heterogeneous``: We will keep the edge type information.
                         An edge will have type information like ``n_subj``.
      ``as_node``: We will view the edge as a graph node.
                   If there is an edge whose type is ``k`` between node ``i`` and node ``j``,
                   we will insert a node ``k`` into the graph and link node (``i``, ``k``) and (``k``, ``j``). # noqa
  
  sequential_link: bool, default=True
      Whether to link node tokens sequentially (note that it is bidirectional)
  verbose: int, default=0
      Whether to output log infors. Set 1 to output more infos.
  Returns
  -------
  joint_graph: GraphData
      The merged graph data-structure.
docstr_tok: ["Graph","building","method",".","Parameters","--","--","--","--","--","raw_text_data",":","str","or","list","[","list","]","Raw","text","data",",","it","can","be","multi-sentences",".","When","it","is","``","str","``","type",",","it","is","the","raw","text",".","When","it","is","``","list","[","list","]","``","type",",","it","is","the","tokenized","token","lists",".","nlp_processor",":","StanfordCoreNLP","NLP","parsing","tools","processor_args",":","dict","The","configure","dict","for","StanfordCoreNLP.annotate","merge_strategy",":","None","or","str",",","option=","[","None",",","``","tailhead","''",",","``","user_define","''","]","Strategy","to","merge","sub-graphs","into","one","graph","``","None","``",":","It","will","be","the","default","option",".","We","will","do","as","``","``","tailhead","''","``",".","``","``","tailhead","''","``",":","Link","the","sub-graph","``","i","``","'s","tail","node","with","``","i+1","``","'s","head","node","``","``","user_define","''","``",":","We","will","give","this","option","to","the","user",".","User","can","override","this","method","to","define","your","merge","#","noqa","strategy",".","edge_strategy",":","None","or","str",",","option=","[","None",",","``","homogeneous","''",",","``","heterogeneous","''",",","``","as_node","''","]","Strategy","to","process","edge",".","``","None","``",":","It","will","be","the","default","option",".","We","will","do","as","``","``","homogeneous","''","``",".","``","``","homogeneous","''","``",":","We","will","drop","the","edge","type","information",".","If","there","is","a","linkage","among","node","``","i","``","and","node","``","j","``",",","we","will","add","an","edge","whose","weight","#","noqa","is","``","1.0","``",".","Otherwise","there","is","no","edge",".","``","heterogeneous","``",":","We","will","keep","the","edge","type","information",".","An","edge","will","have","type","information","like","``","n_subj","``",".","``","as_node","``",":","We","will","view","the","edge","as","a","graph","node",".","If","there","is","an","edge","whose","type","is","``","k","``","between","node","``","i","``","and","node","``","j","``",",","we","will","insert","a","node","``","k","``","into","the","graph","and","link","node","(","``","i","``",",","``","k","``",")","and","(","``","k","``",",","``","j","``",")",".","#","noqa","sequential_link",":","bool",",","default=True","Whether","to","link","node","tokens","sequentially","(","note","that","it","is","bidirectional",")","verbose",":","int",",","default=0","Whether","to","output","log","infors",".","Set","1","to","output","more","infos",".","Returns","--","--","--","-","joint_graph",":","GraphData","The","merged","graph","data-structure","."]
code: def static_topology(
      cls,
      raw_text_data,
      nlp_processor,
      processor_args,
      merge_strategy,
      edge_strategy,
      sequential_link=True,
      verbose=0,
  ):
      """
          Graph building method.
  
      Parameters
      ----------
      raw_text_data: str or list[list]
          Raw text data, it can be multi-sentences.
          When it is ``str`` type, it is the raw text.
          When it is ``list[list]`` type, it is the tokenized token lists.
      nlp_processor: StanfordCoreNLP
          NLP parsing tools
      processor_args: dict
          The configure dict for StanfordCoreNLP.annotate
      merge_strategy: None or str, option=[None, "tailhead", "user_define"]
          Strategy to merge sub-graphs into one graph
          ``None``: It will be the default option. We will do as ``"tailhead"``.
          ``"tailhead"``: Link the sub-graph  ``i``'s tail node with ``i+1``'s head node
          ``"user_define"``: We will give this option to the user. User can override this method to define your merge # noqa
                             strategy.
      edge_strategy: None or str, option=[None, "homogeneous", "heterogeneous", "as_node"]
          Strategy to process edge.
          ``None``: It will be the default option. We will do as ``"homogeneous"``.
          ``"homogeneous"``: We will drop the edge type information.
                             If there is a linkage among node ``i`` and node ``j``, we will add an edge whose weight # noqa
                             is ``1.0``. Otherwise there is no edge.
          ``heterogeneous``: We will keep the edge type information.
                             An edge will have type information like ``n_subj``.
          ``as_node``: We will view the edge as a graph node.
                       If there is an edge whose type is ``k`` between node ``i`` and node ``j``,
                       we will insert a node ``k`` into the graph and link node (``i``, ``k``) and (``k``, ``j``). # noqa
  
      sequential_link: bool, default=True
          Whether to link node tokens sequentially (note that it is bidirectional)
      verbose: int, default=0
          Whether to output log infors. Set 1 to output more infos.
      Returns
      -------
      joint_graph: GraphData
          The merged graph data-structure.
      """
      cls.verbose = verbose
  
      parsed_results = cls.parsing(
          raw_text_data=raw_text_data,
          nlp_processor=nlp_processor,
          processor_args=processor_args,
      )
  
      sub_graphs = []
      for parsed_sent in parsed_results:
          graph = cls._construct_static_graph(
              parsed_sent,
              edge_strategy=edge_strategy,
              sequential_link=sequential_link,
          )
          sub_graphs.append(graph)
      joint_graph = cls._graph_connect(sub_graphs, merge_strategy)
      return joint_graph
  
file_path: graph4nlp/graph4nlp/pytorch/modules/graph_construction/dependency_graph_construction.py
imports: import copy
  import json
  from ...data.data import GraphData
  from .base import StaticGraphConstructionBase
label_desc: Use image node_id 4 for calling the DependencyBasedGraphConstruction obj's underlying member method code with example usage: obj.static_topology(cls, raw_text_data, nlp_processor, processor_args, merge_strategy, edge_strategy, sequential_link, verbose) and returns: joint_graph