medkit.text.postprocessing.overlapping

medkit.text.postprocessing.overlapping#

Functions#

filter_overlapping_entities(...)

Filter a list of entities and remove overlaps.

Module Contents#

medkit.text.postprocessing.overlapping.filter_overlapping_entities(entities: list[medkit.core.text.Entity]) list[medkit.core.text.Entity]#

Filter a list of entities and remove overlaps.

This method may be useful for the creation of data for named entity recognition, where a part of text can only contain one entity per β€˜word’. When an overlap is detected, the longest entity is preferred.

Parameters:
entitieslist of Entity

Entities to filter

Returns:
list of Entity

Filtered entities