docstr: Init Labeling Model
  
  Args:
      embedding: embedding object
      sequence_length: target sequence length
      hyper_parameters: hyper_parameters to overwrite
      **kwargs:
docstr_tok: ["Init","Labeling","Model","Args",":","embedding",":","embedding","object","sequence_length",":","target","sequence","length","hyper_parameters",":","hyper_parameters","to","overwrite","*","*","kwargs",":"]
code: def __init__(
      self,
      encoder_embedding: ABCEmbedding = None,
      decoder_embedding: ABCEmbedding = None,
      encoder_seq_length: int = None,
      decoder_seq_length: int = None,
      hidden_size: int = 1024,
      **kwargs: Any,
  ):
      """
      Init Labeling Model
  
      Args:
          embedding: embedding object
          sequence_length: target sequence length
          hyper_parameters: hyper_parameters to overwrite
          **kwargs:
      """
      logger.warning(
          "Seq2Seq API is experimental. It may be changed in the future without notice."
      )
      if encoder_embedding is None:
          encoder_embedding = BareEmbedding(embedding_size=256)  # type: ignore
  
      self.encoder_embedding = encoder_embedding
  
      if decoder_embedding is None:
          decoder_embedding = BareEmbedding(embedding_size=256)  # type: ignore
  
      self.decoder_embedding = decoder_embedding
  
      self.encoder_processor = SequenceProcessor(min_count=1)
      self.decoder_processor = SequenceProcessor(
          build_vocab_from_labels=True, min_count=1
      )
  
      self.encoder: GRUEncoder = None
      self.decoder: AttGRUDecoder = None
  
      self.hidden_size: int = hidden_size
  
      self.encoder_seq_length = encoder_seq_length
      self.decoder_seq_length = decoder_seq_length
  
      self.optimizer = tf.keras.optimizers.Adam()
      self.loss_object = tf.keras.losses.SparseCategoricalCrossentropy(
          from_logits=True, reduction="none"
      )
  
imports: import json
  import os
  import pathlib
  from typing import Any, Tuple, List, Dict
  import numpy
  import tensorflow
  import tqdm
  import kashgari
  from kashgari.embeddings import BareEmbedding
  from kashgari.embeddings.abc_embedding import ABCEmbedding
  from kashgari.generators import CorpusGenerator, Seq2SeqDataSet
  from kashgari.logger import logger
  from kashgari.processors import SequenceProcessor
  from kashgari.tasks.seq2seq.decoder import AttGRUDecoder
  from kashgari.tasks.seq2seq.encoder import GRUEncoder
  from kashgari.types import TextSamplesVar
label_desc: Use image node_id 2 to create a new Seq2Seq object  with example: obj = Seq2Seq(encoder_embedding, decoder_embedding, encoder_seq_length, decoder_seq_length, hidden_size)