Skip to content

medcat.storage.mp_ents_save

Classes:

Attributes:

logger module-attribute

logger = getLogger(__name__)

BatchAnnotationSaver

BatchAnnotationSaver(save_dir: str, batches_per_save: int)

Attributes:

Source code in medcat-v2/medcat/storage/mp_ents_save.py
14
15
16
17
18
19
20
21
22
def __init__(self, save_dir: str, batches_per_save: int):
    self.save_dir = save_dir
    self.batches_per_save = batches_per_save
    self._batch_cache: list[list[
        tuple[str, Union[dict, Entities, OnlyCUIEntities]]]] = []
    os.makedirs(save_dir, exist_ok=True)
    self.part_number = 0
    self.annotated_ids_path = os.path.join(
        save_dir, "annotated_ids.pickle")

annotated_ids_path instance-attribute

annotated_ids_path = join(save_dir, 'annotated_ids.pickle')

batches_per_save instance-attribute

batches_per_save = batches_per_save

part_number instance-attribute

part_number = 0

save_dir instance-attribute

save_dir = save_dir