



'''simple docstring'''



from typing import Optional, Union

from ...file_utils import TensorType
from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, TruncationStrategy






class 			_SCREAMING_SNAKE_CASE				(lowercase__      ):
			A__								=  'MarkupLMFeatureExtractor'
			A__								=  ('MarkupLMTokenizer', 'MarkupLMTokenizerFast')
			A__								=  True



			def __call__(     self		:						List[Any]    ,			__UpperCamelCase		:						Optional[int]=None    ,			__UpperCamelCase		:						Tuple=None    ,			__UpperCamelCase		:						Optional[Any]=None    ,			__UpperCamelCase		:						Tuple=None    ,			__UpperCamelCase		:						List[Any]=None    ,			__UpperCamelCase		:						bool = True    ,			__UpperCamelCase		:						Union[bool, str, PaddingStrategy] = False    ,			__UpperCamelCase		:						Union[bool, str, TruncationStrategy] = None    ,			__UpperCamelCase		:						Optional[int] = None    ,			__UpperCamelCase		:						int = 0    ,			__UpperCamelCase		:						Optional[int] = None    ,			__UpperCamelCase		:						Optional[bool] = None    ,			__UpperCamelCase		:						Optional[bool] = None    ,			__UpperCamelCase		:						bool = False    ,			__UpperCamelCase		:						bool = False    ,			__UpperCamelCase		:						bool = False    ,			__UpperCamelCase		:						bool = False    ,			__UpperCamelCase		:						bool = True    ,			__UpperCamelCase		:						Optional[Union[str, TensorType]] = None    ,			**__UpperCamelCase		:						Optional[int]    ,			)      ->      BatchEncoding:
							"""simple docstring"""





							if self.parse_html:
											if html_strings is None:
															raise ValueError('''Make sure to pass HTML strings in case `parse_html` is set to `True`'''			)

											if nodes is not None or xpaths is not None or node_labels is not None:
															raise ValueError(
															    '''Please don\'t pass nodes, xpaths nor node labels in case `parse_html` is set to `True`'''			)

											snake_case__      :   Optional[Any]      =    self.feature_extractor(__UpperCamelCase			)
											snake_case__      :   Union[str, Any]      =    features['''nodes''']
											snake_case__      :   str      =    features['''xpaths''']
							else:
											if html_strings is not None:
															raise ValueError('''You have passed HTML strings but `parse_html` is set to `False`.'''			)
											if nodes is None or xpaths is None:
															raise ValueError('''Make sure to pass nodes and xpaths in case `parse_html` is set to `False`'''			)

        # # second, apply the tokenizer
							if questions is not None and self.parse_html:
											if isinstance(__UpperCamelCase    ,			__UpperCamelCase			):
															snake_case__      :   Dict      =    [questions]  # add batch dimension (as the feature extractor always adds a batch dimension)

							snake_case__      :   List[str]      =    self.tokenizer(
							    text=questions if questions is not None else nodes    ,			text_pair=nodes if questions is not None else None    ,			xpaths=__UpperCamelCase    ,			node_labels=__UpperCamelCase    ,			add_special_tokens=__UpperCamelCase    ,			padding=__UpperCamelCase    ,			truncation=__UpperCamelCase    ,			max_length=__UpperCamelCase    ,			stride=__UpperCamelCase    ,			pad_to_multiple_of=__UpperCamelCase    ,			return_token_type_ids=__UpperCamelCase    ,			return_attention_mask=__UpperCamelCase    ,			return_overflowing_tokens=__UpperCamelCase    ,			return_special_tokens_mask=__UpperCamelCase    ,			return_offsets_mapping=__UpperCamelCase    ,			return_length=__UpperCamelCase    ,			verbose=__UpperCamelCase    ,			return_tensors=__UpperCamelCase    ,			**__UpperCamelCase    ,			)

							return encoded_inputs



			def 				lowerCAmelCase (     self		:						int    ,			*__UpperCamelCase		:						int    ,			**__UpperCamelCase		:						str			)      ->      Union[str, Any]:
							"""simple docstring"""





							return self.tokenizer.batch_decode(*__UpperCamelCase    ,			**__UpperCamelCase			)



			def 				lowerCAmelCase (     self		:						Tuple    ,			*__UpperCamelCase		:						Union[str, Any]    ,			**__UpperCamelCase		:						int			)      ->      Optional[int]:
							"""simple docstring"""





							return self.tokenizer.decode(*__UpperCamelCase    ,			**__UpperCamelCase			)







			@property
			def 				lowerCAmelCase (     self		:						Tuple			)      ->      str:
							"""simple docstring"""





							snake_case__      :   Optional[Any]      =    self.tokenizer.model_input_names
							return tokenizer_input_names






'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_torch_available


__lowercase	=    {
    '''configuration_xlm_prophetnet''': ['''XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''XLMProphetNetConfig'''],
}

try:
							if not is_sentencepiece_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__lowercase	=    ['''XLMProphetNetTokenizer''']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__lowercase	=    [
							    '''XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST''',
							    '''XLMProphetNetDecoder''',
							    '''XLMProphetNetEncoder''',
							    '''XLMProphetNetForCausalLM''',
							    '''XLMProphetNetForConditionalGeneration''',
							    '''XLMProphetNetModel''',
							    '''XLMProphetNetPreTrainedModel''',
							]


if TYPE_CHECKING:
							from .configuration_xlm_prophetnet import XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMProphetNetConfig

							try:
														if not is_sentencepiece_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_xlm_prophetnet import XLMProphetNetTokenizer

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_xlm_prophetnet import (
														    XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST,
														    XLMProphetNetDecoder,
														    XLMProphetNetEncoder,
														    XLMProphetNetForCausalLM,
														    XLMProphetNetForConditionalGeneration,
														    XLMProphetNetModel,
														    XLMProphetNetPreTrainedModel,
														)

else:
							import sys

							__lowercase	=    _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






