§
    4P„jŒ#  ã                   óš  — d dl mZmZ ddlmZmZmZmZmZm	Z	 ddddej
        dfdee         deee                  d	efd
„Zej        d         fdee         deee                  dee         d	efd„Zdddej
        dfdedee         dedee         deded	efd„Zej        ej        ej        ddfdee         deee                  dededededed	efd„Zej        ej        ej        ddfdedee         dededededed	efd„Z	 	 	 	 d!dee         deee                  dedededed	e	fd„Z	 	 	 	 d!dedee         dedededed	e	fd „ZdS )"é    )ÚSequenceÚOptionalé   )ÚBLEUÚCHRFÚTERÚ	BLEUScoreÚ	CHRFScoreÚTERScoreÚexpNFÚ
hypothesesÚ
referencesÚreturnc                 óX   — t          ||||||¬¦  «        }|                     | |¦  «        S )aJ  Computes BLEU for a corpus against a single (or multiple) reference(s).
    This is the main CLI entry point for computing BLEU between a system output
    and a reference sentence.

    :param hypotheses: A sequence of hypothesis strings.
    :param references: A sequence of reference documents with document being
        defined as a sequence of reference strings.
    :param smooth_method: The smoothing method to use ('floor', 'add-k', 'exp' or 'none')
    :param smooth_value: The smoothing value for `floor` and `add-k` methods. `None` falls back to default value.
    :param force: Ignore data that looks already tokenized
    :param lowercase: Lowercase the data
    :param tokenize: The tokenizer to use
    :param use_effective_order: Don't take into account n-gram orders without any match.
    :return: a `BLEUScore` object
    )Ú	lowercaseÚforceÚtokenizeÚsmooth_methodÚsmooth_valueÚeffective_order)r   Úcorpus_score)	r   r   r   r   r   r   r   Úuse_effective_orderÚmetrics	            úU/root/disk_3tb/conda_envs/Huy-visual/lib/python3.11/site-packages/sacrebleu/compat.pyÚcorpus_bleur   	   s?   € õ. Ø 5°8Ø#°,Ø+ð-ñ -ô -€Fð
 ×Ò˜z¨:Ñ6Ô6Ð6ó    Úfloorr   c           	      ó.   — t          | |d|ddd¬¦  «        S )aæ  Computes BLEU for a corpus against a single (or multiple) reference(s).
    This convenience function assumes a particular set of arguments i.e.
    it disables tokenization and applies a `floor` smoothing with value `0.1`.

    This convenience call does not apply any tokenization at all,
    neither to the system output nor the reference. It just computes
    BLEU on the "raw corpus" (hence the name).

    :param hypotheses: A sequence of hypothesis strings.
    :param references: A sequence of reference documents with document being
        defined as a sequence of reference strings.
    :param smooth_value: The smoothing value for `floor`. If not given, the default of 0.1 is used.
    :return: Returns a `BLEUScore` object.

    r   TÚnone)r   r   r   r   r   )r   )r   r   r   s      r   Úraw_corpus_bleur    (   s,   € õ$ Ø�J¨gØ!¨¸Ø ð"ñ "ô "ð "r   TÚ
hypothesisr   r   r   c                 óX   — t          ||d|||¬¦  «        }|                     | |¦  «        S )aÝ  
    Computes BLEU for a single sentence against a single (or multiple) reference(s).

    Disclaimer: Computing BLEU at the sentence level is not its intended use as
    BLEU is a corpus-level metric.

    :param hypothesis: A single hypothesis string.
    :param references: A sequence of reference strings.
    :param smooth_method: The smoothing method to use ('floor', 'add-k', 'exp' or 'none')
    :param smooth_value: The smoothing value for `floor` and `add-k` methods. `None` falls back to default value.
    :param lowercase: Lowercase the data
    :param tokenize: The tokenizer to use
    :param use_effective_order: Don't take into account n-gram orders without any match.
    :return: Returns a `BLEUScore` object.
    F)r   r   r   r   r   r   )r   Úsentence_score)r!   r   r   r   r   r   r   r   s           r   Úsentence_bleur$   @   s?   € õ, Ø h°eØ#°,Ø+ð-ñ -ô -€Fð
 × Ò  ¨ZÑ8Ô8Ð8r   Ú
char_orderÚ
word_orderÚbetaÚremove_whitespaceÚeps_smoothingc                 óX   — t          |||| |¬¦  «        }|                     | |¦  «        S )a‡  
    Computes chrF for a corpus against a single (or multiple) reference(s).
    If `word_order` equals to 2, the metric is referred to as chrF++.

    :param hypotheses: A sequence of hypothesis strings.
    :param references: A sequence of reference documents with document being
        defined as a sequence of reference strings.
    :param char_order: Character n-gram order.
    :param word_order: Word n-gram order. If equals to 2, the metric is referred to as chrF++.
    :param beta: Determine the importance of recall w.r.t precision.
    :param eps_smoothing: If `True`, applies epsilon smoothing similar
    to reference chrF++.py, NLTK and Moses implementations. Otherwise,
    it takes into account effective match order similar to sacreBLEU < 2.0.0.
    :param remove_whitespace: If `True`, removes whitespaces prior to character n-gram extraction.
    :return: A `CHRFScore` object.
    ©r%   r&   r'   Ú
