MultiLabelEntry
labl.data.base_sequence.BaseMultiLabelEntry
¶
Bases: BaseLabeledSequence[EntryType], ABC
Class for a list of EntryType objects representing multiple labels over the same text.
Source code in labl/data/base_sequence.py
label_counts
property
¶
Counts the number of labels for each token in the original text.
tokens_with_label_counts
property
¶
tokens_with_label_counts: LabeledTokenList
Returns a list of LabeledToken with the number of labels for each token in the original text.
get_agreement
¶
get_agreement(
level_of_measurement: LevelOfMeasurement | None = None,
) -> AgreementOutput
Compute the inter-annotator agreement for the token labels of all label sets using Krippendorff's alpha.
Source code in labl/data/base_sequence.py
labl.data.labeled_entry.MultiLabelEntry
¶
Bases: BaseMultiLabelEntry[LabeledEntry]
Class for a list of LabeledEntry representing multiple labels over the same text.
Source code in labl/data/base_sequence.py
labl.data.edited_entry.MultiEditEntry
¶
Bases: BaseMultiLabelEntry[EditedEntry]
Class for a list of EditedEntry representing multiple edits over the same orig text.
Source code in labl/data/base_sequence.py
merge_gap_annotations
¶
merge_gap_annotations(
merge_fn: Callable[[Sequence[LabelType]], LabelType]
| None = None,
keep_final_gap: bool = True,
) -> None
Merge gap annotations in the tokens of orig and edit.
This method is equivalent to calling EditedEntry.from_edits with with_gaps=False. Gap annotations are merged
to the next non-gap token to the right, and the gap label is added to the label of the non-gap token. The last
gap is kept to account for insertions at the end of the text.
E.g. GAP Hello GAP World GAP ! GAP becomes Hello World ! GAP.
I S I I IS I I