code: def _init_model(
      self,
      summarizer: Summarizer,
      train_data: Iterable[Tuple[str, str]],
  ) -> None:
      tokenizer_encoder, tokenizer_decoder = self._create_tokenizers(
          train_data
      )
      self.logger.info(
          "vocab encoder: {vocab_enc}, vocab decoder: {vocab_dec}".format(
              vocab_enc=tokenizer_encoder.vocab_size,
              vocab_dec=tokenizer_decoder.vocab_size,
          )
      )
      vectorizer = Vectorizer(
          tokenizer_encoder,
          tokenizer_decoder,
          max_input_len=self.max_input_len,
          max_output_len=self.max_output_len,
      )
      embedding_weights_encoder, embedding_weights_decoder = None, None
  
      if self.embedding_path_encoder is not None:
          self.logger.info(
              "loading encoder embedding from {}".format(
                  self.embedding_path_encoder
              )
          )
          embedding = read_embedding(
              self.embedding_path_encoder, summarizer.embedding_size
          )
          embedding_weights_encoder = embedding_to_matrix(
              embedding=embedding,
              token_index=tokenizer_encoder.token_index,
              embedding_dim=summarizer.embedding_size,
          )
      if self.embedding_path_decoder is not None:
          self.logger.info(
              "loading decoder embedding from {}".format(
                  self.embedding_path_decoder
              )
          )
          embedding = read_embedding(
              self.embedding_path_decoder, summarizer.embedding_size
          )
          embedding_weights_decoder = embedding_to_matrix(
              embedding=embedding,
              token_index=tokenizer_decoder.token_index,
              embedding_dim=summarizer.embedding_size,
          )
      summarizer.init_model(
          preprocessor=self.preprocessor,
          vectorizer=vectorizer,
          embedding_weights_encoder=embedding_weights_encoder,
          embedding_weights_decoder=embedding_weights_decoder,
      )
  
imports: import datetime
  import logging
  import os
  import tempfile
  from collections import Counter
  from typing import Tuple, List, Iterable, Callable, Dict, Union
  import tensorflow
  import yaml
  from headliner.callbacks.evaluation_callback import EvaluationCallback
  from headliner.callbacks.model_checkpoint_callback import ModelCheckpointCallback
  from headliner.callbacks.tensorboard_callback import TensorboardCallback
  from headliner.callbacks.validation_callback import ValidationCallback
  from headliner.embeddings import read_embedding, embedding_to_matrix
  from headliner.evaluation.scorer import Scorer
  from headliner.losses import masked_crossentropy
  from headliner.model.bert_summarizer import BertSummarizer
  from headliner.model.summarizer import Summarizer
  from headliner.preprocessing.bucket_generator import BucketGenerator
  from headliner.preprocessing.dataset_generator import DatasetGenerator
  from headliner.preprocessing.keras_tokenizer import KerasTokenizer
  from headliner.preprocessing.preprocessor import Preprocessor
  from headliner.preprocessing.vectorizer import Vectorizer
  from headliner.utils.logger import get_logger
label_desc: Use image node_id 4 for calling the Trainer obj's underlying member method code with example usage: obj._init_model(summarizer, train_data) without return types