Ë
    ´Œj°
  ã                   ó:   — d dl Z d dlmZ d dlmZ  G d„ de«      Zy)é    N)ÚAny)ÚStringEvaluatorc            	       ó´   ‡ — e Zd ZdZddddœdedededefˆ fd„Zed	efd
„«       Zed	efd„«       Z	ed	e
e   fd„«       Zed	efd„«       Zdededed	efd„Zˆ xZS )ÚExactMatchStringEvaluatoraÕ  Compute an exact match between the prediction and the reference.

    Examples
    ----------
    >>> evaluator = ExactMatchChain()
    >>> evaluator.evaluate_strings(
            prediction="Mindy is the CTO",
            reference="Mindy is the CTO",
        )  # This will return {'score': 1.0}

    >>> evaluator.evaluate_strings(
            prediction="Mindy is the CTO",
            reference="Mindy is the CEO",
        )  # This will return {'score': 0.0}
    F)Úignore_caseÚignore_punctuationÚignore_numbersr   r   r	   Úkwargsc                óL   •— t         ‰| �  «        || _        || _        || _        y )N)ÚsuperÚ__init__r   r   r	   )Úselfr   r   r	   r
   Ú	__class__s        €úo/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/langchain/evaluation/exact_match/base.pyr   z"ExactMatchStringEvaluator.__init__   s(   ø€ ô 	‰ÑÔØ&ˆÔØ"4ˆÔØ,ˆÕó    Úreturnc                  ó   — y)z8
        This evaluator does not require input.
        F© ©r   s    r   Úrequires_inputz(ExactMatchStringEvaluator.requires_input%   s   € ð
 r   c                  ó   — y)z6
        This evaluator requires a reference.
        Tr   r   s    r   Úrequires_referencez,ExactMatchStringEvaluator.requires_reference,   s   € ð
 r   c                 ó
   — ddgS )z^
        Get the input keys.

        Returns:
            List[str]: The input keys.
        Ú	referenceÚ
predictionr   r   s    r   Ú
input_keysz$ExactMatchStringEvaluator.input_keys3   s   € ð ˜\Ð*Ð*r   c                  ó   — y)zb
        Get the evaluation name.

        Returns:
            str: The evaluation name.
        Úexact_matchr   r   s    r   Úevaluation_namez)ExactMatchStringEvaluator.evaluation_name=   s   € ð r   r   r   c                óJ  — | j                   r |j                  «       }|j                  «       }| j                  rh|j                  t        j                  ddt        j                  «      «      }|j                  t        j                  ddt        j                  «      «      }| j                  rh|j                  t        j                  ddt        j                  «      «      }|j                  t        j                  ddt        j                  «      «      }dt        ||k(  «      iS )a0  
        Evaluate the exact match between the prediction and the reference.

        Args:
            prediction (str): The prediction string.
            reference (Optional[str], optional): The reference string.

        Returns:
            dict: The evaluation results containing the score.
        Ú Úscore)r   Úlowerr   Ú	translateÚstrÚ	maketransÚstringÚpunctuationr	   ÚdigitsÚint)r   r   r   r
   s       r   Ú_evaluate_stringsz+ExactMatchStringEvaluator._evaluate_stringsG   sÖ   € ð" ×ÒØ#×)Ñ)Ó+ˆJØ!Ÿ™Ó)ˆIØ×"Ò"Ø#×-Ñ-¬c¯m©m¸BÀÄF×DVÑDVÓ.WÓXˆJØ!×+Ñ+¬C¯M©M¸"¸bÄ&×BTÑBTÓ,UÓVˆIØ×ÒØ#×-Ñ-¬c¯m©m¸BÀÄFÇMÁMÓ.RÓSˆJØ!×+Ñ+¬C¯M©M¸"¸bÄ&Ç-Á-Ó,PÓQˆIØœ˜Z¨9Ñ4Ó5Ð6Ð6r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úboolr   r   Úpropertyr   r   Úlistr%   r   r   Údictr+   Ú__classcell__)r   s   @r   r   r      sÝ   ø„ ñð& "Ø#(Ø$ò-ð ð-ð !ð	-ð
 ð-ð õ-ð ð ò ó ðð ð Dò ó ðð ð+˜D ™Iò +ó ð+ð ð ò ó ðð7ð ð7ð ð	7ð
 ð7ð 
÷7r   r   )r'   Útypingr   Úlangchain.evaluation.schemar   r   r   r   r   Ú<module>r7      s   ðÛ Ý å 7ôZ7 õ Z7r   