medcat.utils.training_utils
Functions:
-
cheating_component–Creates and uses a cheating component within the pipe.
-
dataset_aware_component–Creates and uses a dataset aware component within the pipe.
cheating_component
cheating_component(cat: CAT, comp_type: CoreComponentType, predictor: Callable[[MutableDocument], list[MutableEntity]])
Creates and uses a cheating component within the pipe.
This component will "predict" entities as per the predictor it is given.
Parameters:
-
(catCAT) –The model pack.
-
(comp_typeCoreComponentType) –The component type (generally NER or linker).
-
(predictorCallable[[MutableDocument], list[MutableEntity]]) –The predictor to use.
Source code in medcat-v2/medcat/utils/training_utils.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
dataset_aware_component
dataset_aware_component(cat: CAT, comp_type: CoreComponentType, dataset: MedCATTrainerExport)
Creates and uses a dataset aware component within the pipe.
This simplfies trainin for and evaluating one component at a time by swapping out the other component for one that has perfect performance since it knows the dataset.
Parameters:
-
(catCAT) –The model pack.
-
(comp_typeCoreComponentType) –The component type.
-
(datasetMedCATTrainerExport) –The dataset in question.
Source code in medcat-v2/medcat/utils/training_utils.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |