code: def __init__(self, vocab, config):
      super(QGModel, self).__init__()
      self.config = config
      self.vocab = vocab
      self.use_coverage = self.config["decoder_args"][
          "rnn_decoder_share"
      ]["use_coverage"]
  
      # build Graph2Seq model
      self.g2s = Graph2Seq.from_args(config, self.vocab)
  
      if (
          "w2v"
          in self.g2s.graph_initializer.embedding_layer.word_emb_layers
      ):
          self.word_emb = self.g2s.graph_initializer.embedding_layer.word_emb_layers[
              "w2v"
          ].word_emb_layer
      else:
          self.word_emb = WordEmbedding(
              self.vocab.in_word_vocab.embeddings.shape[0],
              self.vocab.in_word_vocab.embeddings.shape[1],
              pretrained_word_emb=self.vocab.in_word_vocab.embeddings,
              fix_emb=config["graph_initialization_args"][
                  "fix_word_emb"
              ],
          ).word_emb_layer
      self.g2s.seq_decoder.tgt_emb = self.word_emb
  
      self.loss_calc = Graph2SeqLoss(
          ignore_index=self.vocab.out_word_vocab.PAD,
          use_coverage=self.use_coverage,
          coverage_weight=config["coverage_loss_ratio"],
      )
  
      # Replace the default embedding construction layer
      #   with the customized passage-answer alignment embedding construction layer
      # TODO: delete the default layer and clear the memory
      embedding_styles = config["graph_initialization_args"][
          "embedding_style"
      ]
      self.g2s.graph_initializer.embedding_layer = (
          FusedEmbeddingConstruction(
              self.vocab.in_word_vocab,
              embedding_styles["single_token_item"],
              emb_strategy=embedding_styles["emb_strategy"],
              hidden_size=config["graph_initialization_args"][
                  "hidden_size"
              ],
              num_rnn_layers=embedding_styles.get("num_rnn_layers", 1),
              fix_word_emb=config["graph_initialization_args"][
                  "fix_word_emb"
              ],
              fix_bert_emb=config["graph_initialization_args"][
                  "fix_bert_emb"
              ],
              bert_model_name=embedding_styles.get(
                  "bert_model_name", "bert-base-uncased"
              ),
              bert_lower_case=embedding_styles.get(
                  "bert_lower_case", True
              ),
              word_dropout=config["graph_initialization_args"][
                  "word_dropout"
              ],
              bert_dropout=config["graph_initialization_args"].get(
                  "bert_dropout", None
              ),
              rnn_dropout=config["graph_initialization_args"][
                  "rnn_dropout"
              ],
          )
      )
      self.graph_name = self.g2s.graph_name
      self.vocab_model = self.g2s.vocab_model
  
imports: import argparse
  import multiprocessing
  import os
  import platform
  import time
  import numpy
  import torch
  import torch.backends.cudnn
  import torch.multiprocessing
  import torch.nn
  import torch.optim
  from torch.optim.lr_scheduler import ReduceLROnPlateau
  from torch.utils.data import DataLoader
  from graph4nlp.pytorch.datasets.squad import SQuADDataset
  from graph4nlp.pytorch.models.graph2seq import Graph2Seq
  from graph4nlp.pytorch.models.graph2seq_loss import Graph2SeqLoss
  from graph4nlp.pytorch.modules.config import get_basic_args
  from graph4nlp.pytorch.modules.evaluation import BLEU, METEOR, ROUGE
  from graph4nlp.pytorch.modules.graph_embedding_initialization.embedding_construction import WordEmbedding
  from graph4nlp.pytorch.modules.utils import constants
  from graph4nlp.pytorch.modules.utils.config_utils import get_yaml_config, update_values
  from graph4nlp.pytorch.modules.utils.copy_utils import prepare_ext_vocab
  from graph4nlp.pytorch.modules.utils.generic_utils import EarlyStopping, grid, to_cuda
  from graph4nlp.pytorch.modules.utils.logger import Logger
  from .fused_embedding_construction import FusedEmbeddingConstruction
label_desc: Use image node_id 1 to create a new QGModel object from inherited base classes: nn with example: obj = QGModel(vocab, config)