medkit.text.postprocessing.overlapping#

Functions:

filter_overlapping_entities(entities)

Filter a list of entities and remove overlaps.

filter_overlapping_entities(entities)[source]#

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

entities (List[Entity]) – Entities to filter

Return type

List[Entity]

Returns

List[Entity] – Filtered entities