medkit.text.postprocessing.overlapping#
Functions#
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