Agreement
labl.utils.agreement.AgreementOutput
dataclass
¶
Data class for storing the output of the inter-annotator agreement computation.
Attributes:
| Name | Type | Description |
|---|---|---|
full |
float | None
|
The full agreement for all annotation sets. |
pair |
list[list[float]]
|
Pairwise agreement between all annotators. |
type |
str
|
The type of agreement measure employed. |
labl.utils.agreement.get_labels_agreement
¶
get_labels_agreement(
label_type: type,
labels_array: NDArray[ValueScalarType],
level_of_measurement: LevelOfMeasurement | None = None,
) -> AgreementOutput
Compute the inter-annotator agreement using Krippendorff's alpha for an (M, N) array of labels, where M is the number of annotators and N is the number of units.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Literal['nominal', 'ordinal', 'interval', 'ratio']
|
The level of measurement for the labels when using Krippendorff's alpha. Can be "nominal", "ordinal", "interval", or "ratio", depending on the type of labels. Default: "nominal" for string labels, "ordinal" for int labels, and "interval" for float labels. |
None
|
Returns:
| Type | Description |
|---|---|
AgreementOutput
|
Labels correlation (for numeric) or inter-annotator agreement (for categorical) between the two entries |