whitespacer)   )r   r   )r   r   r%   r&   r'   r(   r)   r   s           r   Úcorpus_chrfr-   ^   sB   € õ. ØØØØ(Ð(Ø#ð%ñ %ô %€Fð ×Ò˜z¨:Ñ6Ô6Ð6r   c                 óX   — t          |||| |¬¦  «        }|                     | |¦  «        S )aA  
    Computes chrF for a single sentence against a single (or multiple) reference(s).
    If `word_order` equals to 2, the metric is referred to as chrF++.

    :param hypothesis: A single hypothesis string.
    :param references: A sequence of reference strings.
    :param char_order: Character n-gram order.
    :param word_order: Word n-gram order. If equals to 2, the metric is referred to as chrF++.
    :param beta: Determine the importance of recall w.r.t precision.
    :param eps_smoothing: If `True`, applies epsilon smoothing similar
    to reference chrF++.py, NLTK and Moses implementations. Otherwise,
    it takes into account effective match order similar to sacreBLEU < 2.0.0.
    :param remove_whitespace: If `True`, removes whitespaces prior to character n-gram extraction.
    :return: A `CHRFScore` object.
    r+   )r   r#   )r!   r   r%   r&   r'   r(   r)   r   s           r   Úsentence_chrfr/   ~   sB   € õ, ØØØØ(Ð(Ø#ð%ñ %ô %€Fð × Ò  ¨ZÑ8Ô8Ð8r   Ú
normalizedÚno_punctÚasian_supportÚcase_sensitivec                 óT   — t          ||||¬¦  «        }|                     | |¦  «        S )a
  
    Computes TER for a corpus against a single (or multiple) reference(s).

    :param hypotheses: A sequence of hypothesis strings.
    :param references: A sequence of reference documents with document being
        defined as a sequence of reference strings.
    :param normalized: Enable character normalization.
    :param no_punct: Remove punctuation.
    :param asian_support: Enable special treatment of Asian characters.
    :param case_sensitive: Enables case-sensitivity.
    :return: A `TERScore` object.
    ©r0   r1   r2   r3   )r   r   )r   r   r0   r1   r2   r3   r   s          r   Ú
corpus_terr6   �   s<   € õ$ ØØØ#Ø%ð	'ñ 'ô '€Fð
 ×Ò˜z¨:Ñ6Ô6Ð6r   c                 óT   — t          ||||¬¦  «        }|                     | |¦  «        S )aÅ  
    Computes TER for a single hypothesis against a single (or multiple) reference(s).

    :param hypothesis: A single hypothesis string.
    :param references: A sequence of reference strings.
    :param normalized: Enable character normalization.
    :param no_punct: Remove punctuation.
    :param asian_support: Enable special treatment of Asian characters.
    :param case_sensitive: Enable case-sensitivity.
    :return: A `TERScore` object.
    r5   )r   r#   )r!   r   r0   r1   r2   r3   r   s          r   Úsentence_terr8   ·   s<   € õ" ØØØ#Ø%ð	'ñ 'ô '€Fð
 × Ò  ¨ZÑ8Ô8Ð8r   )FFFF)Útypingr   r   Úmetricsr   r   r   r	   r
   r   ÚTOKENIZER_DEFAULTÚstrr   ÚSMOOTH_DEFAULTSÚfloatr    Úboolr$   Ú
CHAR_ORDERÚ
WORD_ORDERÚBETAÚintr-   r/   r6   r8   © r   r   ú<module>rE      s\  ðØ %Ð %Ð %Ð %Ð %Ð %Ð %Ð %à DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ Dð $Ø!ØØØÔ/Ø$)ð7ð 7˜H SœMð 7Ø$ X¨c¤]Ô3ð7ð /8ð7ð 7ð 7ð 7ðB 59Ô4HÈÔ4Qð"ð " ¨¤ð "Ø (¨°#¬Ô 7ð"à"*¨5¤/ð"àV_ð"ð "ð "ð "ð4 (-Ø26Ø$)ØÔ1Ø.2ð9ð 9˜cð 9Ø& sœmð9à!$ð9ð !)¨¤ð9ð "ð	9ð (,ð9ð 8Að9ð 9ð 9ð 9ð@ #'¤/Ø"&¤/Ø œIØ*.Ø&+ð7ð 7˜H SœMð 7Ø$ X¨c¤]Ô3ð7àð7ð  ð7ð ð	7ð
 $(ð7ð  $ð7ð 1:ð7ð 7ð 7ð 7ðD %)¤OØ$(¤OØ"œiØ,0Ø(-ð9ð 9˜cð 9Ø& sœmð9à!ð9ð "ð9ð ð	9ð
 &*ð9ð "&ð9ð 3<ð9ð 9ð 9ð 9ðB #(Ø %Ø%*Ø&+ð7ð 7˜8 Cœ=ð 7Ø# H¨S¤MÔ2ð7àð7ð ð7ð #ð	7ð
  $ð7ð
 19ð7ð 7ð 7ð 7ð8 %*Ø"'Ø',Ø(-ð9ð 9˜Sð 9Ø% cœ]ð9à!ð9ð  ð9ð !%ð	9ð
 "&ð9ð
 3;ð9ð 9ð 9ð 9ð 9ð 9r   