class_docstr: Class for constituency graph construction.
  
  ...
  
  Attributes
  ----------
  embedding_styles : (dict)
      Specify embedding styles including ``single_token_item``, ``emb_strategy``,
      ``num_rnn_layers``, ``bert_model_name`` and ``bert_lower_case``.
  
  vocab: (set, optional)
      Vocabulary including all words appeared in graphs.
  
  Methods
  -------
  
  topology(raw_text_data, nlp_processor, merge_strategy=None, edge_strategy=None)
      Generate graph structure with nlp parser like ``CoreNLP`` etc.
  
  _construct_static_graph(parsed_object, sub_sentence_id, edge_strategy=None)
      Construct a single static graph from a single sentence,
      to be called by ``topology`` function.
  
  _graph_connect(nx_graph_list, merge_strategy=None)
      Construct a merged graph from a list of graphs, to be called by ``topology`` function.
  
  embedding(node_attributes, edge_attributes)
      Generate node/edge embeddings from node/edge attributes through an embedding layer.
  
  forward(raw_text_data, nlp_parser)
      Generate graph topology and embeddings.
class_docstr_tok: ["Class","for","constituency","graph","construction",".","...","Attributes","--","--","--","--","--","embedding_styles",":","(","dict",")","Specify","embedding","styles","including","``","single_token_item","``",",","``","emb_strategy","``",",","``","num_rnn_layers","``",",","``","bert_model_name","``","and","``","bert_lower_case","``",".","vocab",":","(","set",",","optional",")","Vocabulary","including","all","words","appeared","in","graphs",".","Methods","--","--","--","-","topology","(","raw_text_data",",","nlp_processor",",","merge_strategy=None",",","edge_strategy=None",")","Generate","graph","structure","with","nlp","parser","like","``","CoreNLP","``","etc",".","_construct_static_graph","(","parsed_object",",","sub_sentence_id",",","edge_strategy=None",")","Construct","a","single","static","graph","from","a","single","sentence",",","to","be","called","by","``","topology","``","function",".","_graph_connect","(","nx_graph_list",",","merge_strategy=None",")","Construct","a","merged","graph","from","a","list","of","graphs",",","to","be","called","by","``","topology","``","function",".","embedding","(","node_attributes",",","edge_attributes",")","Generate","node\/edge","embeddings","from","node\/edge","attributes","through","an","embedding","layer",".","forward","(","raw_text_data",",","nlp_parser",")","Generate","graph","topology","and","embeddings","."]
docstr: Parameters
  ----------
  raw_text_data: str
  nlp_processor: StanfordCoreNLP
  processor_args: json config for constituency graph construction
docstr_tok: ["Parameters","--","--","--","--","--","raw_text_data",":","str","nlp_processor",":","StanfordCoreNLP","processor_args",":","json","config","for","constituency","graph","construction"]
code: def parsing(cls, raw_text_data, nlp_processor, processor_args):
      """
      Parameters
      ----------
      raw_text_data: str
      nlp_processor: StanfordCoreNLP
      processor_args: json config for constituency graph construction
      """
      output = nlp_processor.annotate(
          raw_text_data.strip()
          .replace("(", "<LB>")
          .replace(")", "<RB>"),
          properties=processor_args,
      )
      if CORENLP_TIMEOUT_SIGNATURE in output:
          raise TimeoutError(
              "CoreNLP timed out at input: \n{}\n This item will be skipped. "
              "Please check the input or change the timeout threshold.".format(
                  raw_text_data
              )
          )
      parsed_output = json.loads(output)["sentences"]
      return parsed_output
  
file_path: graph4nlp/graph4nlp/pytorch/modules/graph_construction/constituency_graph_construction.py
imports: import copy
  import json
  from pythonds.basic.stack import Stack
  from graph4nlp.pytorch.data.data import GraphData
  from .base import StaticGraphConstructionBase
  from .utils import CORENLP_TIMEOUT_SIGNATURE
label_desc: Use image node_id 2 for calling the ConstituencyBasedGraphConstruction obj's underlying member method code with example usage: obj.parsing(cls, raw_text_data, nlp_processor, processor_args) and returns: parsed_output