import math_equivalence  # From: git+https://github.com/hendrycks/math.git

import datasets


__SCREAMING_SNAKE_CASE						:   Any         =			'\\n@article{hendrycksmath2021,\n  title={Measuring Mathematical Problem Solving With the MATH Dataset},\n  author={Dan Hendrycks\n    and Collin Burns\n    and Saurav Kadavath\n    and Akul Arora\n    and Steven Basart\n    and Eric Tang\n    and Dawn Song\n    and Jacob Steinhardt},\n  journal={arXiv preprint arXiv:2103.03874},\n  year={2021}\n}\n'


__SCREAMING_SNAKE_CASE						:   int         =			'\\nThis metric is used to assess performance on the Mathematics Aptitude Test of Heuristics (MATH) dataset.\nIt first canonicalizes the inputs (e.g., converting "1/2" to "\\frac{1}{2}") and then computes accuracy.\n'


__SCREAMING_SNAKE_CASE						:   Optional[Any]         =			R'\nCalculates accuracy after canonicalizing inputs.\n\nArgs:\n    predictions: list of predictions to score. Each prediction\n        is a string that contains natural language and LaTex.\n    references: list of reference for each prediction. Each\n        reference is a string that contains natural language\n        and LaTex.\nReturns:\n    accuracy: accuracy after canonicalizing inputs\n        (e.g., converting "1/2" to "\\frac{1}{2}")\n\nExamples:\n    >>> metric = datasets.load_metric("competition_math")\n    >>> results = metric.compute(references=["\\frac{1}{2}"], predictions=["1/2"])\n    >>> print(results)\n    {\'accuracy\': 1.0}\n'



@datasets.utils.file_utils.add_end_docstrings(_DESCRIPTION						,			_KWARGS_DESCRIPTION		)
class        lowercase_   (					datasets.Metric		):



							def 	UpperCamelCase	(						self    ):
													return datasets.MetricInfo(
													    description=_DESCRIPTION				,    citation=_CITATION				,    inputs_description=_KWARGS_DESCRIPTION				,    features=datasets.Features(
													        {
													            "predictions": datasets.Value("string"    ),
													            "references": datasets.Value("string"    ),
													        }    )				,    homepage="https://github.com/hendrycks/math"				,    codebase_urls=["https://github.com/hendrycks/math"]				,    )



							def 	UpperCamelCase	(						self				,    lowercase_				,    lowercase_    ):
													_snake_case						:					Optional[Any]    =   0.0
													for i, j in zip(lowercase_				,    lowercase_    ):
																			n_correct += 1.0 if math_equivalence.is_equiv(lowercase_				,    lowercase_    ) else 0.0
													_snake_case						:					Dict    =   n_correct / len(lowercase_    )
													return {
													    "accuracy": accuracy,
													}
from typing import TYPE_CHECKING

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


__SCREAMING_SNAKE_CASE						:   Optional[int]         =			{
    'configuration_distilbert': [
        'DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'DistilBertConfig',
        'DistilBertOnnxConfig',
    ],
    'tokenization_distilbert': ['DistilBertTokenizer'],
}

try:
				if not is_tokenizers_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__SCREAMING_SNAKE_CASE						:   Optional[int]         =			['DistilBertTokenizerFast']

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__SCREAMING_SNAKE_CASE						:   int         =			[
				    'DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'DistilBertForMaskedLM',
				    'DistilBertForMultipleChoice',
				    'DistilBertForQuestionAnswering',
				    'DistilBertForSequenceClassification',
				    'DistilBertForTokenClassification',
				    'DistilBertModel',
				    'DistilBertPreTrainedModel',
				]

try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__SCREAMING_SNAKE_CASE						:   Any         =			[
				    'TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'TFDistilBertForMaskedLM',
				    'TFDistilBertForMultipleChoice',
				    'TFDistilBertForQuestionAnswering',
				    'TFDistilBertForSequenceClassification',
				    'TFDistilBertForTokenClassification',
				    'TFDistilBertMainLayer',
				    'TFDistilBertModel',
				    'TFDistilBertPreTrainedModel',
				]

try:
				if not is_flax_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__SCREAMING_SNAKE_CASE						:   Optional[Any]         =			[
				    'FlaxDistilBertForMaskedLM',
				    'FlaxDistilBertForMultipleChoice',
				    'FlaxDistilBertForQuestionAnswering',
				    'FlaxDistilBertForSequenceClassification',
				    'FlaxDistilBertForTokenClassification',
				    'FlaxDistilBertModel',
				    'FlaxDistilBertPreTrainedModel',
				]


if TYPE_CHECKING:
				from .configuration_distilbert import (
				    DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
				    DistilBertConfig,
				    DistilBertOnnxConfig,
				)
				from .tokenization_distilbert import DistilBertTokenizer

				try:
								if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_distilbert_fast import DistilBertTokenizerFast

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_distilbert import (
								    DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    DistilBertForMaskedLM,
								    DistilBertForMultipleChoice,
								    DistilBertForQuestionAnswering,
								    DistilBertForSequenceClassification,
								    DistilBertForTokenClassification,
								    DistilBertModel,
								    DistilBertPreTrainedModel,
								)

				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_distilbert import (
								    TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    TFDistilBertForMaskedLM,
								    TFDistilBertForMultipleChoice,
								    TFDistilBertForQuestionAnswering,
								    TFDistilBertForSequenceClassification,
								    TFDistilBertForTokenClassification,
								    TFDistilBertMainLayer,
								    TFDistilBertModel,
								    TFDistilBertPreTrainedModel,
								)

				try:
								if not is_flax_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_flax_distilbert import (
								    FlaxDistilBertForMaskedLM,
								    FlaxDistilBertForMultipleChoice,
								    FlaxDistilBertForQuestionAnswering,
								    FlaxDistilBertForSequenceClassification,
								    FlaxDistilBertForTokenClassification,
								    FlaxDistilBertModel,
								    FlaxDistilBertPreTrainedModel,
								)

else:
				import sys

				__SCREAMING_SNAKE_CASE						:   str         =			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)