Skip to content

Commit 72bbe83

Browse files
authored
fix: Use MedCAT's multiprocessing_batch_char_size (#8)
Replace the call to MedCAT's 'multiprocessing' with the 'multiprocessing_batch_char_size' method in the 'MedCATModel' service. The former has been deprecated since version 1.10.0 and is removed in 1.12.0, therefore causing our bulk processing API to fail. Closes #7 Signed-off-by: Phoevos Kalemkeris <[email protected]>
1 parent 5d94c50 commit 72bbe83

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/model_services/medcat_model.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,12 @@ def annotate(self, text: str) -> Dict:
101101
def batch_annotate(self, texts: List[str]) -> List[Dict]:
102102
batch_size_chars = 500000
103103

104-
docs = self.model.multiprocessing(self._data_iterator(texts),
105-
batch_size_chars=batch_size_chars,
106-
nproc=max(int(cpu_count() / 2), 1),
107-
addl_info=["cui2icd10", "cui2ontologies", "cui2snomed", "cui2athena_ids"])
104+
docs = self.model.multiprocessing_batch_char_size(
105+
self._data_iterator(texts),
106+
batch_size_chars=batch_size_chars,
107+
nproc=max(int(cpu_count() / 2), 1),
108+
addl_info=["cui2icd10", "cui2ontologies", "cui2snomed", "cui2athena_ids"]
109+
)
108110
annotations_list = []
109111
for _, doc in docs.items():
110112
annotations_list.append(self.get_records_from_doc(doc))

0 commit comments

Comments
 (0)