





import os

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


_lowerCamelCase       =	logging.get_logger(__name__)




class      UpperCamelCase_				(   UpperCamelCase__			):


							def __init__(							self			:Tuple							, __A			:List[Any]							, __A			:str=None						)      ->      Dict:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=					language
									SCREAMING_SNAKE_CASE__								=					train_language


							def    _snake_case     (							self			:Tuple							, __A			:Optional[int]						)      ->      Any:



									"""simple docstring"""



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


							def    _snake_case     (							self			:Any							, __A			:Optional[int]						)      ->      Dict:



									"""simple docstring"""



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


							def    _snake_case     (							self			:Dict						)      ->      int:



									"""simple docstring"""



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



_lowerCamelCase       =	{
    'xnli': XnliProcessor,
}

_lowerCamelCase       =	{
    'xnli': 'classification',
}

_lowerCamelCase       =	{
    'xnli': 3,
}






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							str			):
		SCREAMING_SNAKE_CASE__								=					SCREAMING_SNAKE_CASE__								=					0
		for letter in data:
				SCREAMING_SNAKE_CASE__								=					(hash_ << 4) + ord(UpperCamelCase__			)
				SCREAMING_SNAKE_CASE__								=					hash_ & 0XF_0_0_0_0_0_0_0
				if x != 0:
						hash_ ^= x >> 24
				hash_ &= ~x
		return hash_


if __name__ == "__main__":
	import doctest

	doctest.testmod()