medkit.io._common#

Attributes#

Functions#

get_anns_by_type(→ dict[str, ...)

Filter annotations by labels and return a dictionary by type of annotation.

Module Contents#

medkit.io._common.logger#
medkit.io._common.get_anns_by_type(medkit_doc: medkit.core.text.TextDocument, anns_labels: list[str] | None = None) dict[str, medkit.core.text.TextAnnotation]#

Filter annotations by labels and return a dictionary by type of annotation.

Parameters:
medkit_docTextDocument

Text document with annotations

anns_labelslist of str, optional

Labels to filter annotations. If not provided, all annotations will be in the dictionary

Returns:
Dict[str, TextAnnotation]

Annotations by type: ‘entities’, ‘relations’, and ‘segments’.