code: def __init__(self, vocab, config):
      super(SumModel, 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)
  
      self.graph_name = self.config["graph_construction_args"][
          "graph_construction_share"
      ]["graph_name"]
  
      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_construction_args"][
                  "node_embedding"
              ]["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"],
      )
  
imports: import argparse
  import os
  import time
  import numpy
  import torch
  import torch.backends.cudnn
  import torch.nn
  import torch.optim
  from torch.optim.lr_scheduler import ReduceLROnPlateau
  from torch.utils.data import DataLoader
  from graph4nlp.pytorch.datasets.cnn import CNNDataset
  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.rouge import 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, to_cuda
  from graph4nlp.pytorch.modules.utils.logger import Logger
  from graph4nlp.pytorch.modules.utils.summarization_utils import wordid2str
label_desc: Use image node_id 1 to create a new SumModel object from inherited base classes: nn with example: obj = SumModel(vocab, config)