




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__magic_name__     :     Any  							=					{
    """configuration_camembert""": ["""CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """CamembertConfig""", """CamembertOnnxConfig"""],
}

try:
      if not is_sentencepiece_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __magic_name__     :     List[Any]  							=					["""CamembertTokenizer"""]

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __magic_name__     :     Optional[Any]  							=					["""CamembertTokenizerFast"""]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __magic_name__     :     int  							=					[
          """CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """CamembertForCausalLM""",
          """CamembertForMaskedLM""",
          """CamembertForMultipleChoice""",
          """CamembertForQuestionAnswering""",
          """CamembertForSequenceClassification""",
          """CamembertForTokenClassification""",
          """CamembertModel""",
          """CamembertPreTrainedModel""",
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __magic_name__     :     Dict  							=					[
          """TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """TFCamembertForCausalLM""",
          """TFCamembertForMaskedLM""",
          """TFCamembertForMultipleChoice""",
          """TFCamembertForQuestionAnswering""",
          """TFCamembertForSequenceClassification""",
          """TFCamembertForTokenClassification""",
          """TFCamembertModel""",
          """TFCamembertPreTrainedModel""",
      ]


if TYPE_CHECKING:
      from .configuration_camembert import CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, CamembertConfig, CamembertOnnxConfig

      try:
            if not is_sentencepiece_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_camembert import CamembertTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_camembert_fast import CamembertTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_camembert import (
                CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                CamembertForCausalLM,
                CamembertForMaskedLM,
                CamembertForMultipleChoice,
                CamembertForQuestionAnswering,
                CamembertForSequenceClassification,
                CamembertForTokenClassification,
                CamembertModel,
                CamembertPreTrainedModel,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_camembert import (
                TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                TFCamembertForCausalLM,
                TFCamembertForMaskedLM,
                TFCamembertForMultipleChoice,
                TFCamembertForQuestionAnswering,
                TFCamembertForSequenceClassification,
                TFCamembertForTokenClassification,
                TFCamembertModel,
                TFCamembertPreTrainedModel,
            )

else:
      import sys

      __magic_name__     :     List[Any]  							=					_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)







import os

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


__magic_name__     :     str  							=					logging.get_logger(__name__)





class 						SCREAMING_SNAKE_CASE__		(_a ):
     def __init__(	self  :		Any					,	__lowerCamelCase  :		Any					,	__lowerCamelCase  :		Optional[int]=None	):



       """simple docstring"""
       lowerCAmelCase__								=			language
       lowerCAmelCase__								=			train_language
     def 					A__			(	self  :		str					,	__lowerCamelCase  :		List[str]	):



       """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 					A__			(	self  :		Dict					,	__lowerCamelCase  :		Union[str, Any]	):



       """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 					A__			(	self  :		List[str]	):



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



__magic_name__     :     Tuple  							=					{
    """xnli""": XnliProcessor,
}

__magic_name__     :     List[Any]  							=					{
    """xnli""": """classification""",
}

__magic_name__     :     str  							=					{
    """xnli""": 3,
}

