BRR
Annotation Analysis
Package to analyse inter-annotator agreement.
Simple package to compute Interannotation Agreement with a simple interface.
Getting Started
Install package:
pip3 install annotation_analysis
Example usage:
from annotation_analysis import interannotator_metrics
if __name__ == "__main__":
annotations = [["A","B","A"],["A","B","B"]]
k_alpha = interannotator_metrics.krippendorff_alpha(annotations)
f_kappa = interannotator_metrics.fleiss_kappa(annotations)
print(k_alpha)
print(f_kappa)
Documentation
function krippendorf_alpha(annotations:List[List],labels:Optional[List], ignore=Optional[List])
"""
Arguments:
- annotations:
- The list of annotations, assumed to be one "row" per annotator (i.e. annotations[0] is annotator #1).
- Number of Columns represents the number of datapoints.
- Important: at this stage only hashable values are allowed.
- E.g. with labels ["A","B"], and three datapoints and 2 annotators the following would be the valid structure:
- [["A","B","A"],["A","B","B"]],
- Annotator #1 (index=0) -> ["A","B","A"]
- Annotator #2 (index=1) -> ["A","B","B"]
- labels:
- Represents the optional list of valid labels.
- Important: at this stage only hashable values are allowed.
- ignore:
- Represents a list of optional labels that should be ignored
- I.e. If this is non-empty then for any datapoint, if any of the annotators has the ignored label, the data point with all annotators is ignored
Return:
- Krippendorff Alpha score for all annotators.
"""
function fleiss_kappa(annotations:List[List],labels:Optional[List], ignore=Optional[List])
"""
Arguments:
- annotations:
- The list of annotations, assumed to be one "row" per annotator (i.e. annotations[0] is annotator #1).
- Number of Columns represents the number of datapoints.
- Important: at this stage only hashable values are allowed.
- E.g. with labels ["A","B"], and three datapoints and 2 annotators the following would be the valid structure:
- [["A","B","A"],["A","B","B"]],
- Annotator #1 (index=0) -> ["A","B","A"]
- Annotator #2 (index=1) -> ["A","B","B"]
- labels:
- Represents the optional list of valid labels.
- Important: at this stage only hashable values are allowed.
- ignore:
- Represents a list of optional labels that should be ignored
- I.e. If this is non-empty then for any datapoint, if any of the annotators has the ignored label, the data point with all annotators is ignored
Return:
- Fleiss Kappa score for all annotators.
"""
(C) - Nikolai Rozanov 2022
Metadata
Release files for annotation-analysis 0.0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| annotation_analysis-0.0.0.3.tar.gz | 3.0 kB | Without provenance | Details for annotation_analysis-0.0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| annotation_analysis-0.0.0.3-py3-none-any.whl | Python 3 | none | any | Details for annotation_analysis-0.0.0.3-py3-none-any.whl |
Total release size: 6.9 kB
Release files / annotation_analysis-0.0.0.3.tar.gz
| Download URL | annotation_analysis-0.0.0.3.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf9e816257227501e4188f2f816f593dc9d290a39b6aed4a7dcef1dcca56d923
|
|
BLAKE2b-256 checksum How to use checksums |
65c4e6f55e25caa5651e5d03afa391a36e9f7ff241d0ac21e210077625281c19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.5
|
Release files / annotation_analysis-0.0.0.3-py3-none-any.whl
| Download URL | annotation_analysis-0.0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1ffdb6b9c318a024449c2af5599a11ca3d60523b05d29ac1f5bb2c8e6981e20
|
|
BLAKE2b-256 checksum How to use checksums |
5d1b5a6ff7cf740969a80c2df0b8850ea43d26f6123f52d7697cdfe3cf121171
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.5
|
Security for annotation-analysis 0.0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.