



"""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_layoutlm import LayoutLMTokenizer


_lowercase					:					Union[str, Any] 		=		logging.get_logger(__name__)

_lowercase					:					Optional[Any] 		=		{'vocab_file': 'vocab.txt', 'tokenizer_file': 'tokenizer.json'}

_lowercase					:					Optional[Any] 		=		{
    'vocab_file': {
        'microsoft/layoutlm-base-uncased': (
            'https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/vocab.txt'
        ),
        'microsoft/layoutlm-large-uncased': (
            'https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/vocab.txt'
        ),
    },
    'tokenizer_file': {
        'microsoft/layoutlm-base-uncased': (
            'https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/tokenizer.json'
        ),
        'microsoft/layoutlm-large-uncased': (
            'https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/tokenizer.json'
        ),
    },
}

_lowercase					:					Dict 		=		{
    'microsoft/layoutlm-base-uncased': 5_1_2,
    'microsoft/layoutlm-large-uncased': 5_1_2,
}

_lowercase					:					int 		=		{
    'microsoft/layoutlm-base-uncased': {'do_lower_case': True},
    'microsoft/layoutlm-large-uncased': {'do_lower_case': True},
}

class 			__SCREAMING_SNAKE_CASE      ( lowercase_  ):


					'''simple docstring'''





					_a       =				VOCAB_FILES_NAMES
					_a       =				PRETRAINED_VOCAB_FILES_MAP
					_a       =				PRETRAINED_INIT_CONFIGURATION
					_a       =				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
					_a       =				LayoutLMTokenizer



					def __init__(			self				:    str,    lowerCamelCase				:    int=None,    lowerCamelCase				:    int=None,    lowerCamelCase				:    List[str]=True,    lowerCamelCase				:    Dict="[UNK]",    lowerCamelCase				:    List[str]="[SEP]",    lowerCamelCase				:    Dict="[PAD]",    lowerCamelCase				:    List[Any]="[CLS]",    lowerCamelCase				:    List[Any]="[MASK]",    lowerCamelCase				:    Optional[Any]=True,    lowerCamelCase				:    Optional[Any]=None,    **lowerCamelCase				:    Tuple,    )->   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,    )

								lowerCamelCase__						:						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
								):
											lowerCamelCase__						:						int						      =getattr(__UpperCamelCase,    normalizer_state.pop('''type'''	)	)
											lowerCamelCase__						:						Union[str, Any]						      =do_lower_case
											lowerCamelCase__						:						Dict						      =strip_accents
											lowerCamelCase__						:						int						      =tokenize_chinese_chars
											lowerCamelCase__						:						Any						      =normalizer_class(**__UpperCamelCase	)

								lowerCamelCase__						:						Any						      =do_lower_case



					def 						snake_case			(			self				:    List[Any],    lowerCamelCase				:    str,    lowerCamelCase				:    str=None	)->   Optional[Any]:
								lowerCamelCase__						:						List[Any]						      =[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],    lowerCamelCase				:    List[int],    lowerCamelCase				:    Optional[List[int]] = None	)->   Optional[Any]:
								lowerCamelCase__						:						Any						      =[self.sep_token_id]
								lowerCamelCase__						:						Dict						      =[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				:    Any,    lowerCamelCase				:    str,    lowerCamelCase				:    Optional[str] = None	)->   int:
								lowerCamelCase__						:						Dict						      =self._tokenizer.model.save(__UpperCamelCase,    name=__UpperCamelCase	)
								return tuple(__UpperCamelCase	)











"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


_snake_case	:						Any					=					{
    'configuration_unispeech_sat': ['UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'UniSpeechSatConfig'],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_snake_case	:						str					=					[
		    'UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'UniSpeechSatForAudioFrameClassification',
		    'UniSpeechSatForCTC',
		    'UniSpeechSatForPreTraining',
		    'UniSpeechSatForSequenceClassification',
		    'UniSpeechSatForXVector',
		    'UniSpeechSatModel',
		    'UniSpeechSatPreTrainedModel',
		]

if TYPE_CHECKING:
		from .configuration_unispeech_sat import UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechSatConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_unispeech_sat import (
				    UNISPEECH_SAT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    UniSpeechSatForAudioFrameClassification,
				    UniSpeechSatForCTC,
				    UniSpeechSatForPreTraining,
				    UniSpeechSatForSequenceClassification,
				    UniSpeechSatForXVector,
				    UniSpeechSatModel,
				    UniSpeechSatPreTrainedModel,
				)

else:
		import sys

		_snake_case	:						Union[str, Any]					=					_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


