






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

import datasets


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


SCREAMING_SNAKE_CASE__      :			Dict							=		"""\
This metric is used to assess performance on the Mathematics Aptitude Test of Heuristics (MATH) dataset.
It first canonicalizes the inputs (e.g., converting \"1/2\" to \"\\frac{1}{2}\") and then computes accuracy.
"""


SCREAMING_SNAKE_CASE__      :			Dict							=		r"""
Calculates accuracy after canonicalizing inputs.

Args:
    predictions: list of predictions to score. Each prediction
        is a string that contains natural language and LaTex.
    references: list of reference for each prediction. Each
        reference is a string that contains natural language
        and LaTex.
Returns:
    accuracy: accuracy after canonicalizing inputs
        (e.g., converting \"1/2\" to \"\\frac{1}{2}\")

Examples:
    >>> metric = datasets.load_metric(\"competition_math\")
    >>> results = metric.compute(references=[\"\\frac{1}{2}\"], predictions=[\"1/2\"])
    >>> print(results)
    {'accuracy': 1.0}
"""
@datasets.utils.file_utils.add_end_docstrings(_DESCRIPTION			,				_KWARGS_DESCRIPTION )
class 						lowerCamelCase_				(      datasets.Metric ):







				def 			A	(						self     ):
								"""simple docstring"""
								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 			A	(						self       ,					__lowerCAmelCase       ,					__lowerCAmelCase     ):
								"""simple docstring"""
								__magic_name__		:List[str]        =      0.0
								for i, j in zip(__lowerCAmelCase       ,					__lowerCAmelCase     ):
												n_correct += 1.0 if math_equivalence.is_equiv(__lowerCAmelCase       ,					__lowerCAmelCase     ) else 0.0
								__magic_name__		:Optional[int]        =      n_correct / len(__lowerCAmelCase     )
								return {
								    "accuracy": accuracy,
								}














from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available


SCREAMING_SNAKE_CASE__      :			Union[str, Any]							=		{"""tokenization_herbert""": ["""HerbertTokenizer"""]}

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


if TYPE_CHECKING:
					from .tokenization_herbert import HerbertTokenizer

					try:
										if not is_tokenizers_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .tokenization_herbert_fast import HerbertTokenizerFast

else:
					import sys

					SCREAMING_SNAKE_CASE__      :			Union[str, Any]							=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)






