




'''simple docstring'''




import os

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


a_   :	List[Any]							   = logging.get_logger(__name__)


class 						__UpperCamelCase (				lowerCamelCase__       ):






       def __init__(							self,	lowerCAmelCase,	lowerCAmelCase=None						):



              """simple docstring"""







              lowerCamelCase_							=language
              lowerCamelCase_							=train_language






       def   lowercase__  (							self,	lowerCAmelCase						):



              """simple docstring"""







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



              """simple docstring"""







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



              """simple docstring"""







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





a_   :	Union[str, Any]							   = {
    """xnli""": XnliProcessor,
}

a_   :	List[str]							   = {
    """xnli""": """classification""",
}

a_   :	Optional[Any]							   = {
    """xnli""": 3,
}










'''simple docstring'''




import warnings

from .generation import FlaxGenerationMixin


class 						__UpperCamelCase (				lowerCamelCase__       ):
       # warning at import time
       warnings.warn(
           'Importing `FlaxGenerationMixin` from `src/transformers/generation_flax_utils.py` is deprecated and will '
           'be removed in Transformers v5. Import as `from transformers import FlaxGenerationMixin` instead.'    ,      lowerCamelCase__    ,      )




