docstr: Parameters
  ----------
  model_path
  vocab
  separator
  bpe_dropout
  suffix
docstr_tok: ["Parameters","--","--","--","--","--","model_path","vocab","separator","bpe_dropout","suffix"]
code: def __init__(
      self,
      model_path,
      vocab: Union[str, Vocab],
      separator: str = "@@",
      bpe_dropout: float = 0.0,
      suffix: str = "</w>",
  ):
      """
  
      Parameters
      ----------
      model_path
      vocab
      separator
      bpe_dropout
      suffix
      """
      try_import_subword_nmt()
      from subword_nmt.apply_bpe import BPE
  
      self._model_path = model_path
      self._vocab = load_vocab(vocab)
      self._separator = separator
      self._bpe_dropout = bpe_dropout
      self._suffix = suffix
      with open(self._model_path, "r", encoding="utf-8") as merge_codes:
          self._bpe = BPE(codes=merge_codes, separator=self._separator)
      self._last_subword_id_set = frozenset(
          [
              self._vocab[ele]
              for ele in self._vocab.all_tokens
              if not ele.endswith(self._separator)
          ]
      )
  
file_path: gluon-nlp/src/gluonnlp/data/tokenizers/subword_nmt.py
imports: import os
  from typing import Optional, Union, List
  from .base import TOKENIZER_REGISTRY, BaseTokenizerWithVocab, TokenizerEncodeWithoutVocabError, TokenizerDecodeWithoutVocabError, TokenTypeNotSupportedError, rebuild_offset_from_tokens, TokensType, TokenIDsType, TokenOffsetsType, SentencesType, is_tokens_from_multiple_sentences, get_token_type
  from ..vocab import Vocab, load_vocab
  from ...utils.lazy_imports import try_import_subword_nmt
label_desc: Use image node_id 1 to create a new SubwordNMTTokenizer object from inherited base classes: BaseTokenizerWithVocab with example: obj = SubwordNMTTokenizer(model_path, vocab, separator, bpe_dropout, suffix)