


"""simple docstring"""







import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_bert import BertTokenizer


__lowercase    					=      logging.get_logger(__name__)

__lowercase    					=      {"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

__lowercase    					=      {
    """vocab_file""": {
        """bert-base-uncased""": """https://huggingface.co/bert-base-uncased/resolve/main/vocab.txt""",
        """bert-large-uncased""": """https://huggingface.co/bert-large-uncased/resolve/main/vocab.txt""",
        """bert-base-cased""": """https://huggingface.co/bert-base-cased/resolve/main/vocab.txt""",
        """bert-large-cased""": """https://huggingface.co/bert-large-cased/resolve/main/vocab.txt""",
        """bert-base-multilingual-uncased""": (
            """https://huggingface.co/bert-base-multilingual-uncased/resolve/main/vocab.txt"""
        ),
        """bert-base-multilingual-cased""": """https://huggingface.co/bert-base-multilingual-cased/resolve/main/vocab.txt""",
        """bert-base-chinese""": """https://huggingface.co/bert-base-chinese/resolve/main/vocab.txt""",
        """bert-base-german-cased""": """https://huggingface.co/bert-base-german-cased/resolve/main/vocab.txt""",
        """bert-large-uncased-whole-word-masking""": (
            """https://huggingface.co/bert-large-uncased-whole-word-masking/resolve/main/vocab.txt"""
        ),
        """bert-large-cased-whole-word-masking""": (
            """https://huggingface.co/bert-large-cased-whole-word-masking/resolve/main/vocab.txt"""
        ),
        """bert-large-uncased-whole-word-masking-finetuned-squad""": (
            """https://huggingface.co/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/vocab.txt"""
        ),
        """bert-large-cased-whole-word-masking-finetuned-squad""": (
            """https://huggingface.co/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/vocab.txt"""
        ),
        """bert-base-cased-finetuned-mrpc""": (
            """https://huggingface.co/bert-base-cased-finetuned-mrpc/resolve/main/vocab.txt"""
        ),
        """bert-base-german-dbmdz-cased""": """https://huggingface.co/bert-base-german-dbmdz-cased/resolve/main/vocab.txt""",
        """bert-base-german-dbmdz-uncased""": (
            """https://huggingface.co/bert-base-german-dbmdz-uncased/resolve/main/vocab.txt"""
        ),
        """TurkuNLP/bert-base-finnish-cased-v1""": (
            """https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/vocab.txt"""
        ),
        """TurkuNLP/bert-base-finnish-uncased-v1""": (
            """https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/vocab.txt"""
        ),
        """wietsedv/bert-base-dutch-cased""": (
            """https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/vocab.txt"""
        ),
    },
    """tokenizer_file""": {
        """bert-base-uncased""": """https://huggingface.co/bert-base-uncased/resolve/main/tokenizer.json""",
        """bert-large-uncased""": """https://huggingface.co/bert-large-uncased/resolve/main/tokenizer.json""",
        """bert-base-cased""": """https://huggingface.co/bert-base-cased/resolve/main/tokenizer.json""",
        """bert-large-cased""": """https://huggingface.co/bert-large-cased/resolve/main/tokenizer.json""",
        """bert-base-multilingual-uncased""": (
            """https://huggingface.co/bert-base-multilingual-uncased/resolve/main/tokenizer.json"""
        ),
        """bert-base-multilingual-cased""": (
            """https://huggingface.co/bert-base-multilingual-cased/resolve/main/tokenizer.json"""
        ),
        """bert-base-chinese""": """https://huggingface.co/bert-base-chinese/resolve/main/tokenizer.json""",
        """bert-base-german-cased""": """https://huggingface.co/bert-base-german-cased/resolve/main/tokenizer.json""",
        """bert-large-uncased-whole-word-masking""": (
            """https://huggingface.co/bert-large-uncased-whole-word-masking/resolve/main/tokenizer.json"""
        ),
        """bert-large-cased-whole-word-masking""": (
            """https://huggingface.co/bert-large-cased-whole-word-masking/resolve/main/tokenizer.json"""
        ),
        """bert-large-uncased-whole-word-masking-finetuned-squad""": (
            """https://huggingface.co/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/tokenizer.json"""
        ),
        """bert-large-cased-whole-word-masking-finetuned-squad""": (
            """https://huggingface.co/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/tokenizer.json"""
        ),
        """bert-base-cased-finetuned-mrpc""": (
            """https://huggingface.co/bert-base-cased-finetuned-mrpc/resolve/main/tokenizer.json"""
        ),
        """bert-base-german-dbmdz-cased""": (
            """https://huggingface.co/bert-base-german-dbmdz-cased/resolve/main/tokenizer.json"""
        ),
        """bert-base-german-dbmdz-uncased""": (
            """https://huggingface.co/bert-base-german-dbmdz-uncased/resolve/main/tokenizer.json"""
        ),
        """TurkuNLP/bert-base-finnish-cased-v1""": (
            """https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/tokenizer.json"""
        ),
        """TurkuNLP/bert-base-finnish-uncased-v1""": (
            """https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/tokenizer.json"""
        ),
        """wietsedv/bert-base-dutch-cased""": (
            """https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/tokenizer.json"""
        ),
    },
}

__lowercase    					=      {
    """bert-base-uncased""": 512,
    """bert-large-uncased""": 512,
    """bert-base-cased""": 512,
    """bert-large-cased""": 512,
    """bert-base-multilingual-uncased""": 512,
    """bert-base-multilingual-cased""": 512,
    """bert-base-chinese""": 512,
    """bert-base-german-cased""": 512,
    """bert-large-uncased-whole-word-masking""": 512,
    """bert-large-cased-whole-word-masking""": 512,
    """bert-large-uncased-whole-word-masking-finetuned-squad""": 512,
    """bert-large-cased-whole-word-masking-finetuned-squad""": 512,
    """bert-base-cased-finetuned-mrpc""": 512,
    """bert-base-german-dbmdz-cased""": 512,
    """bert-base-german-dbmdz-uncased""": 512,
    """TurkuNLP/bert-base-finnish-cased-v1""": 512,
    """TurkuNLP/bert-base-finnish-uncased-v1""": 512,
    """wietsedv/bert-base-dutch-cased""": 512,
}

__lowercase    					=      {
    """bert-base-uncased""": {"""do_lower_case""": True},
    """bert-large-uncased""": {"""do_lower_case""": True},
    """bert-base-cased""": {"""do_lower_case""": False},
    """bert-large-cased""": {"""do_lower_case""": False},
    """bert-base-multilingual-uncased""": {"""do_lower_case""": True},
    """bert-base-multilingual-cased""": {"""do_lower_case""": False},
    """bert-base-chinese""": {"""do_lower_case""": False},
    """bert-base-german-cased""": {"""do_lower_case""": False},
    """bert-large-uncased-whole-word-masking""": {"""do_lower_case""": True},
    """bert-large-cased-whole-word-masking""": {"""do_lower_case""": False},
    """bert-large-uncased-whole-word-masking-finetuned-squad""": {"""do_lower_case""": True},
    """bert-large-cased-whole-word-masking-finetuned-squad""": {"""do_lower_case""": False},
    """bert-base-cased-finetuned-mrpc""": {"""do_lower_case""": False},
    """bert-base-german-dbmdz-cased""": {"""do_lower_case""": False},
    """bert-base-german-dbmdz-uncased""": {"""do_lower_case""": True},
    """TurkuNLP/bert-base-finnish-cased-v1""": {"""do_lower_case""": False},
    """TurkuNLP/bert-base-finnish-uncased-v1""": {"""do_lower_case""": True},
    """wietsedv/bert-base-dutch-cased""": {"""do_lower_case""": False},
}






class 						_A  (  _a  ):







    """simple docstring"""




    UpperCAmelCase       :							List[Any]	=       VOCAB_FILES_NAMES
    UpperCAmelCase       :							Dict	=       PRETRAINED_VOCAB_FILES_MAP
    UpperCAmelCase       :							Tuple	=       PRETRAINED_INIT_CONFIGURATION
    UpperCAmelCase       :							str	=       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
    UpperCAmelCase       :							List[str]	=       BertTokenizer






    def __init__(					self				:    Dict				, __UpperCAmelCase				:    Union[str, Any]=None				, __UpperCAmelCase				:    Any=None				, __UpperCAmelCase				:    Any=True				, __UpperCAmelCase				:    Tuple="[UNK]"				, __UpperCAmelCase				:    Union[str, Any]="[SEP]"				, __UpperCAmelCase				:    List[Any]="[PAD]"				, __UpperCAmelCase				:    int="[CLS]"				, __UpperCAmelCase				:    List[str]="[MASK]"				, __UpperCAmelCase				:    Tuple=True				, __UpperCAmelCase				:    int=None				, **__UpperCAmelCase				:    Optional[Any]				, ):
      super().__init__(
          __UpperCAmelCase				, tokenizer_file=__UpperCAmelCase				, do_lower_case=__UpperCAmelCase				, unk_token=__UpperCAmelCase				, sep_token=__UpperCAmelCase				, pad_token=__UpperCAmelCase				, cls_token=__UpperCAmelCase				, mask_token=__UpperCAmelCase				, tokenize_chinese_chars=__UpperCAmelCase				, strip_accents=__UpperCAmelCase				, **__UpperCAmelCase				, )

      a						:		Optional[int]      							=			json.loads(self.backend_tokenizer.normalizer.__getstate__())
      if (
          normalizer_state.get("lowercase"				, __UpperCAmelCase) != do_lower_case
          or normalizer_state.get("strip_accents"				, __UpperCAmelCase) != strip_accents
          or normalizer_state.get("handle_chinese_chars"				, __UpperCAmelCase) != tokenize_chinese_chars
      ):
        a						:		Tuple      							=			getattr(__UpperCAmelCase				, normalizer_state.pop("type"))
        a						:		Optional[int]      							=			do_lower_case
        a						:		Optional[int]      							=			strip_accents
        a						:		Union[str, Any]      							=			tokenize_chinese_chars
        a						:		Union[str, Any]      							=			normalizer_class(**__UpperCAmelCase)

      a						:		Optional[Any]      							=			do_lower_case






    def 	__snake_case							(					self				:    Dict				, __UpperCAmelCase				:    str				, __UpperCAmelCase				:    Any=None):
      a						:		str      							=			[self.cls_token_id] + token_ids_a + [self.sep_token_id]

      if token_ids_a:
        output += token_ids_a + [self.sep_token_id]

      return output






    def 	__snake_case							(					self				:    List[Any]				, __UpperCAmelCase				:    List[int]				, __UpperCAmelCase				:    Optional[List[int]] = None):
      a						:		Tuple      							=			[self.sep_token_id]
      a						:		Tuple      							=			[self.cls_token_id]
      if token_ids_a is None:
        return len(cls + token_ids_a + sep) * [0]
      return len(cls + token_ids_a + sep) * [0] + len(token_ids_a + sep) * [1]






    def 	__snake_case							(					self				:    List[Any]				, __UpperCAmelCase				:    str				, __UpperCAmelCase				:    Optional[str] = None):
      a						:		Dict      							=			self._tokenizer.model.save(__UpperCAmelCase				, name=__UpperCAmelCase)
      return tuple(__UpperCAmelCase)










"""simple docstring"""







__lowercase    					=      {
    """Pillow""": """Pillow<10.0.0""",
    """accelerate""": """accelerate>=0.20.3""",
    """av""": """av==9.2.0""",
    """beautifulsoup4""": """beautifulsoup4""",
    """black""": """black~=23.1""",
    """codecarbon""": """codecarbon==1.2.0""",
    """cookiecutter""": """cookiecutter==1.7.3""",
    """dataclasses""": """dataclasses""",
    """datasets""": """datasets!=2.5.0""",
    """decord""": """decord==0.6.0""",
    """deepspeed""": """deepspeed>=0.9.3""",
    """diffusers""": """diffusers""",
    """dill""": """dill<0.3.5""",
    """evaluate""": """evaluate>=0.2.0""",
    """fairscale""": """fairscale>0.3""",
    """faiss-cpu""": """faiss-cpu""",
    """fastapi""": """fastapi""",
    """filelock""": """filelock""",
    """flax""": """flax>=0.4.1,<=0.7.0""",
    """ftfy""": """ftfy""",
    """fugashi""": """fugashi>=1.0""",
    """GitPython""": """GitPython<3.1.19""",
    """hf-doc-builder""": """hf-doc-builder>=0.3.0""",
    """huggingface-hub""": """huggingface-hub>=0.14.1,<1.0""",
    """importlib_metadata""": """importlib_metadata""",
    """ipadic""": """ipadic>=1.0.0,<2.0""",
    """isort""": """isort>=5.5.4""",
    """jax""": """jax>=0.2.8,!=0.3.2,<=0.4.13""",
    """jaxlib""": """jaxlib>=0.1.65,<=0.4.13""",
    """jieba""": """jieba""",
    """kenlm""": """kenlm""",
    """keras-nlp""": """keras-nlp>=0.3.1""",
    """librosa""": """librosa""",
    """nltk""": """nltk""",
    """natten""": """natten>=0.14.6""",
    """numpy""": """numpy>=1.17""",
    """onnxconverter-common""": """onnxconverter-common""",
    """onnxruntime-tools""": """onnxruntime-tools>=1.4.2""",
    """onnxruntime""": """onnxruntime>=1.4.0""",
    """opencv-python""": """opencv-python""",
    """optuna""": """optuna""",
    """optax""": """optax>=0.0.8,<=0.1.4""",
    """packaging""": """packaging>=20.0""",
    """parameterized""": """parameterized""",
    """phonemizer""": """phonemizer""",
    """protobuf""": """protobuf""",
    """psutil""": """psutil""",
    """pyyaml""": """pyyaml>=5.1""",
    """pydantic""": """pydantic<2""",
    """pytest""": """pytest>=7.2.0""",
    """pytest-timeout""": """pytest-timeout""",
    """pytest-xdist""": """pytest-xdist""",
    """python""": """python>=3.8.0""",
    """ray[tune]""": """ray[tune]""",
    """regex""": """regex!=2019.12.17""",
    """requests""": """requests""",
    """rhoknp""": """rhoknp>=1.1.0,<1.3.1""",
    """rjieba""": """rjieba""",
    """rouge-score""": """rouge-score!=0.0.7,!=0.0.8,!=0.1,!=0.1.1""",
    """ruff""": """ruff>=0.0.241,<=0.0.259""",
    """sacrebleu""": """sacrebleu>=1.4.12,<2.0.0""",
    """sacremoses""": """sacremoses""",
    """safetensors""": """safetensors>=0.3.1""",
    """sagemaker""": """sagemaker>=2.31.0""",
    """scikit-learn""": """scikit-learn""",
    """sentencepiece""": """sentencepiece>=0.1.91,!=0.1.92""",
    """sigopt""": """sigopt""",
    """starlette""": """starlette""",
    """sudachipy""": """sudachipy>=0.6.6""",
    """sudachidict_core""": """sudachidict_core>=20220729""",
    """tensorflow-cpu""": """tensorflow-cpu>=2.6,<2.14""",
    """tensorflow""": """tensorflow>=2.6,<2.14""",
    """tensorflow-text""": """tensorflow-text<2.14""",
    """tf2onnx""": """tf2onnx""",
    """timeout-decorator""": """timeout-decorator""",
    """timm""": """timm""",
    """tokenizers""": """tokenizers>=0.11.1,!=0.11.3,<0.14""",
    """torch""": """torch>=1.9,!=1.12.0""",
    """torchaudio""": """torchaudio""",
    """torchvision""": """torchvision""",
    """pyctcdecode""": """pyctcdecode>=0.4.0""",
    """tqdm""": """tqdm>=4.27""",
    """unidic""": """unidic>=1.0.2""",
    """unidic_lite""": """unidic_lite>=1.0.7""",
    """urllib3""": """urllib3<2.0.0""",
    """uvicorn""": """uvicorn""",
}






