



'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


snake_case_				:			Optional[int]						 =						logging.get_logger(__name__)

snake_case_				:			Any						 =						{
    'bert-base-uncased': 'https://huggingface.co/bert-base-uncased/resolve/main/config.json',
    # QDQBERT models can be loaded from any BERT checkpoint, available at https://huggingface.co/models?filter=bert
}






class 							lowercase__			(							lowercase     ):
	lowercase__						       =    """qdqbert"""





	def __init__(				self      :       Any				,lowerCamelCase__      :       Dict=30522				,lowerCamelCase__      :       List[Any]=768				,lowerCamelCase__      :       Optional[Any]=12				,lowerCamelCase__      :       Tuple=12				,lowerCamelCase__      :       Union[str, Any]=3072				,lowerCamelCase__      :       Any="gelu"				,lowerCamelCase__      :       str=0.1				,lowerCamelCase__      :       Dict=0.1				,lowerCamelCase__      :       Optional[int]=512				,lowerCamelCase__      :       Union[str, Any]=2				,lowerCamelCase__      :       Optional[int]=0.0_2				,lowerCamelCase__      :       int=1E-12				,lowerCamelCase__      :       List[Any]=True				,lowerCamelCase__      :       Optional[Any]=1				,lowerCamelCase__      :       List[str]=0				,lowerCamelCase__      :       Dict=2				,**lowerCamelCase__      :       Any				,):







							'''simple docstring'''
							super().__init__(pad_token_id=lowerCamelCase__				,bos_token_id=lowerCamelCase__				,eos_token_id=lowerCamelCase__				,**lowerCamelCase__				)

							_UpperCamelCase      :	Any				       =     vocab_size
							_UpperCamelCase      :	Dict				       =     max_position_embeddings
							_UpperCamelCase      :	str				       =     hidden_size
							_UpperCamelCase      :	List[str]				       =     num_hidden_layers
							_UpperCamelCase      :	Optional[Any]				       =     num_attention_heads
							_UpperCamelCase      :	Optional[Any]				       =     intermediate_size
							_UpperCamelCase      :	Optional[Any]				       =     hidden_act
							_UpperCamelCase      :	Tuple				       =     hidden_dropout_prob
							_UpperCamelCase      :	Any				       =     attention_probs_dropout_prob
							_UpperCamelCase      :	str				       =     initializer_range
							_UpperCamelCase      :	int				       =     type_vocab_size
							_UpperCamelCase      :	Any				       =     layer_norm_eps
							_UpperCamelCase      :	Optional[Any]				       =     use_cache







'''simple docstring'''
import os

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


snake_case_				:			Any						 =						logging.get_logger(__name__)






class 							lowercase__			(							lowercase     ):





	def __init__(				self      :       Union[str, Any]				,lowerCamelCase__      :       Tuple				,lowerCamelCase__      :       Optional[int]=None				):







							'''simple docstring'''
							_UpperCamelCase      :	Any				       =     language
							_UpperCamelCase      :	int				       =     train_language





	def 			UpperCamelCase_						(				self      :       Optional[int]				,lowerCamelCase__      :       Dict				):







							'''simple docstring'''
							_UpperCamelCase      :	Tuple				       =     self.language if self.train_language is None else self.train_language
							_UpperCamelCase      :	List[Any]				       =     self._read_tsv(os.path.join(lowerCamelCase__				,F'XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv'				)				)
							_UpperCamelCase      :	Union[str, Any]				       =     []
							for i, line in enumerate(lowerCamelCase__				):
													if i == 0:
																			continue
													_UpperCamelCase      :	Optional[Any]				       =     F'train-{i}'
													_UpperCamelCase      :	List[str]				       =     line[0]
													_UpperCamelCase      :	Union[str, Any]				       =     line[1]
													_UpperCamelCase      :	Tuple				       =     'contradiction' if line[2] == 'contradictory' else line[2]
													if not isinstance(lowerCamelCase__				,lowerCamelCase__				):
																			raise ValueError(F'Training input {text_a} is not a string'				)
													if not isinstance(lowerCamelCase__				,lowerCamelCase__				):
																			raise ValueError(F'Training input {text_b} is not a string'				)
													if not isinstance(lowerCamelCase__				,lowerCamelCase__				):
																			raise ValueError(F'Training label {label} is not a string'				)
													examples.append(InputExample(guid=lowerCamelCase__				,text_a=lowerCamelCase__				,text_b=lowerCamelCase__				,label=lowerCamelCase__				)				)
							return examples





	def 			UpperCamelCase_						(				self      :       Optional[Any]				,lowerCamelCase__      :       List[str]				):







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





	def 			UpperCamelCase_						(				self      :       str				):







							'''simple docstring'''
							return ["contradiction", "entailment", "neutral"]
snake_case_				:			int						 =						{
    'xnli': XnliProcessor,
}

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

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


