






"""simple docstring"""


import os

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


lowercase_								=	logging.get_logger(__name__)


class    snake_case						(				UpperCamelCase__		):


   '''simple docstring'''

   def __init__(      self					:	Dict,			_lowerCamelCase					:	List[str],			_lowerCamelCase					:	List[Any]=None    ):

     '''simple docstring'''
     __A		     =					language
     __A		     =					train_language


   def 							_SCREAMING_SNAKE_CASE							(      self					:	Union[str, Any],			_lowerCamelCase					:	int    ):

     '''simple docstring'''
     __A		     =					self.language if self.train_language is None else self.train_language
     __A		     =					self._read_tsv(os.path.join(_lowerCamelCase,			f'XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv'    )    )
     __A		     =					[]
     for i, line in enumerate(_lowerCamelCase    ):
       if i == 0:
         continue
       __A		     =					f'train-{i}'
       __A		     =					line[0]
       __A		     =					line[1]
       __A		     =					'''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 							_SCREAMING_SNAKE_CASE							(      self					:	int,			_lowerCamelCase					:	int    ):

     '''simple docstring'''
     __A		     =					self._read_tsv(os.path.join(_lowerCamelCase,			'''XNLI-1.0/xnli.test.tsv'''    )    )
     __A		     =					[]
     for i, line in enumerate(_lowerCamelCase    ):
       if i == 0:
         continue
       __A		     =					line[0]
       if language != self.language:
         continue
       __A		     =					f'test-{i}'
       __A		     =					line[6]
       __A		     =					line[7]
       __A		     =					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 							_SCREAMING_SNAKE_CASE							(      self					:	str    ):

     '''simple docstring'''
     return ["contradiction", "entailment", "neutral"]





lowercase_								=	{
    '''xnli''': XnliProcessor,
}

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

lowercase_								=	{
    '''xnli''': 3,
}









'''simple docstring'''



lowerCAmelCase						:		Tuple						      = '''
# Diffusers installation
! pip install diffusers transformers datasets accelerate
# To install from source instead of the last release, comment the command above and uncomment the following one.
# ! pip install git+https://github.com/huggingface/diffusers.git
'''

lowerCAmelCase						:		Tuple						      = [{'''type''': '''code''', '''content''': INSTALL_CONTENT}]