code: def __init__(
      self,
      src_dict,
      tgt_dict,
      sequence_generator,
      filter_eos_bos,
      copy_unk_token=False,
      dictfeat_dict=None,
  ):
      super().__init__()
      self.source_vocab = ScriptVocabulary(
          src_dict._vocab,
          src_dict.get_unk_index(),
          bos_idx=src_dict.get_bos_index(-1),
          eos_idx=src_dict.get_eos_index(-1),
      )
      self.target_vocab = ScriptVocabulary(
          tgt_dict._vocab,
          tgt_dict.get_unk_index(),
          bos_idx=tgt_dict.get_bos_index(),
          eos_idx=tgt_dict.get_eos_index(),
      )
      if dictfeat_dict:
          self.dictfeat_vocab = ScriptVocabulary(
              dictfeat_dict._vocab,
              # We want to use the index for the source pad token
              pad_idx=dictfeat_dict.idx[
                  src_dict[src_dict.get_pad_index()]
              ],
          )
      else:
          # Optional types in Torchscript are a bit of a pain, so it's
          # more convenient to have an empty model than use None in
          # this case.
          self.dictfeat_vocab = ScriptVocabulary([])
      self.sequence_generator = sequence_generator
  
      self.copy_unk_token: bool = copy_unk_token
      self.unk_idx: int = self.source_vocab.unk_idx
      self.filter_eos_bos: bool = filter_eos_bos
  
file_path: pytext/pytext/torchscript/seq2seq/export_model.py
imports: from typing import List, Optional, Tuple
  import torch
  from pytext.torchscript.vocab import ScriptVocabulary
label_desc: Use image node_id 1 to create a new Seq2SeqJIT object from inherited base classes: torch.nn with example: obj = Seq2SeqJIT(src_dict, tgt_dict, sequence_generator, filter_eos_bos, copy_unk_token, dictfeat_dict)