




"""simple docstring"""


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

import datasets


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


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


A_      =    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  lowercase(					datasets.Metric			):







 '''simple docstring'''





 def 			UpperCamelCase_       (    self:		List[Any]		):




   '''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 			UpperCamelCase_       (    self:		str,				a_:		Tuple,				a_:		str		):




   '''simple docstring'''



   _snake_case							:		Tuple								=  0.0
   for i, j in zip(a_,				a_		):
     n_correct += 1.0 if math_equivalence.is_equiv(a_,				a_		) else 0.0
   _snake_case							:		Any								=  n_correct / len(a_		)
   return {
       "accuracy": accuracy,
   }








"""simple docstring"""


from .data_collator import (
    DataCollatorForLanguageModeling,
    DataCollatorForPermutationLanguageModeling,
    DataCollatorForSeqaSeq,
    DataCollatorForSOP,
    DataCollatorForTokenClassification,
    DataCollatorForWholeWordMask,
    DataCollatorWithPadding,
    DefaultDataCollator,
    default_data_collator,
)
from .metrics import glue_compute_metrics, xnli_compute_metrics
from .processors import (
    DataProcessor,
    InputExample,
    InputFeatures,
    SingleSentenceClassificationProcessor,
    SquadExample,
    SquadFeatures,
    SquadVaProcessor,
    SquadVaProcessor,
    glue_convert_examples_to_features,
    glue_output_modes,
    glue_processors,
    glue_tasks_num_labels,
    squad_convert_examples_to_features,
    xnli_output_modes,
    xnli_processors,
    xnli_tasks_num_labels,
)


