From af0cef07583c4e29ca8b335c0aca834eea12b962 Mon Sep 17 00:00:00 2001 From: vladd-bit Date: Wed, 2 Oct 2024 10:02:29 +0100 Subject: [PATCH] Added multiprocessing for de-id bulk calls. --- medcat_service/nlp_processor/medcat_processor.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/medcat_service/nlp_processor/medcat_processor.py b/medcat_service/nlp_processor/medcat_processor.py index ee5335f..bf5f969 100644 --- a/medcat_service/nlp_processor/medcat_processor.py +++ b/medcat_service/nlp_processor/medcat_processor.py @@ -173,10 +173,7 @@ def process_content_bulk(self, content): try: if self.DEID_MODE: - _text_res = [] - for text_record in content: - _text_res.append(self.cat.deid_text(text_record["text"], redact=self.DEID_REDACT)) - content = [{"text": txt} for txt in _text_res] + ann_res = self.cat.deid_multi_texts(MedCatProcessor._generate_input_doc(content, invalid_doc_ids), redact=self.DEID_REDACT) else: ann_res = self.cat.multiprocessing_batch_char_size( MedCatProcessor._generate_input_doc(content, invalid_doc_ids), nproc=self.bulk_nproc)