






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

import datasets


lowerCamelCase_							      = '''\
@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}
}
'''


lowerCamelCase_							      = '''\
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.
'''


lowerCamelCase_							      = 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      UpperCamelCase_			(datasets.Metric	):





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











"""simple docstring"""
from ...utils import logging
from ..ta.modeling_tf_ta import TFTaEncoderModel, TFTaForConditionalGeneration, TFTaModel
from .configuration_mta import MTaConfig


lowerCamelCase_							      = logging.get_logger(__name__)

lowerCamelCase_							      = '''T5Config'''







class      UpperCamelCase_			(__A	):
	__magic_name__       =							'''mt5'''
	__magic_name__       =							MTaConfig







class      UpperCamelCase_			(__A	):
	__magic_name__       =							'''mt5'''
	__magic_name__       =							MTaConfig







class      UpperCamelCase_			(__A	):
	__magic_name__       =							'''mt5'''
	__magic_name__       =							MTaConfig



