Skip to content

Commit

Permalink
Added multiprocessing for de-id bulk calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
vladd-bit committed Oct 2, 2024
1 parent a452a00 commit af0cef0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions medcat_service/nlp_processor/medcat_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit af0cef0

Please sign in to comment.