Skip to content

Commit

Permalink
Updated process method for De-ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
vladd-bit committed Mar 1, 2024
1 parent 4ef752a commit 673dcca
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions medcat_service/nlp_processor/medcat_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,15 @@ def process_content(self, content):
# when it contains any non-blank characters

start_time_ns = time.time_ns()

if text is not None and len(text.strip()) > 0:
entities = self.cat.get_entities(text)
else:
entities = []

if self.DEID_MODE:
entities = self.cat.get_entities(text)["entities"]
text = self.cat.deid_text(text, redact=self.DEID_REDACT)
else:
if text is not None and len(text.strip()) > 0:
entities = self.cat.get_entities(text)
else:
entities = []

elapsed_time = (time.time_ns() - start_time_ns) / 10e8 # nanoseconds to seconds

Expand Down

0 comments on commit 673dcca

Please sign in to comment.