medcat.utils.postprocessing
Functions:
-
create_main_ann– -
filter_linked_annotations–Creates annotation in the spacy ents list
create_main_ann
create_main_ann(doc: MutableDocument, show_nested_entities: bool = False) -> None
Source code in medcat-v2/medcat/utils/postprocessing.py
6 7 8 9 10 11 12 13 14 15 | |
filter_linked_annotations
filter_linked_annotations(doc: MutableDocument, linked_ents: list[MutableEntity], show_nested_entities: bool = False) -> list[MutableEntity]
Creates annotation in the spacy ents list from all the annotations for this document.
Parameters:
-
(docDoc) –Spacy document.
-
(linked_entslist[MutableEntity]) –The linked entities.
-
(show_nested_entitiesbool, default:False) –Whether to keep overlapping/nested entities. If True, keeps all entities. If False, filters overlapping entities keeping only the longest matches. Defaults to False.
Returns:
-
list[MutableEntity]–list[MutbaleEntity]: The resulting entities
Source code in medcat-v2/medcat/utils/postprocessing.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |