


"""simple docstring"""
import datasets


__SCREAMING_SNAKE_CASE							:    Dict		=    '\\n@InProceedings{conneau2018xnli,\n  author = "Conneau, Alexis\n                 and Rinott, Ruty\n                 and Lample, Guillaume\n                 and Williams, Adina\n                 and Bowman, Samuel R.\n                 and Schwenk, Holger\n                 and Stoyanov, Veselin",\n  title = "XNLI: Evaluating Cross-lingual Sentence Representations",\n  booktitle = "Proceedings of the 2018 Conference on Empirical Methods\n               in Natural Language Processing",\n  year = "2018",\n  publisher = "Association for Computational Linguistics",\n  location = "Brussels, Belgium",\n}\n'

__SCREAMING_SNAKE_CASE							:    str		=    '\\nXNLI is a subset of a few thousand examples from MNLI which has been translated\ninto a 14 different languages (some low-ish resource). As with MNLI, the goal is\nto predict textual entailment (does sentence A imply/contradict/neither sentence\nB) and is a classification task (given two sentences, predict one of three\nlabels).\n'

__SCREAMING_SNAKE_CASE							:    List[Any]		=    '\nComputes XNLI score which is just simple accuracy.\nArgs:\n    predictions: Predicted labels.\n    references: Ground truth labels.\nReturns:\n    \'accuracy\': accuracy\nExamples:\n\n    >>> predictions = [0, 1]\n    >>> references = [0, 1]\n    >>> xnli_metric = datasets.load_metric("xnli")\n    >>> results = xnli_metric.compute(predictions=predictions, references=references)\n    >>> print(results)\n    {\'accuracy\': 1.0}\n'







def 						_a				(      _SCREAMING_SNAKE_CASE				, _SCREAMING_SNAKE_CASE				)    ->				Tuple:
							return (preds == labels).mean()





@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION						,		_KWARGS_DESCRIPTION)
class      __A     (datasets.Metric):





							'''simple docstring'''

							def 		lowerCAmelCase       (				self							:      Tuple       )					->int:



														"""simple docstring"""



														return datasets.MetricInfo(
														    description=_DESCRIPTION		,       citation=_CITATION		,       inputs_description=_KWARGS_DESCRIPTION		,       features=datasets.Features(
														        {
														            """predictions""": datasets.Value("""int64""" if self.config_name != """sts-b""" else """float32"""       ),
														            """references""": datasets.Value("""int64""" if self.config_name != """sts-b""" else """float32"""       ),
														        }       )		,       codebase_urls=[]		,       reference_urls=[]		,       format="""numpy"""		,       )



							def 		lowerCAmelCase       (				self							:      Tuple		,       UpperCAmelCase_							:      Optional[int]		,       UpperCAmelCase_							:      Tuple       )					->List[str]:



														"""simple docstring"""



														return {"accuracy": simple_accuracy(UpperCAmelCase_		,       UpperCAmelCase_       )}







"""simple docstring"""
__SCREAMING_SNAKE_CASE							:    str		=    'Input must be a string of 8 numbers plus letter'
__SCREAMING_SNAKE_CASE							:    Dict		=    'TRWAGMYFPDXBNJZSQVHLCKE'







def 						_a				(      _SCREAMING_SNAKE_CASE				)    ->				bool:

							if not isinstance(_SCREAMING_SNAKE_CASE				, _SCREAMING_SNAKE_CASE				):
														snake_case_           =		f"""Expected string as input, found {type(_SCREAMING_SNAKE_CASE				).__name__}"""
														raise TypeError(_SCREAMING_SNAKE_CASE				)

							snake_case_           =		spanish_id.replace("""-"""				, """"""				).upper()
							if len(_SCREAMING_SNAKE_CASE				) != 9:
														raise ValueError(_SCREAMING_SNAKE_CASE				)

							try:
														snake_case_           =		int(spanish_id_clean[0:8]				)
														snake_case_           =		spanish_id_clean[8]
							except ValueError as ex:
														raise ValueError(_SCREAMING_SNAKE_CASE				) from ex

							if letter.isdigit():
														raise ValueError(_SCREAMING_SNAKE_CASE				)

							return letter == LOOKUP_LETTERS[number % 23]


if __name__ == "__main__":
				import doctest

				doctest.testmod()



