


"""simple docstring"""







import os

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


lowerCamelCase_  :  Dict     		=    logging.get_logger(__name__)






class  __A							(			a__     ):






 """simple docstring"""




 def __init__(						self					,       __A					,       __A=None		)   ->	Optional[Any]:
     a											=language
     a											=train_language


 def  SCREAMING_SNAKE_CASE				(						self					,       __A		)   ->	Dict:
     a											=self.language if self.train_language is None else self.train_language
     a											=self._read_tsv(os.path.join(lowercase__					,       f'''XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv'''		)		)
     a											=[]
     for i, line in enumerate(lowercase__		):
         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(lowercase__					,       lowercase__		):
             raise ValueError(f'''Training input {text_a} is not a string'''		)
         if not isinstance(lowercase__					,       lowercase__		):
             raise ValueError(f'''Training input {text_b} is not a string'''		)
         if not isinstance(lowercase__					,       lowercase__		):
             raise ValueError(f'''Training label {label} is not a string'''		)
         examples.append(InputExample(guid=lowercase__					,       text_a=lowercase__					,       text_b=lowercase__					,       label=lowercase__		)		)
     return examples


 def  SCREAMING_SNAKE_CASE				(						self					,       __A		)   ->	List[str]:
     a											=self._read_tsv(os.path.join(lowercase__					,       '''XNLI-1.0/xnli.test.tsv'''		)		)
     a											=[]
     for i, line in enumerate(lowercase__		):
         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(lowercase__					,       lowercase__		):
             raise ValueError(f'''Training input {text_a} is not a string'''		)
         if not isinstance(lowercase__					,       lowercase__		):
             raise ValueError(f'''Training input {text_b} is not a string'''		)
         if not isinstance(lowercase__					,       lowercase__		):
             raise ValueError(f'''Training label {label} is not a string'''		)
         examples.append(InputExample(guid=lowercase__					,       text_a=lowercase__					,       text_b=lowercase__					,       label=lowercase__		)		)
     return examples





 def  SCREAMING_SNAKE_CASE				(						self		)   ->	str:
     return ["contradiction", "entailment", "neutral"]

lowerCamelCase_  :  Optional[Any]     		=    {
    'xnli': XnliProcessor,
}

lowerCamelCase_  :  Any     		=    {
    'xnli': 'classification',
}

lowerCamelCase_  :  Union[str, Any]     		=    {
    'xnli': 3,
}






'''simple docstring'''

from typing import TYPE_CHECKING

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


UpperCAmelCase       :		Dict		=				{'configuration_hubert': ['HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'HubertConfig']}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase       :		Union[str, Any]		=				[
       'HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
       'HubertForCTC',
       'HubertForSequenceClassification',
       'HubertModel',
       'HubertPreTrainedModel',
   ]


try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase       :		Optional[int]		=				[
       'TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
       'TFHubertForCTC',
       'TFHubertModel',
       'TFHubertPreTrainedModel',
   ]

if TYPE_CHECKING:
   from .configuration_hubert import HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, HubertConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_hubert import (
          HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          HubertForCTC,
          HubertForSequenceClassification,
          HubertModel,
          HubertPreTrainedModel,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_hubert import (
          TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFHubertForCTC,
          TFHubertModel,
          TFHubertPreTrainedModel,
      )


else:
   import sys

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


