o
    Mfm  ã                   @   s*   d dl Z d dlmZ G dd„ de jƒZdS )é    N)ÚAnnotationTaskc                   @   s0   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
S )ÚTestDisagreementzN
    Class containing unit tests for nltk.metrics.agreement.Disagreement.
    c                 C   ó$   g d¢}t |ƒ}|  | ¡ d¡ dS )z}
        Simple test, based on
        https://github.com/foolswood/krippendorffs_alpha/raw/master/krippendorff.pdf.
        )©Úcoder1Údress1ÚYES©Úcoder2r   ÚNO©Úcoder3r   r   ©r   Údress2r   ©r
   r   r   )r   Údress3r   ç‡¼Š1UUÕ¿N©r   ÚassertAlmostEqualÚalpha©ÚselfÚdataÚannotation_task© r   úb/var/www/html/analyze/labelStudio/lib/python3.10/site-packages/nltk/test/unit/test_disagreement.pyÚ	test_easy   s   zTestDisagreement.test_easyc                 C   r   )zœ
        Same simple test with 1 rating removed.
        Removal of that rating should not matter: K-Apha ignores items with
        only 1 rating.
        )r   r	   r   r   r   r   Nr   r   r   r   r   Ú
test_easy2   s   zTestDisagreement.test_easy2c                 C   r   )zw
        More advanced test, based on
        http://www.agreestat.com/research_papers/onkrippendorffalpha.pdf
        ©))ÚAÚ1r    )ÚBr    r    )ÚDr    r    )r   Ú2r#   )r!   r#   r#   )ÚCr#   Ú3)r"   r#   r#   )r   r%   r%   )r!   r%   r%   )r$   r%   r%   )r"   r%   r%   )r   Ú4r%   )r!   r&   r%   )r$   r&   r%   )r"   r&   r%   )r   Ú5r#   )r!   r'   r#   )r$   r'   r#   )r"   r'   r#   )r   Ú6r    )r!   r(   r#   )r$   r(   r%   )r"   r(   r&   )r   Ú7r&   )r!   r)   r&   )r$   r)   r&   )r"   r)   r&   )r   Ú8r    )r!   r*   r    )r$   r*   r#   )r"   r*   r    )r   Ú9r#   )r!   r+   r#   )r$   r+   r#   )r"   r+   r#   )r!   Ú10r'   )r$   r,   r'   )r"   r,   r'   )r$   Ú11r    )r"   r-   r    )r$   Ú12r%   çrË†òÊç?Nr   r   r   r   r   Útest_advanced,   ó   +zTestDisagreement.test_advancedc                 C   r   )zƒ
        Same more advanced example, but with 1 rating removed.
        Again, removal of that 1 rating should not matter.
        r   r/   Nr   r   r   r   r   Útest_advanced2_   r1   zTestDisagreement.test_advanced2N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r0   r2   r   r   r   r   r      s    3r   )ÚunittestÚnltk.metrics.agreementr   ÚTestCaser   r   r   r   r   Ú<module>   s    