


import os

from ...utils import logging
from .utils import DataProcessor, InputExample


A :	Any												=     logging.get_logger(__name__)



class 							A					( UpperCAmelCase__							):
					'''simple docstring'''






					def __init__(self					:		Optional[int]   ,      _UpperCAmelCase					:		Dict   ,      _UpperCAmelCase					:		Union[str, Any]=None	)		->     List[str]:




							"""simple docstring"""


							lowercase__      =	language
							lowercase__      =	train_language

					def 						lowerCamelCase__  (self					:		List[Any]   ,      _UpperCAmelCase					:		Tuple	)		->     str:




							"""simple docstring"""


							lowercase__      =	self.language if self.train_language is None else self.train_language
							lowercase__      =	self._read_tsv(os.path.join(_UpperCAmelCase   ,      f'''XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv'''	)	)
							lowercase__      =	[]
							for i, line in enumerate(_UpperCAmelCase	):
									if i == 0:
											continue
									lowercase__      =	f'''train-{i}'''
									lowercase__      =	line[0]
									lowercase__      =	line[1]
									lowercase__      =	"""contradiction""" if line[2] == """contradictory""" else line[2]
									if not isinstance(_UpperCAmelCase   ,      _UpperCAmelCase	):
											raise ValueError(f'''Training input {text_a} is not a string'''	)
									if not isinstance(_UpperCAmelCase   ,      _UpperCAmelCase	):
											raise ValueError(f'''Training input {text_b} is not a string'''	)
									if not isinstance(_UpperCAmelCase   ,      _UpperCAmelCase	):
											raise ValueError(f'''Training label {label} is not a string'''	)
									examples.append(InputExample(guid=_UpperCAmelCase   ,      text_a=_UpperCAmelCase   ,      text_b=_UpperCAmelCase   ,      label=_UpperCAmelCase	)	)
							return examples

					def 						lowerCamelCase__  (self					:		Optional[Any]   ,      _UpperCAmelCase					:		int	)		->     int:




							"""simple docstring"""


							lowercase__      =	self._read_tsv(os.path.join(_UpperCAmelCase   ,      """XNLI-1.0/xnli.test.tsv"""	)	)
							lowercase__      =	[]
							for i, line in enumerate(_UpperCAmelCase	):
									if i == 0:
											continue
									lowercase__      =	line[0]
									if language != self.language:
											continue
									lowercase__      =	f'''test-{i}'''
									lowercase__      =	line[6]
									lowercase__      =	line[7]
									lowercase__      =	line[1]
									if not isinstance(_UpperCAmelCase   ,      _UpperCAmelCase	):
											raise ValueError(f'''Training input {text_a} is not a string'''	)
									if not isinstance(_UpperCAmelCase   ,      _UpperCAmelCase	):
											raise ValueError(f'''Training input {text_b} is not a string'''	)
									if not isinstance(_UpperCAmelCase   ,      _UpperCAmelCase	):
											raise ValueError(f'''Training label {label} is not a string'''	)
									examples.append(InputExample(guid=_UpperCAmelCase   ,      text_a=_UpperCAmelCase   ,      text_b=_UpperCAmelCase   ,      label=_UpperCAmelCase	)	)
							return examples


					def 						lowerCamelCase__  (self					:		Optional[Any]	)		->     Any:




							"""simple docstring"""


							return ["contradiction", "entailment", "neutral"]






A :	Optional[int]												=     {
    'xnli': XnliProcessor,
}

A :	Tuple												=     {
    'xnli': 'classification',
}

A :	Any												=     {
    'xnli': 3,
}





from typing import TYPE_CHECKING

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


A :	str												=     {
    'configuration_nystromformer': ['NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'NystromformerConfig'],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	A :	Optional[int]												=     [
	    'NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'NystromformerForMaskedLM',
	    'NystromformerForMultipleChoice',
	    'NystromformerForQuestionAnswering',
	    'NystromformerForSequenceClassification',
	    'NystromformerForTokenClassification',
	    'NystromformerLayer',
	    'NystromformerModel',
	    'NystromformerPreTrainedModel',
	]


if TYPE_CHECKING:
	from .configuration_nystromformer import NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, NystromformerConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_nystromformer import (
		    NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
		    NystromformerForMaskedLM,
		    NystromformerForMultipleChoice,
		    NystromformerForQuestionAnswering,
		    NystromformerForSequenceClassification,
		    NystromformerForTokenClassification,
		    NystromformerLayer,
		    NystromformerModel,
		    NystromformerPreTrainedModel,
		)


else:
	import sys

	A :	Optional[int]												=     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

